responding to PR feedback

pull/338/head
Daniel Jacobson 3 years ago
parent a040438018
commit 0b7ae8d590

@ -41,7 +41,6 @@ import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.WindowSizeClass import androidx.compose.material3.windowsizeclass.WindowSizeClass
import androidx.compose.material3.windowsizeclass.WindowSizeClass.Companion
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@ -127,8 +126,7 @@ fun NiaApp(
) )
} }
if(!LocalInspectionMode.current) if (!LocalInspectionMode.current) {
{
NiaNavHost( NiaNavHost(
navController = appState.navController, navController = appState.navController,
onBackClick = appState::onBackClick, onBackClick = appState::onBackClick,
@ -137,9 +135,7 @@ fun NiaApp(
.padding(padding) .padding(padding)
.consumedWindowInsets(padding) .consumedWindowInsets(padding)
) )
} } else {
else
{
BoxWithConstraints { BoxWithConstraints {
NiaTheme { NiaTheme {
ForYouScreen( ForYouScreen(
@ -242,9 +238,9 @@ private fun NiaBottomBar(
} }
@ReferenceDevicePreviews @ReferenceDevicePreviews
@Composable @Composable
fun NiaAppLayoutPreview(){ fun NiaAppLayoutPreview() {
val widthDp = Dp(LocalConfiguration.current.screenWidthDp.toFloat()) val widthDp = Dp(LocalConfiguration.current.screenWidthDp.toFloat())
val heightDp = Dp(LocalConfiguration.current.screenHeightDp.toFloat()) val heightDp = Dp(LocalConfiguration.current.screenHeightDp.toFloat())
val windowSizeClass = WindowSizeClass.calculateFromSize(DpSize(widthDp, heightDp)) val windowSizeClass = WindowSizeClass.calculateFromSize(DpSize(widthDp, heightDp))
NiaApp(windowSizeClass = windowSizeClass) NiaApp(windowSizeClass = windowSizeClass)
} }

@ -1,25 +1,28 @@
/* /*
* Copyright 2022 The Android Open Source Project * Copyright 2022 The Android Open Source Project
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * 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 * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, * distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.samples.apps.nowinandroid.core.ui package com.google.samples.apps.nowinandroid.core.ui
import androidx.compose.ui.tooling.preview.Preview
import androidx.annotation.StringDef 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. * List with the pre-defined devices available to be used in the preview.
*/ */

Loading…
Cancel
Save