[KongchangAI]
ConceptAndroid ViewModel

ViewModel

An Android Jetpack architecture component used to retain and manage UI-related state across configuration changes. It commonly serves as an intermediate layer for state orchestration and composition.

Timeline (last 90 days)

Oct 30

When hoisting TextFieldState to a ViewModel, it should be a direct property of the ViewModel rather than being placed in the UI state of an immutable data class, otherwise the copy method will create a new instance and cause loss of selection, cursor, and history.

Unverified50%
Oct 30

A ViewModel has no rememberSaveable, so a Saver must be configured manually for TextFieldState to restore state after process death.

Unverified50%

All Facts (2)

Source Articles