Request

data class Request(    val positionsRelativeToAnchor: List<TtPopOverPositionRelativeToAnchor>,     val offsetXRelativeToAnchor: Int = 0,     val offsetYRelativeToAnchor: Int = 0,     @AttrRes val enterAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_enter,     @AttrRes val exitAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_exit,     val autoDismissTimeout: TtPopOverHandler.Request.AutoDismissTimeout = AutoDismissTimeout.Disabled,     val dismissOnTouchOutside: Boolean = true,     val shouldHidePlatformSystemUi: Boolean = false,     val tag: String = "default",     val createContentFragment: () -> Fragment)

A class that holds all data necessary to show a popover.

Parameters

positionsRelativeToAnchor

List of positions relative to the anchor view passed to TtPopOverHandler.showOrRestorePopOver. List cannot be empty. Positions are traversed in order to check if there is enough room on the screen to show the popover. The first found position is used, the rest is ignored. If none of the positions has enough space, then the popover is shown at the default position of the dialog in the Android OS, usually at the center of the screen.

offsetXRelativeToAnchor

An offset of the popover in pixels, default value is 0.

offsetYRelativeToAnchor

An offset of the popover in pixels, default value is 0.

enterAnimatorAttrId

The resource ID of the attribute of the animation to execute when the popover is shown, default value is tt_popover_enter.

exitAnimatorAttrId

The resource ID of the attribute of the animation to execute when the popover is dismissed, default value is tt_popover_exit.

autoDismissTimeout

Optional timeout to auto dismiss the popover. Timeout is reset after each click inside the popover.

dismissOnTouchOutside

Flag to control whether a popover should be dismissed when screen is touched outside of the popover. Default value is true.

shouldHidePlatformSystemUi

If true the status and navigation bars of the platform's system-ui will be hidden while the popover is displayed. If false the status and navigation bars will be visible while the popover is displayed. Default value is false.

tag

The tag of the request. There can be only one popover on the screen with a given tag. If a popover with the given tag is shown, then it is reused with previous content. In the common popover use case, when only one popover can be shown on at the same time, the tag is irrelevant, but must be the same in all requests. For example, the default value can be used. In case of showing multiple popovers at the same time the tags must be different, and all TtPopOverHandler instances of popovers on screen must be kept to be able to dismiss all popovers. The example in the TtPopOverHandler documentation does not show this case.

createContentFragment

The function to create a Fragment to be shown inside the popover.

Constructors

Link copied to clipboard
constructor(    positionsRelativeToAnchor: List<TtPopOverPositionRelativeToAnchor>,     offsetXRelativeToAnchor: Int = 0,     offsetYRelativeToAnchor: Int = 0,     @AttrRes enterAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_enter,     @AttrRes exitAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_exit,     autoDismissTimeout: TtPopOverHandler.Request.AutoDismissTimeout = AutoDismissTimeout.Disabled,     dismissOnTouchOutside: Boolean = true,     shouldHidePlatformSystemUi: Boolean = false,     tag: String = "default",     createContentFragment: () -> Fragment)

Types

Link copied to clipboard
sealed class AutoDismissTimeout

The values of the Request.autoDismissTimeout param.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tag: String