DeweyBottomSheet

open class DeweyBottomSheet(mContext: Context, mStyle: DeweyBottomSheet.Style, mUiMode: DeweyBottomSheet.UiMode, @StyleRes mThemeResId: Int?) : DeweyPopupInterface

A popup window that shows the the dewey bottom sheet.

It supports overriding the ui mode to force light or dark mode. In those cases, A DayNight theme must be provided via mThemeResId to make it work. Since custom view layout requires certain attributes to be set in the theme, it is recommended to use the default app theme. For UiMode.AUTOMATIC, it's not necessary.

Constructors

Link copied to clipboard
constructor(context: Context, style: DeweyBottomSheet.Style)
constructor(mContext: Context, mStyle: DeweyBottomSheet.Style, mUiMode: DeweyBottomSheet.UiMode, @StyleRes mThemeResId: Int?)

Types

Link copied to clipboard
Link copied to clipboard

The UI mode.

Properties

Link copied to clipboard

Whether the popup is cancelable. If set to true, the popup can be dismissed by pressing the back button.

Link copied to clipboard

Whether the popup is canceled when the user touches outside of the popup.

Link copied to clipboard

Whether the dismiss icon button is visible.

Link copied to clipboard

Whether the drag-to-dismiss gesture is enabled. If set to true, the user can drag the popup to dismiss it.

Link copied to clipboard

Whether the handle is visible. The handle is the small bar at the top of the popup that indicates that the popup is draggable.

Link copied to clipboard

Whether the title bar is visible.

Link copied to clipboard

Whether the border below the title bar is visible. It is only visible when the title bar is visible.

Functions

Link copied to clipboard
open fun canNestedScrollVertically(direction: Int): Boolean

Override this method if the content view contains vertically scrollable views that could conflict with the drag-to-dismiss gesture. For example, if the content view contains a vertically scrollable RecyclerView:

Link copied to clipboard
open override fun dismiss()
Link copied to clipboard

Get the content view that was inflated by the setContentView method. This method will return null if the content view has not been inflated yet.

Link copied to clipboard
open override fun isShowing(): Boolean
Link copied to clipboard
Link copied to clipboard

Executed when the content view passed via setContentView is inflated.

Link copied to clipboard
open fun onCreate()
Link copied to clipboard
open fun onDismiss(reason: Int)

Executed when the popup is dismissed. This has the same trigger as the setOnDismissListener.

Link copied to clipboard
open fun onStart()
Link copied to clipboard
open fun onStop()
Link copied to clipboard

Set the visibility of the background overlay. The overlay is a semi-transparent background that covers the screen behind the popup.

Link copied to clipboard
fun setContentView(@LayoutRes layoutRes: Int)
Link copied to clipboard

Customize the enter animation parameters for the popup. The default values are:

Link copied to clipboard

Set the maximum height restriction of this popup content. Only for portrait mode.

Link copied to clipboard

Optional. Set the listener for the dismiss image button, if not set, the default behavior is to dismiss the popup.

Link copied to clipboard

Optional. Set the listener for the open progress of the popup. This reflects the percentage of the popup between fully collapsed and fully expanded. User dragging the popup will also trigger this listener, as well as the regular show and dismiss.

Link copied to clipboard

Set the primary button text and the listener for the click event. Setting the text to null will hide the button.

Link copied to clipboard

Override the primary button size. Optional. Default is ButtonSize.LARGE.

Link copied to clipboard

Override the primary button style. Optional. Default is ButtonStyle.ACCENT.

Link copied to clipboard

Set the secondary button text and the listener for the click event. Setting the text to null will hide the button.

Link copied to clipboard

Override the secondary button size. Optional. Default is ButtonSize.LARGE.

Link copied to clipboard

Override the secondary button style. Optional. Default is ButtonStyle.SUBTLE.

Link copied to clipboard

Set whether the sheet should be dismissed when the configuration changes, like orientation change. Default is false.

Link copied to clipboard
fun setTitle(@StringRes titleRes: Int)

fun setTitle(title: String)

Set the text shown in the title bar of the popup. Optional.

Link copied to clipboard
open override fun setWindowFocusAccessibilityText(charSequence: CharSequence)

Set the message that will be read by the screen reader when the popup container gets focus. This could be used to provide additional context to the user about the popup when it is firstly showing on the screen.

Link copied to clipboard
open override fun show()