TtPopOver

class TtPopOver

Deprecated

Use TtPopOverHandler instead.

A transient view with custom content which appears above other content onscreen. It can show additional content such as context menus or content that does not easily fit into the UI. It can be opened from any component. If it is desired that the TtPopOver should be positioned relative to the component responsible for opening it, this component should be passed as the anchorView parameter the show method. The TtPopOver is displayed above all other views in the application. Only a single TtPopOver can be displayed at any given time.

Parameters

fragmentManager

The FragmentManager to be used when showing or dismissing the TtPopOverDialogFragment.

lifecycleOwner

The LifecycleOwner to be used to provide the lifecycle of the TtPopOverDialogFragment.

viewModelProvider

The ViewModelProvider to be used to provide the TtPopOverViewModel instance.

entryAnimatorAttrId

The resource ID of the animation to execute when the TtPopOver is shown.

exitAnimatorAttrId

The resource ID of the animation to execute when the TtPopOver is dismissed.

shouldHidePlatformSystemUi

If true the status and navigation bars will be hidden while the TtPopOver is displayed. If false the status and navigation bars will be visible while the TtPopOver is displayed.

onPopOverDismissedListener

The action to perform when the TtPopOver is dismissed.

onPopOverTouchOutsideListener

The action to perform when the user taps outside of the TtPopOver.

automaticDismissTimeoutMs

The timeout in milliseconds after which to automatically dismiss the TtPopOver. Any user interaction with the TtPopOver will reset the timeout. If null then the TtPopOver will not be dismissed automatically.

Constructors

Link copied to clipboard
constructor(parentFragment: Fragment, @AttrRes entryAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_enter, @AttrRes exitAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_exit, shouldHidePlatformSystemUi: Boolean = false, onPopOverDismissedListener: TtPopOver.OnPopOverDismissedListener? = null, onPopOverTouchOutsideListener: TtPopOver.OnPopOverTouchOutsideListener? = null, automaticDismissTimeoutMs: Long? = parentFragment.requireContext().getIntegerByAttr(CoreThemeR.attr.tt_delay_duration_short_ms).toLong())

A convenience constructor to create a TtPopOver given a parent Fragment.

constructor(parentActivity: FragmentActivity, @AttrRes entryAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_enter, @AttrRes exitAnimatorAttrId: Int? = CoreThemeR.attr.tt_popover_exit, shouldHidePlatformSystemUi: Boolean = false, onPopOverDismissedListener: TtPopOver.OnPopOverDismissedListener? = null, onPopOverTouchOutsideListener: TtPopOver.OnPopOverTouchOutsideListener? = null, automaticDismissTimeoutMs: Long? = parentActivity.getIntegerByAttr(CoreThemeR.attr.tt_delay_duration_short_ms).toLong())

A convenience constructor to create a TtPopOver given a parent FragmentActivity.

Types

Link copied to clipboard
object Companion
Link copied to clipboard

An interface for listeners that wish to be notified when a TtPopOver is dismissed.

Link copied to clipboard

An interface for listeners that wish to be notified when the user taps outside the TtPopOver.

Link copied to clipboard

The position to display the TtPopOver relative to the position of its anchor view.

Functions

Link copied to clipboard
fun dismiss()

Dismisses this TtPopOver. onPopOverDismissedListener will be invoked if assigned.

Link copied to clipboard
fun show(contentFragment: Fragment, anchorView: View, positionRelativeToAnchorPriority: List<TtPopOver.PositionRelativeToAnchor>)

Populates TtPopOver with contentFragment and shows it, using positionRelativeToAnchorPriority (must not be empty) to determine the position relative to anchorView.

fun show(contentFragment: Fragment, anchorView: View, positionRelativeToAnchor: TtPopOver.PositionRelativeToAnchor, offsetXRelativeToAnchor: Int = 0, offsetYRelativeToAnchor: Int = 0)

Populates TtPopOver with contentFragment and shows it, using positionRelativeToAnchor to determine the position relative to anchorView.