|
|
@ -66,6 +66,7 @@ import com.google.samples.apps.nowinandroid.core.designsystem.component.NiaTopAp
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.icon.Icon.DrawableResourceIcon
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.icon.Icon.DrawableResourceIcon
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.icon.Icon.ImageVectorIcon
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.icon.Icon.ImageVectorIcon
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.icon.NiaIcons
|
|
|
|
|
|
|
|
import com.google.samples.apps.nowinandroid.core.designsystem.theme.LocalGradientColors
|
|
|
|
import com.google.samples.apps.nowinandroid.feature.settings.R as settingsR
|
|
|
|
import com.google.samples.apps.nowinandroid.feature.settings.R as settingsR
|
|
|
|
import com.google.samples.apps.nowinandroid.feature.settings.SettingsDialog
|
|
|
|
import com.google.samples.apps.nowinandroid.feature.settings.SettingsDialog
|
|
|
|
import com.google.samples.apps.nowinandroid.navigation.NiaNavHost
|
|
|
|
import com.google.samples.apps.nowinandroid.navigation.NiaNavHost
|
|
|
@ -86,17 +87,26 @@ fun NiaApp(
|
|
|
|
windowSizeClass = windowSizeClass
|
|
|
|
windowSizeClass = windowSizeClass
|
|
|
|
),
|
|
|
|
),
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
val background: @Composable (@Composable () -> Unit) -> Unit =
|
|
|
|
val showGradientBackground = appState.currentTopLevelDestination == TopLevelDestination.FOR_YOU
|
|
|
|
when (appState.currentTopLevelDestination) {
|
|
|
|
|
|
|
|
TopLevelDestination.FOR_YOU -> {
|
|
|
|
|
|
|
|
content ->
|
|
|
|
|
|
|
|
NiaGradientBackground(content = content)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else -> { content -> NiaBackground(content = content) }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
background {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NiaBackground {
|
|
|
|
|
|
|
|
NiaGradientBackground(
|
|
|
|
|
|
|
|
topColor = if (showGradientBackground) {
|
|
|
|
|
|
|
|
LocalGradientColors.current.top
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Color.Unspecified
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
bottomColor = if (showGradientBackground) {
|
|
|
|
|
|
|
|
LocalGradientColors.current.bottom
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Color.Unspecified
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
containerColor = if (showGradientBackground) {
|
|
|
|
|
|
|
|
LocalGradientColors.current.container
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Color.Unspecified
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
) {
|
|
|
|
val snackbarHostState = remember { SnackbarHostState() }
|
|
|
|
val snackbarHostState = remember { SnackbarHostState() }
|
|
|
|
|
|
|
|
|
|
|
|
Scaffold(
|
|
|
|
Scaffold(
|
|
|
@ -192,6 +202,7 @@ fun NiaApp(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Composable
|
|
|
|
@Composable
|
|
|
|