SecondView

class SecondView(context: Context, viewModel: SecondViewModel, shuttle: Shuttle)

The Composable view for the second screen in the MVVM with Process Death demo. Loads cargo either from the com.grarcht.shuttle.framework.Shuttle warehouse or from an in-memory cache depending on how the screen was launched, and displays the image or an appropriate error state. A "Kill Process" button allows the user to simulate process death to observe Shuttle's recovery behavior.

Parameters

context

the context used to access resources and string values.

viewModel

the view model that manages image loading and state.

shuttle

the Shuttle instance used for cargo pickup and instance state bundling.

Constructors

Link copied to clipboard
constructor(context: Context, viewModel: SecondViewModel, shuttle: Shuttle)

Functions

Link copied to clipboard

Bundles the currently retrieved image model into outState using Shuttle so it can be restored safely after a configuration change.

Link copied to clipboard
fun SetViewContent(savedInstanceState: Bundle? = null, extras: Bundle? = null, onKillAppProcess: () -> Unit = {})

Renders the second screen, extracting arguments from savedInstanceState or extras to determine whether to load cargo from Shuttle or from the in-memory cache.