Package com.pspdfkit.compose.ui
Class PopupMenuKt
-
- All Implemented Interfaces:
public final class PopupMenuKt
-
-
Method Summary
Modifier and Type Method Description final static Unit
PopupMenu(PopupMenuState popupMenuState, PopupMenuAppearance appearance, Function0<Unit> onDismiss)
A popup menu that can be shown at a given offset. final static Unit
AnimatedPopup(Modifier modifier, PopupProperties properties, Boolean expanded, PopupPositionProvider popupPositionProvider, Function0<Unit> onDismiss, EnterTransition enter, ExitTransition exit, Function1<AnimatedVisibilityScope, Unit> content)
Animates the showing/hiding contents of a Popup -
-
Method Detail
-
PopupMenu
@Composable() final static Unit PopupMenu(PopupMenuState popupMenuState, PopupMenuAppearance appearance, Function0<Unit> onDismiss)
A popup menu that can be shown at a given offset. The menu items are shown in a row, and if there are more items than can fit in the row, a "more" button is shown. When the "more" button is clicked, the remaining items are shown in a dropdown. The menu will not exceed the bounds of its parent container
Usage:
var popupState by remember { mutableStateOf(PopupMenuState()) } Box( modifier = Modifier .fillMaxSize() .pointerInput(Unit) { detectTapGestures( onLongPress = { offset -> val menuItems = listOf( PopupMenuItemImpl("item 1") { action1() }, PopupMenuItemImpl("item 2") { action2() }, PopupMenuItemImpl("item 3") { action3() }, PopupMenuItemImpl("item 4") { action4() } ) popupState = PopupMenuState.shownAt(offset, menuItems) } ) } ) { PopupMenu( popupStatus, dismiss = { popupStatus = PopupMenuState.hidden() } ) }
-
AnimatedPopup
@Composable() final static Unit AnimatedPopup(Modifier modifier, PopupProperties properties, Boolean expanded, PopupPositionProvider popupPositionProvider, Function0<Unit> onDismiss, EnterTransition enter, ExitTransition exit, Function1<AnimatedVisibilityScope, Unit> content)
Animates the showing/hiding contents of a Popup
-
-
-
-