-
public class NavScaffoldViewModel extends ViewModel
A ViewModel that backs the WearNavScaffold to allow each composable to interact and effect the Scaffold positionIndicator, vignette and timeText.
A ViewModel is used to allow the same current instance to be shared between the WearNavScaffold and the composable screen via NavHostController.currentBackStackEntry.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumNavScaffoldViewModel.TimeTextModeThe configuration of TimeText, defaults to ScrollAway which will move the time text above the screen to avoid overlapping with the content moving up.
public enumNavScaffoldViewModel.PositionIndicatorModeThe configuration of PositionIndicator. The default is to show a scroll bar while the scroll is in progress.
public interfaceNavScaffoldViewModel.VignetteModeThe configuration of Vignette, WhenScrollable, Off, On and if so whether top and bottom. Defaults to on for scrollable screens.
-
Field Summary
Fields Modifier and Type Field Description private final ScrollableStatescrollableStateprivate NavScaffoldViewModel.VignetteModevignettePositionprivate NavScaffoldViewModel.TimeTextModetimeTextModeprivate NavScaffoldViewModel.PositionIndicatorModepositionIndicatorMode
-
Constructor Summary
Constructors Constructor Description NavScaffoldViewModel(SavedStateHandle savedStateHandle)
-
Method Summary
Modifier and Type Method Description final ScrollableStategetScrollableState()final NavScaffoldViewModel.VignetteModegetVignettePosition()The configuration of Vignette, WhenScrollable, Off, On and if so whether top and bottom. final UnitsetVignettePosition(NavScaffoldViewModel.VignetteMode vignettePosition)The configuration of Vignette, WhenScrollable, Off, On and if so whether top and bottom. final NavScaffoldViewModel.TimeTextModegetTimeTextMode()The configuration of TimeText, defaults to TimeTextMode.ScrollAway which will move the time text above the screen to avoid overlapping with the content moving up. final UnitsetTimeTextMode(NavScaffoldViewModel.TimeTextMode timeTextMode)The configuration of TimeText, defaults to TimeTextMode.ScrollAway which will move the time text above the screen to avoid overlapping with the content moving up. final NavScaffoldViewModel.PositionIndicatorModegetPositionIndicatorMode()The configuration of PositionIndicator. final UnitsetPositionIndicatorMode(NavScaffoldViewModel.PositionIndicatorMode positionIndicatorMode)The configuration of PositionIndicator. -
-
Constructor Detail
-
NavScaffoldViewModel
NavScaffoldViewModel(SavedStateHandle savedStateHandle)
-
-
Method Detail
-
getScrollableState
final ScrollableState getScrollableState()
-
getVignettePosition
final NavScaffoldViewModel.VignetteMode getVignettePosition()
The configuration of Vignette, WhenScrollable, Off, On and if so whether top and bottom. Defaults to on for scrollable screens.
-
setVignettePosition
final Unit setVignettePosition(NavScaffoldViewModel.VignetteMode vignettePosition)
The configuration of Vignette, WhenScrollable, Off, On and if so whether top and bottom. Defaults to on for scrollable screens.
-
getTimeTextMode
final NavScaffoldViewModel.TimeTextMode getTimeTextMode()
The configuration of TimeText, defaults to TimeTextMode.ScrollAway which will move the time text above the screen to avoid overlapping with the content moving up.
-
setTimeTextMode
final Unit setTimeTextMode(NavScaffoldViewModel.TimeTextMode timeTextMode)
The configuration of TimeText, defaults to TimeTextMode.ScrollAway which will move the time text above the screen to avoid overlapping with the content moving up.
-
getPositionIndicatorMode
final NavScaffoldViewModel.PositionIndicatorMode getPositionIndicatorMode()
The configuration of PositionIndicator. The default is to show a scroll bar while the scroll is in progress.
-
setPositionIndicatorMode
final Unit setPositionIndicatorMode(NavScaffoldViewModel.PositionIndicatorMode positionIndicatorMode)
The configuration of PositionIndicator. The default is to show a scroll bar while the scroll is in progress.
-
-
-
-