Package-level declarations

Types

Link copied to clipboard

The default OverlayDialogFactory for AlertOverlay reads this value for the @StyleRes themeResId: Int argument of AlertDialog.Builder().

Link copied to clipboard

Interface implemented by a rendering class to allow it to drive an Android UI via an appropriate OverlayDialogFactory implementation.

Link copied to clipboard
class BackButtonScreen<C : Screen>(val content: C, val shadow: Boolean = false, val onBackPressed: () -> Unit? = null) : Wrapper<Screen, C> , AndroidScreen<BackButtonScreen<C>>

Adds optional back button handling to a content rendering, possibly overriding that the wrapped rendering's own back button handler.

Link copied to clipboard
open class BackStackContainer @JvmOverloads constructor(context: Context, attributeSet: AttributeSet? = null, defStyle: Int = 0, defStyleRes: Int = 0) : FrameLayout

A container view that can display a stream of BackStackScreen instances.

Link copied to clipboard

Does the bulk of the work of maintaining a set of Dialogs to reflect lists of Overlay, constrained to cover only the bounds of a single View. This is the work modeled by BodyAndOverlaysScreen and executed by BodyAndOverlaysContainer. This class is public to allow implementation of custom Overlay-based layouts if BodyAndOverlaysContainer is too restrictive.

Link copied to clipboard

Factory for Dialog instances that can show renderings of type OverlayT. Most easily implemented using the ScreenOverlay interface to define the Dialog contentView, and calling the asDialogHolderWithContent extension function to set it.

Link copied to clipboard

ViewEnvironment service object used by Overlay.toDialogFactory to find the right OverlayDialogFactory. The default implementation makes AndroidOverlay work, and provides default bindings for AlertOverlay and FullScreenModal.

Link copied to clipboard

Associates a dialog with a function (runner) that can update it to display instances of OverlayT. Also holds a reference to the ViewEnvironment that was most recently used to update the dialog.

Link copied to clipboard

Handles persistence chores for container views that manage a set of NamedScreen renderings, showing a view for one at a time -- think back stacks or tab sets.

Properties

Link copied to clipboard

Returns the Overlay most recently used to update the receiver's dialog via a call to show.

Functions

Link copied to clipboard
fun <C : Screen, O : ScreenOverlay<C>> ComponentDialog.asDialogHolderWithContent(overlay: O, environment: ViewEnvironment, setContent: (ScreenViewHolder<C>) -> Unit = { contentViewHolder -> setContentView(contentViewHolder.view) fixBackgroundAndDimming() }): OverlayDialogHolder<O>

Given a ComponentDialog, wrap it in an OverlayDialogHolder that can drive the Dialog's content via instances of a particular type of ScreenOverlay. This is the most convenient way to implement OverlayDialogFactory, see the kdoc there for complete details.

Link copied to clipboard

Returns true if overlay is compatible with the Overlay instance that was last shown by the dialog managed by the receiver.

Link copied to clipboard

Called from the default setContent function of asDialogHolderWithContent. Fixes the default background and window flag settings that interfere with making a Dialog respect the bounds required by OverlayArea.

Link copied to clipboard

Returns the bounds of this View in the coordinate space of the device screen, based on View.getLocationOnScreen and its reported width and height.

Link copied to clipboard

Wrapper for the two arg variant of setBackHandler, a convenience for the common pattern of using a nullable function as the back handler to indicate that back handling should be disabled.

fun View.setBackHandler(enabled: Boolean = true, onBack: () -> Unit)

A function to be called if the device back button is pressed while this view is active, as determined by its ViewTreeLifecycleOwner, via an OnBackPressedCallback. On succeeding calls, the previously created OnBackPressedCallback will be updated, and will maintain its position in the OnBackPressedDispatcher priority queue.

Link copied to clipboard

Updates the size of the Window of the receiving Dialog. bounds is expected to be in global screen coordinates, as returned from View.getScreenRect.

Link copied to clipboard

Updates the dialog managed by the receiver to display overlay, and updates the receiver's environment as well.

Link copied to clipboard
Link copied to clipboard

Wraps the receiver in in an OverlayDialogHolder that is able to update its buttons as new AlertOverlay renderings are received.