|
|
@ -15,7 +15,6 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
package com.google.samples.apps.nowinandroid.ui
|
|
|
|
package com.google.samples.apps.nowinandroid.ui
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
import androidx.compose.foundation.layout.Column
|
|
|
|
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
|
|
|
import androidx.compose.foundation.layout.ExperimentalLayoutApi
|
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
|
import androidx.compose.foundation.layout.Row
|
|
|
@ -41,7 +40,10 @@ import androidx.compose.material3.windowsizeclass.WindowSizeClass
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.LaunchedEffect
|
|
|
|
import androidx.compose.runtime.LaunchedEffect
|
|
|
|
import androidx.compose.runtime.getValue
|
|
|
|
import androidx.compose.runtime.getValue
|
|
|
|
|
|
|
|
import androidx.compose.runtime.mutableStateOf
|
|
|
|
import androidx.compose.runtime.remember
|
|
|
|
import androidx.compose.runtime.remember
|
|
|
|
|
|
|
|
import androidx.compose.runtime.saveable.rememberSaveable
|
|
|
|
|
|
|
|
import androidx.compose.runtime.setValue
|
|
|
|
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
|
|
import androidx.compose.ui.ExperimentalComposeUiApi
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.Modifier
|
|
|
|
import androidx.compose.ui.draw.drawWithContent
|
|
|
|
import androidx.compose.ui.draw.drawWithContent
|
|
|
@ -94,6 +96,9 @@ fun NiaApp(
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
val shouldShowGradientBackground =
|
|
|
|
val shouldShowGradientBackground =
|
|
|
|
appState.currentTopLevelDestination == TopLevelDestination.FOR_YOU
|
|
|
|
appState.currentTopLevelDestination == TopLevelDestination.FOR_YOU
|
|
|
|
|
|
|
|
var showSettingsDialog by rememberSaveable {
|
|
|
|
|
|
|
|
mutableStateOf(false)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NiaBackground {
|
|
|
|
NiaBackground {
|
|
|
|
NiaGradientBackground(
|
|
|
|
NiaGradientBackground(
|
|
|
@ -118,9 +123,9 @@ fun NiaApp(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (appState.shouldShowSettingsDialog) {
|
|
|
|
if (showSettingsDialog) {
|
|
|
|
SettingsDialog(
|
|
|
|
SettingsDialog(
|
|
|
|
onDismiss = { appState.setShowSettingsDialog(false) },
|
|
|
|
onDismiss = { showSettingsDialog = false },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -184,7 +189,7 @@ fun NiaApp(
|
|
|
|
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(
|
|
|
|
colors = TopAppBarDefaults.centerAlignedTopAppBarColors(
|
|
|
|
containerColor = Color.Transparent,
|
|
|
|
containerColor = Color.Transparent,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onActionClick = { appState.setShowSettingsDialog(true) },
|
|
|
|
onActionClick = { showSettingsDialog = true },
|
|
|
|
onNavigationClick = { appState.navigateToSearch() },
|
|
|
|
onNavigationClick = { appState.navigateToSearch() },
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|