Skip to content

Commit

Permalink
Fix settings screen transition animation (#150)
Browse files Browse the repository at this point in the history
- The settings screen column didn't have a background, so during
   the transition animation, any elements without a background
   use the old background until the transition is complete. This
   adds a background to the settings screen column.
  • Loading branch information
temcguir authored Mar 28, 2024
1 parent 6a9a902 commit e9b3c97
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
package com.google.jetpackcamera.settings

import android.content.res.Configuration
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -88,6 +90,7 @@ private fun SettingsScreen(
Column(
modifier = Modifier
.verticalScroll(rememberScrollState())
.background(color = MaterialTheme.colorScheme.background)
) {
SettingsPageHeader(
title = stringResource(id = R.string.settings_title),
Expand Down Expand Up @@ -178,7 +181,7 @@ data class VersionInfoHolder(
val buildType: String
)

@Preview(name = "Light Mode", showBackground = true)
@Preview(name = "Light Mode")
@Preview(name = "Dark Mode", uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun Preview_SettingsScreen() {
Expand Down

0 comments on commit e9b3c97

Please # to comment.