EquinoxScreen

abstract class EquinoxScreen<V : EquinoxViewModel>(val loggerEnabled: Boolean = true, val viewModel: V) : EquinoxNoModelScreen

The EquinoxScreen class is useful to create a screen with a lifecycle management similar to the Android's activities. This screen supports to attach the related androidx.lifecycle.ViewModel and operate with it

Related documentation: EquinoxScreens.md

Author

N7ghtm4r3 - Tecknobit

Parameters

V

generic type used to allow the use of own viewmodel in custom screens

See also

Constructors

Link copied to clipboard
constructor(loggerEnabled: Boolean = true, viewModel: V)

Properties

Link copied to clipboard
private val loggerEnabled: Boolean = true

Whether enabled the logging to log the events occurred in the ShowContent composable, it is suggested to disable it in production

Link copied to clipboard
protected open val viewModel: V

Support viewmodel to automatically manage the retriever suspension or restarting with the lifecycle events of the screen

Functions

Link copied to clipboard
protected abstract fun ArrangeScreenContent()

Method used to arrange the content of the screen to display

Link copied to clipboard
protected abstract fun CollectStates()

Method used to collect or instantiate the states of the screen

Link copied to clipboard

Method used to collect or instantiate the states of the screen after a loading required to correctly assign an initial value to the states. For example in your custom screen:

Link copied to clipboard
protected fun LifecycleManager(lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current)

Method used to manage the lifecycle of the composable where this Method has been invoked

Link copied to clipboard
protected fun logScreenEvent(event: Lifecycle.Event)
protected fun logScreenEvent(event: String)

Method used to log the event occurred in the current screen

Link copied to clipboard
protected open fun onAny()

Method invoked when in the ShowContent composable has occurred any of the possible events

Link copied to clipboard
protected open override fun onCreate()

Method invoked when the ShowContent composable has been created.

Link copied to clipboard
protected open override fun onDestroy()

Method invoked when the ShowContent composable has been destroyed.

Link copied to clipboard
protected open override fun onDispose()

Method invoked when the ShowContent composable has been disposed.

Link copied to clipboard
protected open fun onInit()

Method invoked when the EquinoxNoModelScreen has been instantiated.

Link copied to clipboard
protected open override fun onPause()

Method invoked when the ShowContent composable has been paused.

Link copied to clipboard
protected open override fun onResume()

Method invoked when the ShowContent composable has been resumed.

Link copied to clipboard
protected open fun onStart()

Method invoked when the ShowContent composable has been started

Link copied to clipboard
protected open override fun onStop()

Method invoked when the ShowContent composable has been stopped.

Link copied to clipboard

Method used to display the content of the screen