From cf37677e980f20073976564fee86ffad5b66aa18 Mon Sep 17 00:00:00 2001 From: Jon Eckenrode Date: Wed, 11 Dec 2024 22:52:03 +0000 Subject: [PATCH 1/2] Replaced deprecated WindowHeightSizeClass with isHeightAtLeastBreakpoint. --- .../compose/snippets/layouts/AdaptiveLayoutSnippets.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt index 7980eae0..7eaba09e 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt @@ -52,9 +52,9 @@ fun MyApp( windowSizeClass: WindowSizeClass = currentWindowAdaptiveInfo().windowSizeClass ) { // Perform logic on the size class to decide whether to show the top app bar. - val showTopAppBar = windowSizeClass.windowHeightSizeClass != WindowHeightSizeClass.COMPACT + val showTopAppBar = windowSizeClass.isHeightAtLeastBreakpoint(480) - // MyScreen knows nothing about window sizes, and performs logic based on a Boolean flag. + // MyScreen knows nothing about window sizes, and performs logic based on a boolean flag. MyScreen( showTopAppBar = showTopAppBar, /* ... */ From 9ced8fbbb636c34d7858114762b9c9d8724b1e79 Mon Sep 17 00:00:00 2001 From: JonEckenrode Date: Wed, 11 Dec 2024 23:08:01 +0000 Subject: [PATCH 2/2] Apply Spotless --- .../example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt index 7eaba09e..7e5adba9 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/layouts/AdaptiveLayoutSnippets.kt @@ -28,7 +28,6 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.unit.dp -import androidx.window.core.layout.WindowHeightSizeClass import androidx.window.core.layout.WindowSizeClass /*