BackButtonScreen

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.

Parameters

shadow

If true, onBackPressed is set as the backPressedHandler after the content rendering's view is built / updated, effectively overriding it. If false (the default), onBackPressed is set afterward, to allow the wrapped rendering to take precedence if it sets a backPressedHandler of its own -- the handler provided here serves as a default.

onBackPressed

The function to fire when the device back button is pressed, or null to set no handler -- or clear a handler that was set previously. Defaults to null.

Constructors

Link copied to clipboard
constructor(content: C, shadow: Boolean = false, onBackPressed: () -> Unit? = null)

Properties

Link copied to clipboard
open override val compatibilityKey: String
Link copied to clipboard
open override val content: C
Link copied to clipboard
val onBackPressed: () -> Unit? = null
Link copied to clipboard
val shadow: Boolean = false
Link copied to clipboard

Used to build instances of android.view.View as needed to display renderings of this type.

Functions

Link copied to clipboard
open override fun asSequence(): Sequence<C>
Link copied to clipboard
open override fun <D : Screen> map(transform: (C) -> D): BackButtonScreen<D>