diff --git a/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt b/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt index f564f11db..a88e2eb22 100644 --- a/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt +++ b/app/src/main/java/com/google/samples/apps/nowinandroid/ui/NiaApp.kt @@ -41,7 +41,6 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi import androidx.compose.material3.windowsizeclass.WindowSizeClass -import androidx.compose.material3.windowsizeclass.WindowSizeClass.Companion import androidx.compose.runtime.Composable import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier @@ -127,8 +126,7 @@ fun NiaApp( ) } - if(!LocalInspectionMode.current) - { + if (!LocalInspectionMode.current) { NiaNavHost( navController = appState.navController, onBackClick = appState::onBackClick, @@ -137,9 +135,7 @@ fun NiaApp( .padding(padding) .consumedWindowInsets(padding) ) - } - else - { + } else { BoxWithConstraints { NiaTheme { ForYouScreen( @@ -242,9 +238,9 @@ private fun NiaBottomBar( } @ReferenceDevicePreviews @Composable -fun NiaAppLayoutPreview(){ +fun NiaAppLayoutPreview() { val widthDp = Dp(LocalConfiguration.current.screenWidthDp.toFloat()) val heightDp = Dp(LocalConfiguration.current.screenHeightDp.toFloat()) val windowSizeClass = WindowSizeClass.calculateFromSize(DpSize(widthDp, heightDp)) NiaApp(windowSizeClass = windowSizeClass) -} \ No newline at end of file +} diff --git a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/ReferenceDevices.kt b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/ReferenceDevices.kt index cd712915f..a36ea2d1c 100644 --- a/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/ReferenceDevices.kt +++ b/core/ui/src/main/java/com/google/samples/apps/nowinandroid/core/ui/ReferenceDevices.kt @@ -1,25 +1,28 @@ /* * Copyright 2022 The Android Open Source Project * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.google.samples.apps.nowinandroid.core.ui -import androidx.compose.ui.tooling.preview.Preview - import androidx.annotation.StringDef +import androidx.compose.ui.tooling.preview.Preview +/* + * TODO: Remove this file and instead use androidx.compose.ui.tooling.preview once this bug is + * fixed - https://issuetracker.google.com/issues/254528382 +*/ /** * List with the pre-defined devices available to be used in the preview. */