Package-level declarations
Types
The default OverlayDialogFactory for AlertOverlay reads this value for the @StyleRes themeResId: Int
argument of AlertDialog.Builder()
.
Interface implemented by a rendering class to allow it to drive an Android UI via an appropriate OverlayDialogFactory implementation.
Adds optional back button handling to a content rendering, possibly overriding that the wrapped rendering's own back button handler.
A container view that can display a stream of BackStackScreen instances.
True in views managed by BodyAndOverlaysScreen when their events are being blocked by a ModalOverlay, giving covered views a signal that they should ignore events. This is necessary so that we can ignore events that happen in the time between calls to Dialog.show()
and the actual appearance of the Dialog window.
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.
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.
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.
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.
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.
Functions
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.
Returns true if overlay is compatible with the Overlay instance that was last shown by the dialog managed by the receiver.
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.
Returns the bounds of this View in the coordinate space of the device screen, based on View.getLocationOnScreen and its reported width and height.
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.
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.
Updates the size of the Window of the receiving Dialog. bounds is expected to be in global screen coordinates, as returned from View.getScreenRect.
Updates the dialog managed by the receiver to display overlay, and updates the receiver's environment as well.
Use the OverlayDialogFactory in environment to return the OverlayDialogFactory bound to the type of the receiving Overlay.
Wraps the receiver in in an OverlayDialogHolder that is able to update its buttons as new AlertOverlay renderings are received.