MVVMSecondView

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

The Composable view for the second screen in the MVVM with Compose demo. Retrieves cargo from the com.grarcht.shuttle.framework.Shuttle warehouse using the cargo ID extracted from the saved instance state or intent extras, and displays the resulting image or an error state.

Parameters

context

the context used to access resources and string values.

viewModel

the view model that manages cargo pickup 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

Releases view-held resources. State is managed by the ViewModel so this is a no-op in this implementation, but is provided for symmetry with other view classes in the demos.

Link copied to clipboard
fun getSavedInstanceState(shuttle: Shuttle, outState: Bundle): Bundle

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)

Renders the second screen, extracting the cargo ID from savedInstanceState or extras and triggering cargo pickup via SecondViewModel.