Skip to content

Commit

Permalink
feat(mobile-app): Updated app ui state
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonlom committed Mar 6, 2024
1 parent 8372ead commit 30ffa2a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,21 @@ fun rememberCappajvAppState(
windowSizeClass: WindowSizeClass,
devicePosture: DevicePosture,
screenWidthDp: Int,
isLandscape: Boolean,
navController: NavHostController = rememberNavController(),
): CappajvAppState = remember(
windowSizeClass,
devicePosture,
screenWidthDp,
isLandscape,
navController,
) {
CappajvAppState(
navController = navController,
windowSizeClass = windowSizeClass,
devicePosture = devicePosture,
screenWidthDp = screenWidthDp,
isLandscape = isLandscape
)
}

Expand All @@ -63,6 +66,7 @@ data class CappajvAppState(
val windowSizeClass: WindowSizeClass,
val devicePosture: DevicePosture,
val screenWidthDp: Int,
val isLandscape: Boolean,
) {
val isCompactWidth get() = windowSizeClass.widthSizeClass == WindowWidthSizeClass.Compact

Expand All @@ -72,8 +76,6 @@ data class CappajvAppState(

val isExpandedWidth get() = windowSizeClass.widthSizeClass == WindowWidthSizeClass.Expanded

val isLandscape get() = isMediumWidth.and(isCompactHeight).or(isExpandedWidth.and(isCompactHeight.not()))

val scaffoldContentType
get() = ScaffoldContentClassifier.classify(
devicePosture, isExpandedWidth, isMediumWidth, isCompactHeight
Expand Down

0 comments on commit 30ffa2a

Please sign in to comment.