diff --git a/auth/composables/api/current.api b/auth/composables/api/current.api index e950fae9d1..cfdc2afa1e 100644 --- a/auth/composables/api/current.api +++ b/auth/composables/api/current.api @@ -62,7 +62,7 @@ package com.google.android.horologist.auth.composables.screens { } public final class SelectAccountScreenKt { - method @androidx.compose.runtime.Composable public static void SelectAccountScreen(java.util.List accounts, kotlin.jvm.functions.Function2 onAccountClicked, optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional String title, optional com.google.android.horologist.images.base.paintable.Paintable? defaultAvatar); + method @androidx.compose.runtime.Composable public static void SelectAccountScreen(java.util.List accounts, kotlin.jvm.functions.Function2 onAccountClicked, optional androidx.compose.ui.Modifier modifier, optional String title, optional com.google.android.horologist.images.base.paintable.Paintable? defaultAvatar); } public final class SignInPlaceholderScreenKt { diff --git a/auth/composables/src/debug/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenPreview.kt b/auth/composables/src/debug/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenPreview.kt index 2ef8b4b4be..e5eac0ba6e 100644 --- a/auth/composables/src/debug/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenPreview.kt +++ b/auth/composables/src/debug/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenPreview.kt @@ -19,7 +19,6 @@ package com.google.android.horologist.auth.composables.screens import androidx.compose.runtime.Composable import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices import com.google.android.horologist.auth.composables.model.AccountUiModel -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState @WearPreviewDevices @Composable @@ -30,7 +29,6 @@ fun SelectAccountScreenPreview() { AccountUiModel(email = "thisisaverylongemail@example.com"), ), onAccountClicked = { _, _ -> }, - columnState = rememberResponsiveColumnState(), ) } @@ -43,7 +41,6 @@ fun SelectAccountScreenPreviewNoAvatar() { AccountUiModel(email = "thisisaverylongemailaccountsample@example.com"), ), onAccountClicked = { _, _ -> }, - columnState = rememberResponsiveColumnState(), defaultAvatar = null, ) } diff --git a/auth/composables/src/main/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreen.kt b/auth/composables/src/main/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreen.kt index 8744838af9..acb8455713 100644 --- a/auth/composables/src/main/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreen.kt +++ b/auth/composables/src/main/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreen.kt @@ -30,7 +30,9 @@ import com.google.android.horologist.auth.composables.R import com.google.android.horologist.auth.composables.chips.AccountChip import com.google.android.horologist.auth.composables.model.AccountUiModel import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.ScreenScaffold import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Title import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable @@ -46,35 +48,43 @@ public fun SelectAccountScreen( accounts: List, onAccountClicked: (index: Int, account: AccountUiModel) -> Unit, modifier: Modifier = Modifier, - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), title: String = stringResource(id = R.string.horologist_select_account_title), defaultAvatar: Paintable? = Icons.Default.AccountCircle.asPaintable(), ) { - ScalingLazyColumn( - modifier = modifier, - columnState = columnState, - ) { - item { Title(title, Modifier.padding(bottom = 8.dp)) } + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - items(accounts.size) { index -> - val account = accounts[index] - MaterialTheme( - typography = MaterialTheme.typography.copy( - button = MaterialTheme.typography.button.copy( - lineBreak = LineBreak( - strategy = LineBreak.Strategy.Balanced, - strictness = LineBreak.Strictness.Normal, - wordBreak = LineBreak.WordBreak.Default, + ScreenScaffold(scrollState = columnState) { + ScalingLazyColumn( + modifier = modifier, + columnState = columnState, + ) { + item { Title(title, Modifier.padding(bottom = 8.dp)) } + + items(accounts.size) { index -> + val account = accounts[index] + MaterialTheme( + typography = MaterialTheme.typography.copy( + button = MaterialTheme.typography.button.copy( + lineBreak = LineBreak( + strategy = LineBreak.Strategy.Balanced, + strictness = LineBreak.Strictness.Normal, + wordBreak = LineBreak.WordBreak.Default, + ), ), ), - ), - ) { - AccountChip( - account = account, - onClick = { onAccountClicked(index, account) }, - colors = ChipDefaults.secondaryChipColors(), - defaultAvatar = defaultAvatar, - ) + ) { + AccountChip( + account = account, + onClick = { onAccountClicked(index, account) }, + colors = ChipDefaults.secondaryChipColors(), + defaultAvatar = defaultAvatar, + ) + } } } } diff --git a/auth/composables/src/test/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenTest.kt b/auth/composables/src/test/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenTest.kt index 7971cec959..7e807b665a 100644 --- a/auth/composables/src/test/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenTest.kt +++ b/auth/composables/src/test/java/com/google/android/horologist/auth/composables/screens/SelectAccountScreenTest.kt @@ -19,7 +19,6 @@ package com.google.android.horologist.auth.composables.screens import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Face import com.google.android.horologist.auth.composables.model.AccountUiModel -import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable import com.google.android.horologist.screenshots.rng.WearLegacyScreenTest import org.junit.Test @@ -38,7 +37,6 @@ class SelectAccountScreenTest : WearLegacyScreenTest() { AccountUiModel(email = "thisisaverylongemail@example.com"), ), onAccountClicked = { _, _ -> }, - columnState = ScalingLazyColumnDefaults.responsive().create(), ) } } @@ -52,7 +50,6 @@ class SelectAccountScreenTest : WearLegacyScreenTest() { AccountUiModel(email = "thisisaverylongemailaccountsample@example.com"), ), onAccountClicked = { _, _ -> }, - columnState = ScalingLazyColumnDefaults.responsive().create(), defaultAvatar = null, ) } diff --git a/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreen.png b/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreen.png index 67fc164141..6fbe827162 100644 --- a/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreen.png +++ b/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d7b18af723ea7cc521f0fc571f79f4d70049d01734dd44a0ae9b1d2d96b0135c -size 29710 +oid sha256:9b0ab2665a1f30ce47117c6100b0ca7ce869beb6ac36059646eb067d90ca0972 +size 29905 diff --git a/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreenNoAvatar.png b/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreenNoAvatar.png index 56f15824df..f11e16d52c 100644 --- a/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreenNoAvatar.png +++ b/auth/composables/src/test/snapshots/images/com.google.android.horologist.auth.composables.screens_SelectAccountScreenTest_selectAccountScreenNoAvatar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e73a30b18e51a992a3f854547f52e736e511cdb53e8da04da77ef8b7e439e8fa -size 28127 +oid sha256:a20126bd57f61e48fce1388dfa5d9e4dcd11136480e9f4ab8172ff010a428585 +size 28337 diff --git a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/WearApp.kt b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/WearApp.kt index 0edb129aef..e893058ed4 100644 --- a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/WearApp.kt +++ b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/WearApp.kt @@ -37,15 +37,13 @@ import com.google.android.horologist.auth.sample.screens.tokenshare.customkey.To import com.google.android.horologist.auth.sample.screens.tokenshare.defaultkey.TokenShareDefaultKeyScreen import com.google.android.horologist.auth.ui.googlesignin.signin.GoogleSignInScreen import com.google.android.horologist.compose.layout.AppScaffold -import com.google.android.horologist.compose.layout.ScreenScaffold -import com.google.android.horologist.compose.layout.rememberColumnState @Composable fun WearApp( modifier: Modifier = Modifier, navController: NavHostController = rememberSwipeDismissableNavController(), ) { - AppScaffold { + AppScaffold(modifier = modifier) { SwipeDismissableNavHost( startDestination = Screen.MainScreen.route, navController = navController, @@ -53,56 +51,31 @@ fun WearApp( composable( route = Screen.MainScreen.route, ) { - val columnState = rememberColumnState() - - ScreenScaffold(scrollState = columnState) { - MainScreen( - navigateToRoute = navController::navigate, - modifier = modifier, - columnState = columnState, - ) - } + MainScreen( + navigateToRoute = navController::navigate, + ) } composable( route = Screen.GoogleSignInPromptSampleScreen.route, ) { - val columnState = rememberColumnState() - - ScreenScaffold(scrollState = columnState) { - GoogleSignInPromptSampleScreen( - navController = navController, - columnState = columnState, - modifier = modifier, - ) - } + GoogleSignInPromptSampleScreen( + navController = navController, + ) } composable(route = Screen.StreamlineSignInMenuScreen.route) { - val columnState = rememberColumnState() - - ScreenScaffold(scrollState = columnState) { - StreamlineSignInMenuScreen( - navController = navController, - columnState = columnState, - modifier = modifier, - ) - } + StreamlineSignInMenuScreen( + navController = navController, + ) } composable(route = Screen.StreamlineSignInSampleScreen.route) { - val columnState = rememberColumnState() - - ScreenScaffold(scrollState = columnState) { - StreamlineSignInSampleScreen( - navController = navController, - columnState = columnState, - modifier = modifier, - ) - } + StreamlineSignInSampleScreen( + navController = navController, + ) } composable(route = Screen.GoogleSignInScreen.route) { GoogleSignInScreen( onAuthCancelled = navController::popBackStack, onAuthSucceed = navController::popBackStack, - modifier = modifier, viewModel = viewModel(factory = GoogleSignInSampleViewModelFactory), ) } @@ -110,18 +83,10 @@ fun WearApp( GoogleSignOutScreen(navController = navController) } composable(route = Screen.TokenShareDefaultKeyScreen.route) { - val columnState = rememberColumnState() - - ScreenScaffold(scrollState = columnState) { - TokenShareDefaultKeyScreen(columnState = columnState, modifier = modifier) - } + TokenShareDefaultKeyScreen() } composable(route = Screen.TokenShareCustomKeyScreen.route) { - val columnState = rememberColumnState() - - ScreenScaffold(scrollState = columnState) { - TokenShareCustomKeyScreen(columnState = columnState, modifier = modifier) - } + TokenShareCustomKeyScreen() } } } diff --git a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/MainScreen.kt b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/MainScreen.kt index 0b07356e9f..c6277fa003 100644 --- a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/MainScreen.kt +++ b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/MainScreen.kt @@ -26,7 +26,9 @@ import com.google.android.horologist.auth.sample.R import com.google.android.horologist.auth.sample.Screen import com.google.android.horologist.composables.SectionedList import com.google.android.horologist.composables.SectionedListScope -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.ScreenScaffold import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.compose.material.Title @@ -35,17 +37,25 @@ import com.google.android.horologist.compose.material.Title fun MainScreen( navigateToRoute: (String) -> Unit, modifier: Modifier = Modifier, - columnState: ScalingLazyColumnState, ) { - SectionedList( - columnState = columnState, - modifier = modifier.fillMaxSize(), - ) { - googleSignInSection(navigateToRoute) + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - tokenShareSection(navigateToRoute) + ScreenScaffold(scrollState = columnState) { + SectionedList( + columnState = columnState, + modifier = modifier.fillMaxSize(), + ) { + googleSignInSection(navigateToRoute) - commonScreensSection(navigateToRoute) + tokenShareSection(navigateToRoute) + + commonScreensSection(navigateToRoute) + } } } @@ -126,6 +136,5 @@ private fun SectionedListScope.commonScreensSection(navigateToRoute: (String) -> fun AuthMenuScreenPreview() { MainScreen( navigateToRoute = {}, - columnState = rememberResponsiveColumnState(), ) } diff --git a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInMenuScreen.kt b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInMenuScreen.kt index dd92f858c9..5979530b27 100644 --- a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInMenuScreen.kt +++ b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInMenuScreen.kt @@ -25,54 +25,65 @@ import androidx.navigation.NavHostController import com.google.android.horologist.auth.sample.R import com.google.android.horologist.auth.sample.Screen import com.google.android.horologist.composables.SectionedList -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.compose.material.Title @Composable fun StreamlineSignInMenuScreen( navController: NavHostController, - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, ) { - SectionedList( - columnState = columnState, - modifier = modifier.fillMaxSize(), - ) { - section( - listOf( - Triple( - R.string.common_screens_streamline_sign_in_single_account_item, - Screen.StreamlineSignInSampleScreen.route, - AuthUserRepositoryStreamlineImpl.Mode.SINGLE_ACCOUNT_AVAILABLE, - ), - Triple( - R.string.common_screens_streamline_sign_in_multiple_accounts_item, - Screen.StreamlineSignInSampleScreen.route, - AuthUserRepositoryStreamlineImpl.Mode.MULTIPLE_ACCOUNTS_AVAILABLE, - ), - Triple( - R.string.common_screens_streamline_sign_in_no_accounts_item, - Screen.StreamlineSignInSampleScreen.route, - AuthUserRepositoryStreamlineImpl.Mode.NO_ACCOUNTS_AVAILABLE, - ), - ), + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(scrollState = columnState) { + SectionedList( + columnState = columnState, + modifier = modifier.fillMaxSize(), ) { - header { - Title( - stringResource(id = R.string.common_screens_streamline_sign_in_header), - Modifier, - ) - } - loaded { (textId, route, mode) -> - Chip( - label = stringResource(id = textId), - modifier = Modifier.fillMaxWidth(), - onClick = { - AuthUserRepositoryStreamlineImpl.mode = mode - navController.navigate(route) - }, - ) + section( + listOf( + Triple( + R.string.common_screens_streamline_sign_in_single_account_item, + Screen.StreamlineSignInSampleScreen.route, + AuthUserRepositoryStreamlineImpl.Mode.SINGLE_ACCOUNT_AVAILABLE, + ), + Triple( + R.string.common_screens_streamline_sign_in_multiple_accounts_item, + Screen.StreamlineSignInSampleScreen.route, + AuthUserRepositoryStreamlineImpl.Mode.MULTIPLE_ACCOUNTS_AVAILABLE, + ), + Triple( + R.string.common_screens_streamline_sign_in_no_accounts_item, + Screen.StreamlineSignInSampleScreen.route, + AuthUserRepositoryStreamlineImpl.Mode.NO_ACCOUNTS_AVAILABLE, + ), + ), + ) { + header { + Title( + stringResource(id = R.string.common_screens_streamline_sign_in_header), + Modifier, + ) + } + loaded { (textId, route, mode) -> + Chip( + label = stringResource(id = textId), + modifier = Modifier.fillMaxWidth(), + onClick = { + AuthUserRepositoryStreamlineImpl.mode = mode + navController.navigate(route) + }, + ) + } } } } diff --git a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInSampleScreen.kt b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInSampleScreen.kt index 998a2833eb..0f3eb605b5 100644 --- a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInSampleScreen.kt +++ b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/common/streamline/StreamlineSignInSampleScreen.kt @@ -38,14 +38,12 @@ import androidx.wear.compose.material.Text import com.google.android.horologist.auth.sample.R import com.google.android.horologist.auth.ui.common.screens.streamline.StreamlineSignInDefaultScreen import com.google.android.horologist.auth.ui.common.screens.streamline.StreamlineSignInDefaultViewModel -import com.google.android.horologist.compose.layout.ScalingLazyColumnState import com.google.android.horologist.compose.material.Confirmation import com.google.android.horologist.compose.material.util.DECORATIVE_ELEMENT_CONTENT_DESCRIPTION @Composable fun StreamlineSignInSampleScreen( navController: NavHostController, - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, viewModel: StreamlineSignInDefaultViewModel = viewModel(factory = StreamlineSignInSampleViewModelFactory), ) { @@ -54,7 +52,6 @@ fun StreamlineSignInSampleScreen( StreamlineSignInDefaultScreen( onSignedInConfirmationDialogDismissOrTimeout = { navController.popBackStack() }, onNoAccountsAvailable = { showNoAccountsAvailableDialog = true }, - columnState = columnState, viewModel = viewModel, ) { Box( diff --git a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt index 8eb72cb8c7..61e86b0d8a 100644 --- a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt +++ b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt @@ -38,14 +38,11 @@ import com.google.android.horologist.auth.sample.Screen import com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreen import com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptViewModel import com.google.android.horologist.auth.ui.googlesignin.prompt.GoogleSignInPromptViewModelFactory -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Confirmation @Composable fun GoogleSignInPromptSampleScreen( navController: NavHostController, - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, viewModel: SignInPromptViewModel = viewModel(factory = GoogleSignInPromptViewModelFactory), ) { @@ -54,7 +51,6 @@ fun GoogleSignInPromptSampleScreen( SignInPromptScreen( message = stringResource(id = R.string.google_sign_in_prompt_message), onAlreadySignedIn = { showAlreadySignedInDialog = true }, - columnState = columnState, modifier = modifier, viewModel = viewModel, ) { @@ -98,6 +94,5 @@ fun GoogleSignInPromptSampleScreen( fun GoogleSignInPromptSampleScreenPreview() { GoogleSignInPromptSampleScreen( navController = rememberSwipeDismissableNavController(), - columnState = rememberResponsiveColumnState(), ) } diff --git a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/customkey/TokenShareCustomKeyScreen.kt b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/customkey/TokenShareCustomKeyScreen.kt index aeb0547771..fb51fab990 100644 --- a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/customkey/TokenShareCustomKeyScreen.kt +++ b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/customkey/TokenShareCustomKeyScreen.kt @@ -30,41 +30,52 @@ import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.Text import com.google.android.horologist.auth.sample.R import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.compose.material.Title @Composable fun TokenShareCustomKeyScreen( - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, viewModel: TokenShareCustomKeyViewModel = viewModel(factory = TokenShareCustomKeyViewModel.Factory), ) { val state by viewModel.uiState.collectAsStateWithLifecycle() - ScalingLazyColumn( - columnState = columnState, - modifier = modifier, - ) { - item { - Title(R.string.token_share_custom_key_title) - } - item { - Text( - text = stringResource(id = R.string.token_share_custom_key_message), - modifier = Modifier.padding(horizontal = 8.dp), - textAlign = TextAlign.Center, - ) - } - items(state) { tokenBundle -> - tokenBundle?.let { - Chip( - label = tokenBundle.accessToken, - onClick = { /* do nothing */ }, - colors = ChipDefaults.secondaryChipColors(), - enabled = false, + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(scrollState = columnState) { + ScalingLazyColumn( + columnState = columnState, + modifier = modifier, + ) { + item { + Title(R.string.token_share_custom_key_title) + } + item { + Text( + text = stringResource(id = R.string.token_share_custom_key_message), + modifier = Modifier.padding(horizontal = 8.dp), + textAlign = TextAlign.Center, ) } + items(state) { tokenBundle -> + tokenBundle?.let { + Chip( + label = tokenBundle.accessToken, + onClick = { /* do nothing */ }, + colors = ChipDefaults.secondaryChipColors(), + enabled = false, + ) + } + } } } } diff --git a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/defaultkey/TokenShareDefaultKeyScreen.kt b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/defaultkey/TokenShareDefaultKeyScreen.kt index f8eacdc58e..bae97545cd 100644 --- a/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/defaultkey/TokenShareDefaultKeyScreen.kt +++ b/auth/sample/wear/src/main/java/com/google/android/horologist/auth/sample/screens/tokenshare/defaultkey/TokenShareDefaultKeyScreen.kt @@ -30,41 +30,52 @@ import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.Text import com.google.android.horologist.auth.sample.R import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.compose.material.Title @Composable fun TokenShareDefaultKeyScreen( - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, viewModel: TokenShareDefaultKeyViewModel = viewModel(factory = TokenShareDefaultKeyViewModel.Factory), ) { val state by viewModel.uiState.collectAsStateWithLifecycle() - ScalingLazyColumn( - columnState = columnState, - modifier = modifier, - ) { - item { - Title(R.string.token_share_default_key_title) - } - item { - Text( - text = stringResource(id = R.string.token_share_default_key_message), - modifier = Modifier.padding(horizontal = 8.dp), - textAlign = TextAlign.Center, - ) - } - items(state) { tokenBundle -> - tokenBundle?.let { - Chip( - label = tokenBundle.accessToken, - onClick = { /* do nothing */ }, - colors = ChipDefaults.secondaryChipColors(), - enabled = false, + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(scrollState = columnState) { + ScalingLazyColumn( + columnState = columnState, + modifier = modifier, + ) { + item { + Title(R.string.token_share_default_key_title) + } + item { + Text( + text = stringResource(id = R.string.token_share_default_key_message), + modifier = Modifier.padding(horizontal = 8.dp), + textAlign = TextAlign.Center, ) } + items(state) { tokenBundle -> + tokenBundle?.let { + Chip( + label = tokenBundle.accessToken, + onClick = { /* do nothing */ }, + colors = ChipDefaults.secondaryChipColors(), + enabled = false, + ) + } + } } } } diff --git a/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/NavigationTest.kt b/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/NavigationTest.kt index ee795f1a78..cb57dbd9a6 100644 --- a/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/NavigationTest.kt +++ b/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/NavigationTest.kt @@ -16,9 +16,7 @@ package com.google.android.horologist.auth.sample -import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.platform.testTag import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onAllNodesWithText import androidx.compose.ui.test.onFirst @@ -38,7 +36,6 @@ class NavigationTest { @get:Rule val composeTestRule = createComposeRule() - private val rootViewTag = "root_view" private lateinit var navController: TestNavHostController @Before @@ -46,7 +43,7 @@ class NavigationTest { composeTestRule.setContent { navController = TestNavHostController(LocalContext.current) navController.navigatorProvider.addNavigator(WearNavigator()) - WearApp(modifier = Modifier.testTag(rootViewTag), navController = navController) + WearApp(navController = navController) } } diff --git a/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/streamline/StreamlineSignInNavigationTest.kt b/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/streamline/StreamlineSignInNavigationTest.kt index 48b7579f40..39bfcfa83f 100644 --- a/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/streamline/StreamlineSignInNavigationTest.kt +++ b/auth/sample/wear/src/test/java/com/google/android/horologist/auth/sample/streamline/StreamlineSignInNavigationTest.kt @@ -18,15 +18,12 @@ package com.google.android.horologist.auth.sample.streamline -import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.platform.testTag import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.hasScrollToNodeAction import androidx.compose.ui.test.hasText import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onAllNodesWithText -import androidx.compose.ui.test.onChild -import androidx.compose.ui.test.onNodeWithTag import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performScrollToNode @@ -52,7 +49,6 @@ class StreamlineSignInNavigationTest { @get:Rule val composeTestRule = createComposeRule() - private val rootViewTag = "root_view" private val streamLineSignInChipText = "Streamline Sign-in" private lateinit var navController: TestNavHostController @@ -61,11 +57,10 @@ class StreamlineSignInNavigationTest { composeTestRule.setContent { navController = TestNavHostController(LocalContext.current) navController.navigatorProvider.addNavigator(WearNavigator()) - WearApp(modifier = Modifier.testTag(rootViewTag), navController = navController) + WearApp(navController = navController) } - composeTestRule.onNodeWithTag(rootViewTag) - .onChild() + composeTestRule.onNode(hasScrollToNodeAction()) .performScrollToNode(hasText(streamLineSignInChipText)) composeTestRule.onNodeWithText(streamLineSignInChipText) diff --git a/auth/ui/api/current.api b/auth/ui/api/current.api index 36127fd37a..c21a3ba782 100644 --- a/auth/ui/api/current.api +++ b/auth/ui/api/current.api @@ -2,8 +2,8 @@ package com.google.android.horologist.auth.ui.common.screens.prompt { public final class SignInPromptScreenKt { - method @androidx.compose.runtime.Composable public static void SignInPromptScreen(com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreenState state, String title, String message, kotlin.jvm.functions.Function0 onIdleStateObserved, kotlin.jvm.functions.Function1 onAlreadySignedIn, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0 loadingContent, kotlin.jvm.functions.Function1 content); - method @androidx.compose.runtime.Composable public static void SignInPromptScreen(String message, kotlin.jvm.functions.Function1 onAlreadySignedIn, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional androidx.compose.ui.Modifier modifier, optional String title, optional com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptViewModel viewModel, optional kotlin.jvm.functions.Function0 loadingContent, kotlin.jvm.functions.Function1 content); + method @androidx.compose.runtime.Composable public static void SignInPromptScreen(com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreenState state, String title, String message, kotlin.jvm.functions.Function0 onIdleStateObserved, kotlin.jvm.functions.Function1 onAlreadySignedIn, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0 loadingContent, kotlin.jvm.functions.Function1 content); + method @androidx.compose.runtime.Composable public static void SignInPromptScreen(String message, kotlin.jvm.functions.Function1 onAlreadySignedIn, optional androidx.compose.ui.Modifier modifier, optional String title, optional com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptViewModel viewModel, optional kotlin.jvm.functions.Function0 loadingContent, kotlin.jvm.functions.Function1 content); } public abstract sealed class SignInPromptScreenState { @@ -41,7 +41,7 @@ package com.google.android.horologist.auth.ui.common.screens.prompt { package com.google.android.horologist.auth.ui.common.screens.streamline { public final class StreamlineSignInDefaultScreenKt { - method @androidx.compose.runtime.Composable public static void StreamlineSignInDefaultScreen(kotlin.jvm.functions.Function1 onSignedInConfirmationDialogDismissOrTimeout, kotlin.jvm.functions.Function0 onNoAccountsAvailable, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, com.google.android.horologist.auth.ui.common.screens.streamline.StreamlineSignInDefaultViewModel viewModel, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0 content); + method @androidx.compose.runtime.Composable public static void StreamlineSignInDefaultScreen(kotlin.jvm.functions.Function1 onSignedInConfirmationDialogDismissOrTimeout, kotlin.jvm.functions.Function0 onNoAccountsAvailable, com.google.android.horologist.auth.ui.common.screens.streamline.StreamlineSignInDefaultViewModel viewModel, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0 content); } public abstract sealed class StreamlineSignInDefaultScreenState { diff --git a/auth/ui/src/debug/java/com/google/android/horologist/auth/composables/screens/SignInPromptScreenPreview.kt b/auth/ui/src/debug/java/com/google/android/horologist/auth/composables/screens/SignInPromptScreenPreview.kt index f304fce85c..03f419d233 100644 --- a/auth/ui/src/debug/java/com/google/android/horologist/auth/composables/screens/SignInPromptScreenPreview.kt +++ b/auth/ui/src/debug/java/com/google/android/horologist/auth/composables/screens/SignInPromptScreenPreview.kt @@ -26,7 +26,6 @@ import com.google.android.horologist.auth.composables.chips.GuestModeChip import com.google.android.horologist.auth.composables.chips.SignInChip import com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreen import com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreenState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState @WearPreviewDevices @Composable @@ -37,7 +36,6 @@ fun SignInPromptScreenPreviewSignedOut() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = rememberResponsiveColumnState(), ) { item { SignInChip( @@ -63,7 +61,6 @@ fun SignInPromptScreenPreviewLoading() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = rememberResponsiveColumnState(), ) { item { SignInChip( @@ -89,7 +86,6 @@ fun SignInPromptScreenPreviewCustomLoading() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = rememberResponsiveColumnState(), loadingContent = { Box(contentAlignment = Alignment.Center) { Text("Loading...") diff --git a/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreen.kt b/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreen.kt index 6a77d19e5d..c44493b2a9 100644 --- a/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreen.kt +++ b/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreen.kt @@ -33,8 +33,10 @@ import com.google.android.horologist.auth.composables.R import com.google.android.horologist.auth.composables.model.AccountUiModel import com.google.android.horologist.auth.composables.screens.SignInPlaceholderScreen import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Title /** @@ -58,7 +60,6 @@ import com.google.android.horologist.compose.material.Title public fun SignInPromptScreen( message: String, onAlreadySignedIn: (account: AccountUiModel) -> Unit, - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, title: String = stringResource(id = R.string.horologist_signin_prompt_title), viewModel: SignInPromptViewModel = viewModel(), @@ -73,7 +74,6 @@ public fun SignInPromptScreen( message = message, onIdleStateObserved = { viewModel.onIdleStateObserved() }, onAlreadySignedIn = onAlreadySignedIn, - columnState = columnState, loadingContent = loadingContent, modifier = modifier, content = content, @@ -87,12 +87,18 @@ public fun SignInPromptScreen( message: String, onIdleStateObserved: () -> Unit, onAlreadySignedIn: (account: AccountUiModel) -> Unit, - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, loadingContent: @Composable () -> Unit = { SignInPlaceholderScreen(modifier = modifier) }, content: ScalingLazyListScope.() -> Unit, ) { - ScreenScaffold(timeText = {}) { + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(timeText = {}, scrollState = columnState) { when (state) { SignInPromptScreenState.Idle -> { SideEffect { diff --git a/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/streamline/StreamlineSignInDefaultScreen.kt b/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/streamline/StreamlineSignInDefaultScreen.kt index d083c4ef1c..2785d016fd 100644 --- a/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/streamline/StreamlineSignInDefaultScreen.kt +++ b/auth/ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/streamline/StreamlineSignInDefaultScreen.kt @@ -24,7 +24,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.google.android.horologist.auth.composables.dialogs.SignedInConfirmationDialog import com.google.android.horologist.auth.composables.model.AccountUiModel import com.google.android.horologist.auth.composables.screens.SelectAccountScreen -import com.google.android.horologist.compose.layout.ScalingLazyColumnState /** * An opinionated implementation of [StreamlineSignInScreen] that: @@ -42,7 +41,6 @@ import com.google.android.horologist.compose.layout.ScalingLazyColumnState public fun StreamlineSignInDefaultScreen( onSignedInConfirmationDialogDismissOrTimeout: (account: AccountUiModel) -> Unit, onNoAccountsAvailable: () -> Unit, - columnState: ScalingLazyColumnState, viewModel: StreamlineSignInDefaultViewModel, modifier: Modifier = Modifier, content: @Composable () -> Unit = { }, @@ -77,7 +75,6 @@ public fun StreamlineSignInDefaultScreen( onAccountClicked = { _, account -> viewModel.onAccountSelected(account) }, - columnState = columnState, modifier = modifier, ) } diff --git a/auth/ui/src/test/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreenTest.kt b/auth/ui/src/test/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreenTest.kt index 39f472cc1b..2ba056b6cd 100644 --- a/auth/ui/src/test/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreenTest.kt +++ b/auth/ui/src/test/java/com/google/android/horologist/auth/ui/common/screens/prompt/SignInPromptScreenTest.kt @@ -26,7 +26,6 @@ import androidx.wear.compose.material.Text import com.google.android.horologist.auth.composables.chips.GuestModeChip import com.google.android.horologist.auth.composables.chips.SignInChip import com.google.android.horologist.auth.composables.model.AccountUiModel -import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults import com.google.android.horologist.screenshots.rng.WearLegacyScreenTest import org.junit.Test @@ -41,7 +40,6 @@ class SignInPromptScreenTest : WearLegacyScreenTest() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = ScalingLazyColumnDefaults.responsive().create(), ) { testContent() } @@ -57,7 +55,6 @@ class SignInPromptScreenTest : WearLegacyScreenTest() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = ScalingLazyColumnDefaults.responsive().create(), ) { testContent() } @@ -73,7 +70,6 @@ class SignInPromptScreenTest : WearLegacyScreenTest() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = ScalingLazyColumnDefaults.responsive().create(), loadingContent = { Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Text("Loading...") @@ -94,7 +90,6 @@ class SignInPromptScreenTest : WearLegacyScreenTest() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = ScalingLazyColumnDefaults.responsive().create(), ) { testContent() } @@ -110,7 +105,6 @@ class SignInPromptScreenTest : WearLegacyScreenTest() { message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = ScalingLazyColumnDefaults.responsive().create(), ) { testContent() } @@ -131,7 +125,6 @@ class SignInPromptScreenTest : WearLegacyScreenTest() { "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = ScalingLazyColumnDefaults.responsive().create(), ) { testContent() } diff --git a/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOut.png b/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOut.png index be2990a4fb..f024acedb6 100644 --- a/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOut.png +++ b/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOut.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4a3610ea90b2fc0b7ae122bb793d593bcb7ec8c2065d3ff4ed6fe35512755ee -size 24994 +oid sha256:b2b3e9f335b87cb6e95eee99516b65b5a589ea141f53db65c842f0f602e0b03b +size 26584 diff --git a/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOutTruncation.png b/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOutTruncation.png index 2b3acc0bcc..a5e21ff4c2 100644 --- a/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOutTruncation.png +++ b/auth/ui/src/test/snapshots/images/com.google.android.horologist.auth.ui.common.screens.prompt_SignInPromptScreenTest_signedOutTruncation.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9c7aa1ccbb02f255847ea30e577aee53af1e6934b1b24d22e4e98c743210e9c -size 17788 +oid sha256:c853b94cb4a18e35ed62920b364e7b7341b500935d73f386da3b2dd2bb49e009 +size 60355 diff --git a/composables/api/current.api b/composables/api/current.api index 6db62a96e6..4a5fea6be3 100644 --- a/composables/api/current.api +++ b/composables/api/current.api @@ -136,8 +136,8 @@ package com.google.android.horologist.composables { } public final class SectionedListKt { - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void SectionedList(optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional java.util.List> sections); - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void SectionedList(optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, kotlin.jvm.functions.Function1 content); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void SectionedList(optional androidx.compose.ui.Modifier modifier, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional java.util.List> sections); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void SectionedList(optional androidx.compose.ui.Modifier modifier, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, kotlin.jvm.functions.Function1 content); } @com.google.android.horologist.annotations.ExperimentalHorologistApi public final class SectionedListScope { diff --git a/composables/src/debug/java/com/google/android/horologist/composables/SectionedListPreview.kt b/composables/src/debug/java/com/google/android/horologist/composables/SectionedListPreview.kt index 534ce17b89..80861df719 100644 --- a/composables/src/debug/java/com/google/android/horologist/composables/SectionedListPreview.kt +++ b/composables/src/debug/java/com/google/android/horologist/composables/SectionedListPreview.kt @@ -33,45 +33,85 @@ import androidx.wear.compose.material.Icon import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip @WearPreviewDevices @Composable fun SectionedListPreviewLoadingSection() { - SectionedList { - downloadsSection(state = Section.State.Loading) + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(scrollState = columnState) { + SectionedList(columnState = columnState) { + downloadsSection(state = Section.State.Loading) - favouritesSection(state = Section.State.Empty) + favouritesSection(state = Section.State.Empty) + } } } @WearPreviewDevices @Composable fun SectionedListPreviewLoadedSection() { - SectionedList { - downloadsSection(state = Section.State.Loaded(downloads)) + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(scrollState = columnState) { + SectionedList(columnState = columnState) { + downloadsSection(state = Section.State.Loaded(downloads)) - favouritesSection(state = Section.State.Failed) + favouritesSection(state = Section.State.Failed) + } } } @WearPreviewDevices @Composable fun SectionedListPreviewFailedSection() { - SectionedList { - downloadsSection(state = Section.State.Failed) + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(scrollState = columnState) { + SectionedList(columnState = columnState) { + downloadsSection(state = Section.State.Failed) - favouritesSection(state = Section.State.Loaded(favourites)) + favouritesSection(state = Section.State.Loaded(favourites)) + } } } @WearPreviewDevices @Composable fun SectionedListPreviewEmptySection() { - SectionedList { - downloadsSection(state = Section.State.Empty) + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + + ScreenScaffold(scrollState = columnState) { + SectionedList(columnState = columnState) { + downloadsSection(state = Section.State.Empty) - favouritesSection(state = Section.State.Loading) + favouritesSection(state = Section.State.Loading) + } } } diff --git a/composables/src/main/java/com/google/android/horologist/composables/SectionedList.kt b/composables/src/main/java/com/google/android/horologist/composables/SectionedList.kt index f5261e6e48..b8e7bc3f60 100644 --- a/composables/src/main/java/com/google/android/horologist/composables/SectionedList.kt +++ b/composables/src/main/java/com/google/android/horologist/composables/SectionedList.kt @@ -24,7 +24,6 @@ import com.google.android.horologist.composables.Section.Companion.ALL_STATES import com.google.android.horologist.composables.Section.Companion.DEFAULT_LOADING_CONTENT_COUNT import com.google.android.horologist.composables.Section.Companion.LOADED_STATE_ONLY import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults import com.google.android.horologist.compose.layout.ScalingLazyColumnState /** @@ -35,7 +34,7 @@ import com.google.android.horologist.compose.layout.ScalingLazyColumnState @Composable public fun SectionedList( modifier: Modifier = Modifier, - columnState: ScalingLazyColumnState = ScalingLazyColumnDefaults.responsive().create(), + columnState: ScalingLazyColumnState, content: SectionedListScope.() -> Unit, ) { SectionedList( @@ -53,7 +52,7 @@ public fun SectionedList( @Composable public fun SectionedList( modifier: Modifier = Modifier, - columnState: ScalingLazyColumnState = ScalingLazyColumnDefaults.responsive().create(), + columnState: ScalingLazyColumnState, sections: List> = emptyList(), ) { ScalingLazyColumn( diff --git a/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListHeaderFooterTest.kt b/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListHeaderFooterTest.kt index d37fbd16bb..157f73d95c 100644 --- a/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListHeaderFooterTest.kt +++ b/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListHeaderFooterTest.kt @@ -24,9 +24,11 @@ import com.google.android.horologist.composables.SectionedListTest.Companion.Dow import com.google.android.horologist.composables.SectionedListTest.Companion.DownloadsHeader import com.google.android.horologist.composables.SectionedListTest.Companion.DownloadsLoaded import com.google.android.horologist.composables.SectionedListTest.Companion.DownloadsLoading -import com.google.android.horologist.composables.SectionedListTest.Companion.SectionedListPreview import com.google.android.horologist.composables.SectionedListTest.Companion.downloads -import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.screenshots.rng.WearLegacyScreenTest import org.junit.Test import org.junit.runner.RunWith @@ -42,9 +44,14 @@ class SectionedListHeaderFooterTest( @Test fun test() { runTest { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { section(state = sectionStateParam) { header(visibleStates = headerVisibleStatesParam) { DownloadsHeader() } diff --git a/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListTest.kt b/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListTest.kt index ec58eae0be..ffc10f6dea 100644 --- a/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListTest.kt +++ b/composables/src/test/kotlin/com/google/android/horologist/composables/SectionedListTest.kt @@ -36,9 +36,10 @@ import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.material.Icon import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text -import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.screenshots.rng.WearLegacyScreenTest import org.junit.Test @@ -48,9 +49,14 @@ class SectionedListTest : WearLegacyScreenTest() { @Test fun loadingSection() { runTest { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { downloadsSection(state = Section.State.Loading) @@ -63,9 +69,14 @@ class SectionedListTest : WearLegacyScreenTest() { @Test fun loadedSection() { runTest { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { downloadsSection(state = Section.State.Loaded(downloads)) @@ -78,9 +89,14 @@ class SectionedListTest : WearLegacyScreenTest() { @Test fun loadedSection_secondPage() { runTest(captureScreenshot = false) { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { downloadsSection(state = Section.State.Loaded(downloads)) @@ -99,9 +115,14 @@ class SectionedListTest : WearLegacyScreenTest() { @Test fun failedSection() { runTest { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { downloadsSection(state = Section.State.Failed) @@ -114,9 +135,14 @@ class SectionedListTest : WearLegacyScreenTest() { @Test fun failedSection_secondPage() { runTest(captureScreenshot = false) { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { downloadsSection(state = Section.State.Failed) @@ -135,9 +161,14 @@ class SectionedListTest : WearLegacyScreenTest() { @Test fun emptySection() { runTest { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { downloadsSection(state = Section.State.Empty) @@ -150,9 +181,14 @@ class SectionedListTest : WearLegacyScreenTest() { @Test fun emptyContentForStates() { runTest { - val columnState = ScalingLazyColumnDefaults.responsive().create() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) - SectionedListPreview(columnState) { + ScreenScaffold(scrollState = columnState) { SectionedList(columnState = columnState) { section { header { Text("Section 1") } @@ -180,16 +216,6 @@ class SectionedListTest : WearLegacyScreenTest() { internal companion object { - @Composable - fun SectionedListPreview( - columnState: ScalingLazyColumnState, - content: @Composable () -> Unit, - ) { - ScreenScaffold(scrollState = columnState) { - content() - } - } - val downloads = listOf("Nu Metal Essentials", "00s Rock") private fun SectionedListScope.downloadsSection(state: Section.State) { diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[0].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[0].png index 04e64cc220..98adf33b46 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[0].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[0].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:552bcdfc33c0f912c7cc9cd1199ae9f2ccbdb31ee99091b57febc57636c59045 -size 13848 +oid sha256:4b473a7fe0576a5f4282bf0556d28dcfeda77d649056ba72006f6881b288f6f8 +size 13816 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[1].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[1].png index 9618fdd5a5..824431a8b5 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[1].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[1].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:01cad238144ec1825bac9ab051dd5daaf45ad0655d2d82ce0b1c99e5c7973001 -size 21426 +oid sha256:f8e4fa9893203137d5bb8e9bd935258e4ef78754955ad1f238c315197527ebae +size 21458 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[2].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[2].png index b95b303b80..4a825337d9 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[2].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[2].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c27ca6095505eee32375e32b0c41163836692a61786be0300380d2904941edff -size 17208 +oid sha256:fc0e0a4aaab3cd9c2c507d09e9a9dfdf0941d103ab03a7a39fbf35043dcca375 +size 17173 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[3].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[3].png index 627ad79868..690a9d38e1 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[3].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[3].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6f204e97d4affcdbf651c2882c9ebb1fea61600998f8ce62f16a413d5f1b641b -size 16292 +oid sha256:71845444a33fe8f3ee57e189176f2fd051007a90602be32b9ca4e30b52e29152 +size 16257 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[4].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[4].png index 693f2cee9c..97edc8c15e 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[4].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[4].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91fb1e703486e08e546d07587d3f9f6849359640d7d0b4ca06ba9bef5325f211 -size 15895 +oid sha256:83a71dbd87895c55eb9cd1e0653163f6eeced12b069e81984b91247d3b8fd5f1 +size 17253 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[5].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[5].png index eb10ee248f..c30d3b7002 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[5].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[5].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4f855b6a91e6e68cb6951a2b5543578f0c6b58929f7dca3c3150bc238d4ef5e1 -size 25817 +oid sha256:be2637833d72f7bf15c891144d49b47bf5c80182ba31f61f0d8de8283820b036 +size 25926 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[6].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[6].png index a3f5b18ea0..3b42cd542a 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[6].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[6].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:80ab404375c85c0666a1183201a1e4280a04f36a681d128ce612d76492cbb5ea -size 19351 +oid sha256:00ee94b6dd7282c7a91e8136744c8a6125226ec9d9a8bcddca7d291e49a2492b +size 20505 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[7].png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[7].png index 2e0c17f3e0..d83a1cb0b6 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[7].png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListHeaderFooterTest_test[7].png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:23238b0e9c013e8672dbf40d41188bf376f0d2b940683b79db9efa33d7d4ff59 -size 18479 +oid sha256:625cca6b66c827591c09a06b76277828ad820996ec32d6089060774a059caee3 +size 19669 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptyContentForStates.png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptyContentForStates.png index 3651d962ca..ebaaff49a6 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptyContentForStates.png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptyContentForStates.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b8b6df011b12a3f663da77487bd6baf77c7f7a49b65ec0f2582855d7478f3e8 -size 23426 +oid sha256:6c51bdf7bf2222a5c97ae6b0b2f12b334503c611e2311e07803e2c1ca25a07ce +size 23295 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptySection.png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptySection.png index 14911d1aee..95b1a0d43a 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptySection.png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_emptySection.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:976629472d00589510f3703f3934b6cb8fc4724a471d733e88fa4f517efd85b7 -size 22011 +oid sha256:e02b7341c87b9dc854d9f628a142638b9280bf271fe188fa4e544411fc1a2d92 +size 21847 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_failedSection.png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_failedSection.png index 5c70429a49..b3c5aa34f0 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_failedSection.png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_failedSection.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a9a4f92fc4e2d6c2a16098c344a423c01725971bf6d34dbfc3927cbf090f541b -size 26147 +oid sha256:8f6de385264762a2ef731e491cdbdfb9c705b53af7ab8ff1f763326646b89f68 +size 25559 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadedSection.png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadedSection.png index 03e470bb48..fd809d1aa7 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadedSection.png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadedSection.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:394692e176a60c9006ba36629f549f2538acb08f27d99dc088af6267107b4b06 -size 26308 +oid sha256:5edc7374828cdfaaa0d7ec73984b13b9addd75fb9d0b8bc14a0fecd6b8ac5ef2 +size 25620 diff --git a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadingSection.png b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadingSection.png index 582bb63ece..529e392837 100644 --- a/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadingSection.png +++ b/composables/src/test/snapshots/images/com.google.android.horologist.composables_SectionedListTest_loadingSection.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:88b340f97784c24b2ce85b708cd10a625dca37b1032859044ff05bde5483b8cb -size 25771 +oid sha256:7d42e479c58777a635f74ec324129e49bdc5c9f140f745d57341952232f597b7 +size 25136 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 68f0b77126..b35ee758d4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -23,7 +23,7 @@ androidxTracing = "1.2.0" androidxWear = "1.3.0" androidxWork = "2.9.0" androidxprotolayout = "1.1.0" -androidxtiles = "1.3.0" +androidxtiles = "1.4.0-alpha04" annotation = "1.0.1" app-cash-turbine = "1.1.0" com-squareup-okhttp3 = "5.0.0-alpha.14" @@ -35,7 +35,7 @@ composesnapshot = "-" dependencyAnalysis = "1.32.0" dokka = "1.9.20" googledagger = "2.51.1" -gradlePlugin = "8.4.0" +gradlePlugin = "8.4.2" gradlePublishPlugin = "0.28.0" io-coil-kt = "2.6.0" junit = "4.13.2" diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/app/UampWearApp.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/app/UampWearApp.kt index e77ffe0214..14f0ea61eb 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/app/UampWearApp.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/app/UampWearApp.kt @@ -188,7 +188,6 @@ fun UampWearApp( ScreenScaffold(scrollState = columnState) { AudioDebugScreen( - columnState = columnState, audioDebugScreenViewModel = hiltViewModel(), ) } @@ -204,7 +203,6 @@ fun UampWearApp( ScreenScaffold(scrollState = columnState) { SamplesScreen( - columnState = columnState, samplesScreenViewModel = hiltViewModel(), navController = navController, ) @@ -221,7 +219,6 @@ fun UampWearApp( ScreenScaffold(scrollState = columnState) { DeveloperOptionsScreen( - columnState = columnState, developerOptionsScreenViewModel = hiltViewModel(), navController = navController, ) diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/auth/prompt/GoogleSignInPromptScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/auth/prompt/GoogleSignInPromptScreen.kt index 59296a9f8c..a599160f9f 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/auth/prompt/GoogleSignInPromptScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/auth/prompt/GoogleSignInPromptScreen.kt @@ -31,8 +31,6 @@ import androidx.wear.compose.material.Text import com.google.android.horologist.auth.composables.chips.GuestModeChip import com.google.android.horologist.auth.composables.chips.SignInChip import com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreen -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Confirmation import com.google.android.horologist.mediasample.R import com.google.android.horologist.mediasample.ui.navigation.navigateToGoogleSignIn @@ -40,7 +38,6 @@ import com.google.android.horologist.mediasample.ui.navigation.navigateToGoogleS @Composable fun GoogleSignInPromptScreen( navController: NavHostController, - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), modifier: Modifier = Modifier, viewModel: UampSignInPromptViewModel, ) { @@ -51,7 +48,6 @@ fun GoogleSignInPromptScreen( onAlreadySignedIn = { showAlreadySignedInDialog = true }, - columnState = columnState, modifier = modifier, viewModel = viewModel, ) { diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampBrowseScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampBrowseScreen.kt index ab4a41b4fa..91dc09cda0 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampBrowseScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampBrowseScreen.kt @@ -21,15 +21,12 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.media.ui.screens.browse.PlaylistDownloadBrowseScreen import com.google.android.horologist.media.ui.state.model.PlaylistDownloadUiModel import com.google.android.horologist.mediasample.R @Composable fun UampBrowseScreen( - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), uampBrowseScreenViewModel: UampBrowseScreenViewModel, onDownloadItemClick: (PlaylistDownloadUiModel) -> Unit, onPlaylistsClick: () -> Unit, @@ -46,7 +43,6 @@ fun UampBrowseScreen( }, onPlaylistsClick = onPlaylistsClick, onSettingsClick = onSettingsClick, - columnState = columnState, modifier = modifier, onDownloadItemInProgressClickActionLabel = stringResource(id = R.string.browse_download_cancel_action_label), ) diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampStreamingBrowseScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampStreamingBrowseScreen.kt index 8645630486..a5de7dd6e0 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampStreamingBrowseScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/browse/UampStreamingBrowseScreen.kt @@ -21,21 +21,17 @@ import androidx.compose.material.icons.automirrored.filled.PlaylistPlay import androidx.compose.material.icons.filled.Settings import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.media.ui.R import com.google.android.horologist.media.ui.screens.browse.BrowseScreen import com.google.android.horologist.media.ui.screens.browse.BrowseScreenPlaylistsSectionButton @Composable fun UampStreamingBrowseScreen( - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), onPlaylistsClick: () -> Unit, onSettingsClick: () -> Unit, modifier: Modifier = Modifier, ) { BrowseScreen( - columnState = columnState, modifier = modifier, ) { this.playlistsSection( diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/AudioDebugScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/AudioDebugScreen.kt index af4462bb55..7fa1e98b5d 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/AudioDebugScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/AudioDebugScreen.kt @@ -29,7 +29,9 @@ import androidx.wear.compose.foundation.lazy.items import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.mediasample.R import java.time.Instant import java.time.ZoneId @@ -37,12 +39,18 @@ import kotlin.time.Duration.Companion.seconds @Composable fun AudioDebugScreen( - columnState: ScalingLazyColumnState, audioDebugScreenViewModel: AudioDebugScreenViewModel, modifier: Modifier = Modifier, ) { val uiState by audioDebugScreenViewModel.uiState.collectAsStateWithLifecycle() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + ScalingLazyColumn( columnState = columnState, modifier = modifier, diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/SamplesScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/SamplesScreen.kt index 18a885b2fc..9d42ee34f4 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/SamplesScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/debug/SamplesScreen.kt @@ -28,20 +28,28 @@ import androidx.wear.compose.foundation.lazy.items import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.media.ui.navigation.MediaNavController.navigateToPlayer import com.google.android.horologist.mediasample.R import com.google.android.horologist.mediasample.ui.settings.ActionSetting @Composable fun SamplesScreen( - columnState: ScalingLazyColumnState, samplesScreenViewModel: SamplesScreenViewModel, navController: NavHostController, modifier: Modifier = Modifier, ) { val uiState by samplesScreenViewModel.uiState.collectAsStateWithLifecycle() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + ScalingLazyColumn( columnState = columnState, modifier = modifier, diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampEntityScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampEntityScreen.kt index 1c666fdd9a..5cef27d7ac 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampEntityScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampEntityScreen.kt @@ -23,8 +23,6 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.res.stringResource import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.AlertDialog import com.google.android.horologist.media.ui.screens.entity.PlaylistDownloadScreen import com.google.android.horologist.media.ui.screens.entity.PlaylistDownloadScreenState @@ -34,7 +32,6 @@ import com.google.android.horologist.mediasample.R @Composable fun UampEntityScreen( - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), playlistName: String, uampEntityScreenViewModel: UampEntityScreenViewModel, onDownloadItemClick: (DownloadMediaUiModel) -> Unit, @@ -77,7 +74,6 @@ fun UampEntityScreen( uampEntityScreenViewModel.play() onPlayClick(it) }, - columnState = columnState, onDownloadCompletedButtonClick = { showRemoveDownloadsDialog = true }, diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampStreamingPlaylistScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampStreamingPlaylistScreen.kt index 411dc9f7e2..09e4699c8f 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampStreamingPlaylistScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/entity/UampStreamingPlaylistScreen.kt @@ -19,15 +19,12 @@ package com.google.android.horologist.mediasample.ui.entity import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.lifecycle.compose.collectAsStateWithLifecycle -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.media.ui.screens.entity.PlaylistStreamingScreen import com.google.android.horologist.media.ui.state.model.DownloadMediaUiModel import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @Composable fun UampStreamingPlaylistScreen( - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), playlistName: String, viewModel: UampStreamingPlaylistScreenViewModel, onDownloadItemClick: (DownloadMediaUiModel) -> Unit, @@ -51,6 +48,5 @@ fun UampStreamingPlaylistScreen( viewModel.play(it.id) onDownloadItemClick(it) }, - columnState = columnState, ) } diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/playlists/UampPlaylistsScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/playlists/UampPlaylistsScreen.kt index 124d84a613..7012f279a8 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/playlists/UampPlaylistsScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/playlists/UampPlaylistsScreen.kt @@ -31,8 +31,6 @@ import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import androidx.wear.compose.material.dialog.Alert import androidx.wear.compose.material.dialog.Dialog -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Button import com.google.android.horologist.media.ui.screens.playlists.PlaylistsScreen import com.google.android.horologist.media.ui.screens.playlists.PlaylistsScreenState @@ -41,7 +39,6 @@ import com.google.android.horologist.mediasample.R @Composable fun UampPlaylistsScreen( - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), uampPlaylistsScreenViewModel: UampPlaylistsScreenViewModel, onPlaylistItemClick: (PlaylistUiModel) -> Unit, onErrorDialogCancelClick: () -> Unit, @@ -68,7 +65,6 @@ fun UampPlaylistsScreen( onPlaylistItemClick = { onPlaylistItemClick(it) }, - columnState = columnState, ) // b/242302037 - it should stop listening to uiState emissions while dialog is presented diff --git a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/DeveloperOptionsScreen.kt b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/DeveloperOptionsScreen.kt index ae9bd8c7ce..b4baa99224 100644 --- a/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/DeveloperOptionsScreen.kt +++ b/media/sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/DeveloperOptionsScreen.kt @@ -27,20 +27,28 @@ import androidx.navigation.NavHostController import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.Text import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.mediasample.R import com.google.android.horologist.mediasample.ui.navigation.navigateToAudioDebug import com.google.android.horologist.mediasample.ui.navigation.navigateToSamples @Composable fun DeveloperOptionsScreen( - columnState: ScalingLazyColumnState, developerOptionsScreenViewModel: DeveloperOptionsScreenViewModel, navController: NavHostController, modifier: Modifier = Modifier, ) { val uiState by developerOptionsScreenViewModel.uiState.collectAsStateWithLifecycle() + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + ScalingLazyColumn( columnState = columnState, modifier = modifier, diff --git a/media/ui/api/current.api b/media/ui/api/current.api index a3c8684f7d..71a6529095 100644 --- a/media/ui/api/current.api +++ b/media/ui/api/current.api @@ -319,7 +319,7 @@ package com.google.android.horologist.media.ui.navigation { package com.google.android.horologist.media.ui.screens.browse { public final class BrowseScreenKt { - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void BrowseScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1 content); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void BrowseScreen(optional androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1 content); } @com.google.android.horologist.annotations.ExperimentalHorologistApi public final class BrowseScreenPlaylistsSectionButton { @@ -371,7 +371,7 @@ package com.google.android.horologist.media.ui.screens.browse { } public final class PlaylistDownloadBrowseScreenKt { - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistDownloadBrowseScreen(com.google.android.horologist.media.ui.screens.browse.BrowseScreenState browseScreenState, kotlin.jvm.functions.Function1 onDownloadItemClick, kotlin.jvm.functions.Function1 onDownloadItemInProgressClick, kotlin.jvm.functions.Function0 onPlaylistsClick, kotlin.jvm.functions.Function0 onSettingsClick, optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional androidx.compose.ui.graphics.painter.Painter? downloadItemArtworkPlaceholder, optional String? onDownloadItemInProgressClickActionLabel); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistDownloadBrowseScreen(com.google.android.horologist.media.ui.screens.browse.BrowseScreenState browseScreenState, kotlin.jvm.functions.Function1 onDownloadItemClick, kotlin.jvm.functions.Function1 onDownloadItemInProgressClick, kotlin.jvm.functions.Function0 onPlaylistsClick, kotlin.jvm.functions.Function0 onSettingsClick, optional androidx.compose.ui.Modifier modifier, optional androidx.compose.ui.graphics.painter.Painter? downloadItemArtworkPlaceholder, optional String? onDownloadItemInProgressClickActionLabel); } } @@ -380,9 +380,9 @@ package com.google.android.horologist.media.ui.screens.entity { public final class EntityScreenKt { method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void DefaultEntityScreenHeader(String title, optional androidx.compose.ui.Modifier modifier); - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void EntityScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, com.google.android.horologist.media.ui.screens.entity.EntityScreenState entityScreenState, kotlin.jvm.functions.Function0 headerContent, kotlin.jvm.functions.Function1 loadingContent, kotlin.jvm.functions.Function1 mediaContent, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0? buttonsContent, optional kotlin.jvm.functions.Function0? failedContent); - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void EntityScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, kotlin.jvm.functions.Function0 headerContent, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0? buttonsContent, optional kotlin.jvm.functions.Function1? content); - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void EntityScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, kotlin.jvm.functions.Function0 headerContent, java.util.List mediaList, kotlin.jvm.functions.Function1 mediaContent, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0? buttonsContent); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void EntityScreen(com.google.android.horologist.media.ui.screens.entity.EntityScreenState entityScreenState, kotlin.jvm.functions.Function0 headerContent, kotlin.jvm.functions.Function1 loadingContent, kotlin.jvm.functions.Function1 mediaContent, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0? buttonsContent, optional kotlin.jvm.functions.Function0? failedContent); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void EntityScreen(kotlin.jvm.functions.Function0 headerContent, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0? buttonsContent, optional kotlin.jvm.functions.Function1? content); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void EntityScreen(kotlin.jvm.functions.Function0 headerContent, java.util.List mediaList, kotlin.jvm.functions.Function1 mediaContent, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function0? buttonsContent); } @com.google.android.horologist.annotations.ExperimentalHorologistApi public abstract sealed class EntityScreenState { @@ -405,7 +405,7 @@ package com.google.android.horologist.media.ui.screens.entity { } public final class PlaylistDownloadScreenKt { - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistDownloadScreen(String playlistName, com.google.android.horologist.media.ui.screens.entity.PlaylistDownloadScreenState playlistDownloadScreenState, kotlin.jvm.functions.Function1 onDownloadButtonClick, kotlin.jvm.functions.Function1 onCancelDownloadButtonClick, kotlin.jvm.functions.Function1 onDownloadItemClick, kotlin.jvm.functions.Function1 onDownloadItemInProgressClick, kotlin.jvm.functions.Function1 onShuffleButtonClick, kotlin.jvm.functions.Function1 onPlayButtonClick, optional androidx.compose.ui.Modifier modifier, optional com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional kotlin.jvm.functions.Function1? onDownloadCompletedButtonClick, optional String defaultMediaTitle, optional androidx.compose.ui.graphics.painter.Painter? downloadItemArtworkPlaceholder, optional String? onDownloadItemInProgressClickActionLabel); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistDownloadScreen(String playlistName, com.google.android.horologist.media.ui.screens.entity.PlaylistDownloadScreenState playlistDownloadScreenState, kotlin.jvm.functions.Function1 onDownloadButtonClick, kotlin.jvm.functions.Function1 onCancelDownloadButtonClick, kotlin.jvm.functions.Function1 onDownloadItemClick, kotlin.jvm.functions.Function1 onDownloadItemInProgressClick, kotlin.jvm.functions.Function1 onShuffleButtonClick, kotlin.jvm.functions.Function1 onPlayButtonClick, optional androidx.compose.ui.Modifier modifier, optional kotlin.jvm.functions.Function1? onDownloadCompletedButtonClick, optional String defaultMediaTitle, optional androidx.compose.ui.graphics.painter.Painter? downloadItemArtworkPlaceholder, optional String? onDownloadItemInProgressClickActionLabel); method @com.google.android.horologist.annotations.ExperimentalHorologistApi public static com.google.android.horologist.media.ui.screens.entity.PlaylistDownloadScreenState.Loaded createPlaylistDownloadScreenStateLoaded(com.google.android.horologist.media.ui.state.model.PlaylistUiModel playlistModel, java.util.List downloadMediaList); } @@ -461,7 +461,7 @@ package com.google.android.horologist.media.ui.screens.entity { } public final class PlaylistStreamingScreenKt { - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistStreamingScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, String playlistName, com.google.android.horologist.media.ui.screens.entity.PlaylistDownloadScreenState playlistDownloadScreenState, kotlin.jvm.functions.Function0 onShuffleButtonClick, kotlin.jvm.functions.Function0 onPlayButtonClick, kotlin.jvm.functions.Function1 onPlayItemClick, optional androidx.compose.ui.Modifier modifier, optional String defaultMediaTitle); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistStreamingScreen(String playlistName, com.google.android.horologist.media.ui.screens.entity.PlaylistDownloadScreenState playlistDownloadScreenState, kotlin.jvm.functions.Function0 onShuffleButtonClick, kotlin.jvm.functions.Function0 onPlayButtonClick, kotlin.jvm.functions.Function1 onPlayItemClick, optional androidx.compose.ui.Modifier modifier, optional String defaultMediaTitle); } } @@ -488,9 +488,9 @@ package com.google.android.horologist.media.ui.screens.playerlibrarypager { package com.google.android.horologist.media.ui.screens.playlists { public final class PlaylistsScreenKt { - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistsScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, com.google.android.horologist.media.ui.screens.playlists.PlaylistsScreenState playlistsScreenState, kotlin.jvm.functions.Function1 playlistContent, optional androidx.compose.ui.Modifier modifier); - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistsScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, com.google.android.horologist.media.ui.screens.playlists.PlaylistsScreenState playlistsScreenState, kotlin.jvm.functions.Function1 onPlaylistItemClick, optional androidx.compose.ui.Modifier modifier, optional androidx.compose.ui.graphics.painter.Painter? playlistItemArtworkPlaceholder); - method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistsScreen(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, java.util.List playlists, kotlin.jvm.functions.Function1 playlistContent, optional androidx.compose.ui.Modifier modifier); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistsScreen(com.google.android.horologist.media.ui.screens.playlists.PlaylistsScreenState playlistsScreenState, kotlin.jvm.functions.Function1 playlistContent, optional androidx.compose.ui.Modifier modifier); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistsScreen(com.google.android.horologist.media.ui.screens.playlists.PlaylistsScreenState playlistsScreenState, kotlin.jvm.functions.Function1 onPlaylistItemClick, optional androidx.compose.ui.Modifier modifier, optional androidx.compose.ui.graphics.painter.Painter? playlistItemArtworkPlaceholder); + method @androidx.compose.runtime.Composable @com.google.android.horologist.annotations.ExperimentalHorologistApi public static void PlaylistsScreen(java.util.List playlists, kotlin.jvm.functions.Function1 playlistContent, optional androidx.compose.ui.Modifier modifier); } @com.google.android.horologist.annotations.ExperimentalHorologistApi public abstract sealed class PlaylistsScreenState { diff --git a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreenPreview.kt b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreenPreview.kt index e621b1e9df..f9b6b66b03 100644 --- a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreenPreview.kt +++ b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreenPreview.kt @@ -28,7 +28,6 @@ import androidx.wear.compose.material.ChipDefaults import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices import com.google.android.horologist.composables.PlaceholderChip import com.google.android.horologist.composables.Section -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable import com.google.android.horologist.media.ui.R @@ -72,7 +71,7 @@ private fun BrowseScreenPreviewSample( trendingSectionState: Section.State, downloadsSectionState: Section.State>, ) { - BrowseScreen(columnState = rememberResponsiveColumnState()) { + BrowseScreen { button( BrowseScreenPlaylistsSectionButton( textId = R.string.horologist_browse_screen_preview_sign_in, @@ -101,7 +100,7 @@ private fun BrowseScreenPreviewSample( } } - downloadsSection>( + downloadsSection( state = downloadsSectionState, ) { loaded { item -> diff --git a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenPreview.kt b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenPreview.kt index 316ce36edc..9bc691dad6 100644 --- a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenPreview.kt +++ b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenPreview.kt @@ -21,7 +21,6 @@ import androidx.compose.material.icons.automirrored.filled.FeaturedPlayList import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.images.base.util.rememberVectorPainter import com.google.android.horologist.media.ui.state.model.PlaylistDownloadUiModel import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @@ -31,7 +30,6 @@ import com.google.android.horologist.media.ui.uamp.UampTheme @Composable fun PlaylistDownloadBrowseScreenPreview() { PlaylistDownloadBrowseScreen( - columnState = rememberResponsiveColumnState(), browseScreenState = BrowseScreenState.Loaded(downloadList), onDownloadItemClick = { }, onDownloadItemInProgressClick = { }, @@ -48,7 +46,6 @@ fun PlaylistDownloadBrowseScreenPreview() { @Composable fun PlaylistDownloadBrowseScreenPreviewNoDownloads() { PlaylistDownloadBrowseScreen( - columnState = rememberResponsiveColumnState(), browseScreenState = BrowseScreenState.Loaded(emptyList()), onDownloadItemClick = { }, onDownloadItemInProgressClick = { }, @@ -61,7 +58,6 @@ fun PlaylistDownloadBrowseScreenPreviewNoDownloads() { @Composable fun PlaylistDownloadBrowseScreenPreviewLoading() { PlaylistDownloadBrowseScreen( - columnState = rememberResponsiveColumnState(), browseScreenState = BrowseScreenState.Loading, onDownloadItemClick = { }, onDownloadItemInProgressClick = { }, @@ -75,7 +71,6 @@ fun PlaylistDownloadBrowseScreenPreviewLoading() { fun PlaylistDownloadBrowseScreenPreviewUampTheme() { UampTheme { PlaylistDownloadBrowseScreen( - columnState = rememberResponsiveColumnState(), browseScreenState = BrowseScreenState.Loaded(downloadList), onDownloadItemClick = { }, onDownloadItemInProgressClick = { }, diff --git a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/EntityScreenPreview.kt b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/EntityScreenPreview.kt index 37ad5a6a0e..aaaf5af0e9 100644 --- a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/EntityScreenPreview.kt +++ b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/EntityScreenPreview.kt @@ -45,7 +45,6 @@ import androidx.wear.compose.material.Icon import androidx.wear.compose.material.Text import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices import com.google.android.horologist.composables.PlaceholderChip -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Button import com.google.android.horologist.compose.material.Chip @@ -53,7 +52,6 @@ import com.google.android.horologist.compose.material.Chip @Composable fun EntityScreenPreview() { EntityScreen( - columnState = rememberResponsiveColumnState(), headerContent = { Box( modifier = Modifier @@ -109,7 +107,6 @@ fun EntityScreenPreview() { @Composable fun EntityScreenPreviewLoadedState() { EntityScreen( - columnState = rememberResponsiveColumnState(), entityScreenState = EntityScreenState.Loaded(listOf("Song 1", "Song 2")), headerContent = { DefaultEntityScreenHeader(title = "Playlist name") }, loadingContent = { }, @@ -122,7 +119,6 @@ fun EntityScreenPreviewLoadedState() { @Composable fun EntityScreenPreviewLoadingState() { EntityScreen( - columnState = rememberResponsiveColumnState(), entityScreenState = EntityScreenState.Loading, headerContent = { DefaultEntityScreenHeader(title = "Playlist name") }, loadingContent = { items(count = 2) { PlaceholderChip(colors = ChipDefaults.secondaryChipColors()) } }, @@ -135,7 +131,6 @@ fun EntityScreenPreviewLoadingState() { @Composable fun EntityScreenPreviewFailedState() { EntityScreen( - columnState = rememberResponsiveColumnState(), entityScreenState = EntityScreenState.Failed, headerContent = { DefaultEntityScreenHeader(title = "Playlist name") }, loadingContent = { }, diff --git a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreenPreview.kt b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreenPreview.kt index 6839e4e60e..769c941bb8 100644 --- a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreenPreview.kt +++ b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreenPreview.kt @@ -21,7 +21,6 @@ import androidx.compose.material.icons.filled.MusicNote import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.images.base.util.rememberVectorPainter import com.google.android.horologist.media.ui.state.model.DownloadMediaUiModel import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @@ -30,7 +29,6 @@ import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @Composable fun PlaylistDownloadScreenPreviewLoading() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = PlaylistDownloadScreenState.Loading, onDownloadButtonClick = { }, @@ -46,7 +44,6 @@ fun PlaylistDownloadScreenPreviewLoading() { @Composable fun PlaylistDownloadScreenPreviewLoadedNoneDownloaded() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = createPlaylistDownloadScreenStateLoaded( playlistModel = playlistUiModel, @@ -69,7 +66,6 @@ fun PlaylistDownloadScreenPreviewLoadedNoneDownloaded() { @Composable fun PlaylistDownloadScreenPreviewLoadedNoneDownloadedDownloading() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = createPlaylistDownloadScreenStateLoaded( playlistModel = playlistUiModel, @@ -92,7 +88,6 @@ fun PlaylistDownloadScreenPreviewLoadedNoneDownloadedDownloading() { @Composable fun PlaylistDownloadScreenPreviewLoadedPartiallyDownloaded() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = createPlaylistDownloadScreenStateLoaded( playlistModel = playlistUiModel, @@ -115,7 +110,6 @@ fun PlaylistDownloadScreenPreviewLoadedPartiallyDownloaded() { @Composable fun PlaylistDownloadScreenPreviewLoadedPartiallyDownloadedDownloadingUnknownSize() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = createPlaylistDownloadScreenStateLoaded( playlistModel = playlistUiModel, @@ -138,7 +132,6 @@ fun PlaylistDownloadScreenPreviewLoadedPartiallyDownloadedDownloadingUnknownSize @Composable fun PlaylistDownloadScreenPreviewLoadedPartiallyDownloadedDownloadingWaiting() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = createPlaylistDownloadScreenStateLoaded( playlistModel = playlistUiModel, @@ -161,7 +154,6 @@ fun PlaylistDownloadScreenPreviewLoadedPartiallyDownloadedDownloadingWaiting() { @Composable fun PlaylistDownloadScreenPreviewLoadedFullyDownloaded() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = createPlaylistDownloadScreenStateLoaded( playlistModel = playlistUiModel, @@ -184,7 +176,6 @@ fun PlaylistDownloadScreenPreviewLoadedFullyDownloaded() { @Composable fun PlaylistDownloadScreenPreviewFailed() { PlaylistDownloadScreen( - columnState = rememberResponsiveColumnState(), playlistName = "Playlist name", playlistDownloadScreenState = PlaylistDownloadScreenState.Failed, onDownloadButtonClick = { }, diff --git a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreenPreview.kt b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreenPreview.kt index 582570170d..65c4ca8c8c 100644 --- a/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreenPreview.kt +++ b/media/ui/src/debug/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreenPreview.kt @@ -21,7 +21,6 @@ import androidx.compose.material.icons.automirrored.filled.FeaturedPlayList import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import androidx.wear.compose.ui.tooling.preview.WearPreviewDevices -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.images.base.util.rememberVectorPainter import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @@ -30,7 +29,6 @@ import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @Composable fun PlaylistsScreenPreview() { PlaylistsScreen( - columnState = rememberResponsiveColumnState(), playlistsScreenState = PlaylistsScreenState.Loaded( buildList { add( @@ -61,7 +59,6 @@ fun PlaylistsScreenPreview() { @Composable fun PlaylistsScreenPreviewLoading() { PlaylistsScreen( - columnState = rememberResponsiveColumnState(), playlistsScreenState = PlaylistsScreenState.Loading, onPlaylistItemClick = { }, ) @@ -71,7 +68,6 @@ fun PlaylistsScreenPreviewLoading() { @Composable fun PlaylistsScreenPreviewFailed() { PlaylistsScreen( - columnState = rememberResponsiveColumnState(), playlistsScreenState = PlaylistsScreenState.Failed, onPlaylistItemClick = { }, ) @@ -81,7 +77,6 @@ fun PlaylistsScreenPreviewFailed() { @Composable fun PlaylistsScreenPreviewCustomLayout() { PlaylistsScreen( - columnState = rememberResponsiveColumnState(), playlists = listOf( Pair("Rock Classics", "Downloading 73%.."), Pair("Pop Punk", "Completed"), diff --git a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreen.kt b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreen.kt index bec72dcf6f..1deb331fc6 100644 --- a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreen.kt +++ b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/BrowseScreen.kt @@ -33,8 +33,10 @@ import com.google.android.horologist.composables.Section.Companion.ALL_STATES import com.google.android.horologist.composables.Section.Companion.LOADED_STATE_ONLY import com.google.android.horologist.composables.SectionContentScope import com.google.android.horologist.composables.SectionedList -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.compose.material.ListHeaderDefaults.firstItemPadding import com.google.android.horologist.compose.material.ResponsiveListHeader @@ -57,10 +59,16 @@ import com.google.android.horologist.media.ui.state.model.PlaylistDownloadUiMode @ExperimentalHorologistApi @Composable public fun BrowseScreen( - columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, content: BrowseScreenScope.() -> Unit, ) { + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + ScreenScaffold(scrollState = columnState) { SectionedList( columnState = columnState, diff --git a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreen.kt b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreen.kt index 9aea3fe0f5..52ae6e4ea0 100644 --- a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreen.kt +++ b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreen.kt @@ -30,8 +30,6 @@ import androidx.wear.compose.material.ChipDefaults import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.composables.PlaceholderChip import com.google.android.horologist.composables.Section -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.images.base.paintable.ImageVectorPaintable.Companion.asPaintable import com.google.android.horologist.images.coil.CoilPaintable @@ -50,12 +48,10 @@ public fun PlaylistDownloadBrowseScreen( onPlaylistsClick: () -> Unit, onSettingsClick: () -> Unit, modifier: Modifier = Modifier, - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), downloadItemArtworkPlaceholder: Painter? = null, onDownloadItemInProgressClickActionLabel: String? = null, ) { BrowseScreen( - columnState = columnState, modifier = modifier, ) { val downloadsSectionState = when (browseScreenState) { diff --git a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/EntityScreen.kt b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/EntityScreen.kt index 2b5514139a..610b4adb3a 100644 --- a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/EntityScreen.kt +++ b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/EntityScreen.kt @@ -23,8 +23,10 @@ import androidx.compose.ui.unit.dp import androidx.wear.compose.foundation.lazy.ScalingLazyListScope import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.compose.layout.ScalingLazyColumn -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding import com.google.android.horologist.compose.layout.ScreenScaffold +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Title /** @@ -33,12 +35,18 @@ import com.google.android.horologist.compose.material.Title @ExperimentalHorologistApi @Composable public fun EntityScreen( - columnState: ScalingLazyColumnState, headerContent: @Composable () -> Unit, modifier: Modifier = Modifier, buttonsContent: (@Composable () -> Unit)? = null, content: (ScalingLazyListScope.() -> Unit)? = null, ) { + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + ScreenScaffold(scrollState = columnState) { ScalingLazyColumn( columnState = columnState, @@ -67,7 +75,6 @@ public fun EntityScreen( @ExperimentalHorologistApi @Composable public fun EntityScreen( - columnState: ScalingLazyColumnState, headerContent: @Composable () -> Unit, mediaList: List, mediaContent: @Composable (media: Media) -> Unit, @@ -76,7 +83,6 @@ public fun EntityScreen( ) { EntityScreen( headerContent = headerContent, - columnState = columnState, modifier = modifier, buttonsContent = buttonsContent, content = { @@ -94,7 +100,6 @@ public fun EntityScreen( @ExperimentalHorologistApi @Composable public fun EntityScreen( - columnState: ScalingLazyColumnState, entityScreenState: EntityScreenState, headerContent: @Composable () -> Unit, loadingContent: ScalingLazyListScope.() -> Unit, @@ -107,7 +112,6 @@ public fun EntityScreen( EntityScreenState.Loading -> { EntityScreen( headerContent = headerContent, - columnState = columnState, modifier = modifier, buttonsContent = buttonsContent, content = loadingContent, @@ -116,7 +120,6 @@ public fun EntityScreen( is EntityScreenState.Loaded -> { EntityScreen( - columnState = columnState, headerContent = headerContent, mediaList = entityScreenState.mediaList, mediaContent = mediaContent, @@ -127,7 +130,6 @@ public fun EntityScreen( EntityScreenState.Failed -> { EntityScreen( - columnState = columnState, headerContent = headerContent, modifier = modifier, buttonsContent = buttonsContent, diff --git a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreen.kt b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreen.kt index a86d525750..85764e728d 100644 --- a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreen.kt +++ b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistDownloadScreen.kt @@ -54,8 +54,6 @@ import androidx.wear.compose.material.MaterialTheme import androidx.wear.compose.material.ProgressIndicatorDefaults import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.composables.PlaceholderChip -import com.google.android.horologist.compose.layout.ScalingLazyColumnState -import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Button import com.google.android.horologist.compose.material.ButtonSize import com.google.android.horologist.compose.material.Chip @@ -84,7 +82,6 @@ public fun PlaylistDownloadScreen( onShuffleButtonClick: (PlaylistUiModel) -> Unit, onPlayButtonClick: (PlaylistUiModel) -> Unit, modifier: Modifier = Modifier, - columnState: ScalingLazyColumnState = rememberResponsiveColumnState(), onDownloadCompletedButtonClick: ((PlaylistUiModel) -> Unit)? = null, defaultMediaTitle: String = "", downloadItemArtworkPlaceholder: Painter? = null, @@ -101,7 +98,6 @@ public fun PlaylistDownloadScreen( } EntityScreen( - columnState = columnState, entityScreenState = entityScreenState, headerContent = { DefaultEntityScreenHeader(title = playlistName) }, loadingContent = { items(count = 2) { PlaceholderChip(colors = ChipDefaults.secondaryChipColors()) } }, diff --git a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistStreamingScreen.kt b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistStreamingScreen.kt index 95d30c6f40..d771293c8f 100644 --- a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistStreamingScreen.kt +++ b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/entity/PlaylistStreamingScreen.kt @@ -30,7 +30,6 @@ import androidx.compose.ui.unit.dp import androidx.wear.compose.material.ChipDefaults import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.composables.PlaceholderChip -import com.google.android.horologist.compose.layout.ScalingLazyColumnState import com.google.android.horologist.compose.layout.rememberActivePlaceholderState import com.google.android.horologist.compose.material.Button import com.google.android.horologist.compose.material.Chip @@ -46,7 +45,6 @@ import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @ExperimentalHorologistApi @Composable public fun PlaylistStreamingScreen( - columnState: ScalingLazyColumnState, playlistName: String, playlistDownloadScreenState: PlaylistDownloadScreenState, onShuffleButtonClick: () -> Unit, @@ -70,7 +68,6 @@ public fun PlaylistStreamingScreen( rememberActivePlaceholderState { entityScreenState !is EntityScreenState.Loading } EntityScreen( - columnState = columnState, entityScreenState = entityScreenState, headerContent = { DefaultEntityScreenHeader(title = playlistName) }, loadingContent = { diff --git a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreen.kt b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreen.kt index e912f2c67e..167eaacf5a 100644 --- a/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreen.kt +++ b/media/ui/src/main/java/com/google/android/horologist/media/ui/screens/playlists/PlaylistsScreen.kt @@ -27,9 +27,11 @@ import com.google.android.horologist.annotations.ExperimentalHorologistApi import com.google.android.horologist.composables.PlaceholderChip import com.google.android.horologist.composables.Section import com.google.android.horologist.composables.SectionedList -import com.google.android.horologist.compose.layout.ScalingLazyColumnState +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.ItemType +import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults.padding import com.google.android.horologist.compose.layout.ScreenScaffold import com.google.android.horologist.compose.layout.rememberActivePlaceholderState +import com.google.android.horologist.compose.layout.rememberResponsiveColumnState import com.google.android.horologist.compose.material.Chip import com.google.android.horologist.compose.material.Title import com.google.android.horologist.images.coil.CoilPaintable @@ -39,7 +41,6 @@ import com.google.android.horologist.media.ui.state.model.PlaylistUiModel @ExperimentalHorologistApi @Composable public fun PlaylistsScreen( - columnState: ScalingLazyColumnState, playlists: List, playlistContent: @Composable (playlist: T) -> Unit, modifier: Modifier = Modifier, @@ -47,7 +48,6 @@ public fun PlaylistsScreen( PlaylistsScreen( playlistsScreenState = PlaylistsScreenState.Loaded(playlists), playlistContent = playlistContent, - columnState = columnState, modifier = modifier, ) } @@ -55,11 +55,17 @@ public fun PlaylistsScreen( @ExperimentalHorologistApi @Composable public fun PlaylistsScreen( - columnState: ScalingLazyColumnState, playlistsScreenState: PlaylistsScreenState, playlistContent: @Composable (playlist: T) -> Unit, modifier: Modifier = Modifier, ) { + val columnState = rememberResponsiveColumnState( + contentPadding = padding( + first = ItemType.Text, + last = ItemType.Chip, + ), + ) + // TODO This should be folded into SectionedList val placeholderState = rememberActivePlaceholderState { playlistsScreenState !is PlaylistsScreenState.Loading } @@ -105,7 +111,6 @@ public fun PlaylistsScreen( @ExperimentalHorologistApi @Composable public fun PlaylistsScreen( - columnState: ScalingLazyColumnState, playlistsScreenState: PlaylistsScreenState, onPlaylistItemClick: (PlaylistUiModel) -> Unit, modifier: Modifier = Modifier, @@ -122,7 +127,6 @@ public fun PlaylistsScreen( } PlaylistsScreen( - columnState = columnState, playlistsScreenState = playlistsScreenState, playlistContent = playlistContent, modifier = modifier, diff --git a/media/ui/src/main/java/com/google/android/horologist/media/ui/tiles/MediaCollectionsTileRenderer.kt b/media/ui/src/main/java/com/google/android/horologist/media/ui/tiles/MediaCollectionsTileRenderer.kt index b9b245dddc..6699f78671 100644 --- a/media/ui/src/main/java/com/google/android/horologist/media/ui/tiles/MediaCollectionsTileRenderer.kt +++ b/media/ui/src/main/java/com/google/android/horologist/media/ui/tiles/MediaCollectionsTileRenderer.kt @@ -61,6 +61,7 @@ public class MediaCollectionsTileRenderer( deviceParameters: DeviceParameters, ): LayoutElementBuilders.LayoutElement { return PrimaryLayout.Builder(deviceParameters) + .setResponsiveContentInsetEnabled(true) .setContent( Column.Builder() .setWidth(expandedDimensionProp) diff --git a/media/ui/src/test/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenA11yTallScreenshotTest.kt b/media/ui/src/test/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenA11yTallScreenshotTest.kt index 5c3df2138d..a1d11ee61d 100644 --- a/media/ui/src/test/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenA11yTallScreenshotTest.kt +++ b/media/ui/src/test/java/com/google/android/horologist/media/ui/screens/browse/PlaylistDownloadBrowseScreenA11yTallScreenshotTest.kt @@ -52,7 +52,6 @@ class PlaylistDownloadBrowseScreenA11yTallScreenshotTest : WearLegacyA11yTest() onDownloadItemInProgressClick = { }, onPlaylistsClick = { }, onSettingsClick = { }, - columnState = columnState, onDownloadItemInProgressClickActionLabel = "cancel", ) } diff --git a/sample/src/test/kotlin/com/google/android/horologist/screensizes/AuthSignInTest.kt b/sample/src/test/kotlin/com/google/android/horologist/screensizes/AuthSignInTest.kt index 335d09284e..496f3505ae 100644 --- a/sample/src/test/kotlin/com/google/android/horologist/screensizes/AuthSignInTest.kt +++ b/sample/src/test/kotlin/com/google/android/horologist/screensizes/AuthSignInTest.kt @@ -22,7 +22,6 @@ import com.google.android.horologist.auth.composables.chips.GuestModeChip import com.google.android.horologist.auth.composables.chips.SignInChip import com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreen import com.google.android.horologist.auth.ui.common.screens.prompt.SignInPromptScreenState -import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults import com.google.android.horologist.compose.tools.Device class AuthSignInTest(device: Device) : WearLegacyScreenSizeTest(device = device, showTimeText = false) { @@ -35,7 +34,6 @@ class AuthSignInTest(device: Device) : WearLegacyScreenSizeTest(device = device, message = "Send messages and create chat groups with your friends", onIdleStateObserved = { }, onAlreadySignedIn = { }, - columnState = ScalingLazyColumnDefaults.responsive().create(), ) { item { SignInChip( diff --git a/sample/src/test/kotlin/com/google/android/horologist/screensizes/MediaPlayerLibraryTest.kt b/sample/src/test/kotlin/com/google/android/horologist/screensizes/MediaPlayerLibraryTest.kt index da4b726cbf..65cb8585db 100644 --- a/sample/src/test/kotlin/com/google/android/horologist/screensizes/MediaPlayerLibraryTest.kt +++ b/sample/src/test/kotlin/com/google/android/horologist/screensizes/MediaPlayerLibraryTest.kt @@ -19,20 +19,15 @@ package com.google.android.horologist.screensizes import androidx.compose.foundation.ExperimentalFoundationApi -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.pager.rememberPagerState import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.MusicNote import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.wear.compose.material.PositionIndicator -import androidx.wear.compose.material.Scaffold import coil.annotation.ExperimentalCoilApi import coil.test.FakeImageLoaderEngine +import com.google.android.horologist.compose.layout.AppScaffold import com.google.android.horologist.compose.layout.ResponsiveTimeText -import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults -import com.google.android.horologist.compose.layout.scrollAway import com.google.android.horologist.compose.pager.PagerScreen import com.google.android.horologist.compose.tools.Device import com.google.android.horologist.images.base.util.rememberVectorPainter @@ -80,25 +75,19 @@ class MediaPlayerLibraryTest(device: Device) : ), ) - val columnState = ScalingLazyColumnDefaults.responsive().create() - PagerScreen( - state = rememberPagerState(1) { - 2 + AppScaffold( + timeText = { + ResponsiveTimeText( + timeSource = FixedTimeSource, + ) }, ) { - if (it == 1) { - Scaffold( - modifier = Modifier.fillMaxSize(), - timeText = { - ResponsiveTimeText( - modifier = Modifier.scrollAway(columnState), - timeSource = FixedTimeSource, - ) - }, - positionIndicator = { - PositionIndicator(columnState.state) - }, - ) { + PagerScreen( + state = rememberPagerState(1) { + 2 + }, + ) { + if (it == 1) { PlaylistDownloadScreen( playlistName = "Playlist name", playlistDownloadScreenState = createPlaylistDownloadScreenStateLoaded( @@ -111,7 +100,6 @@ class MediaPlayerLibraryTest(device: Device) : onDownloadItemInProgressClick = { }, onShuffleButtonClick = { }, onPlayButtonClick = { }, - columnState = columnState, downloadItemArtworkPlaceholder = rememberVectorPainter( image = Icons.Default.MusicNote, tintColor = Color.Blue, diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_5.png b/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_5.png index 82300c5257..cb57948940 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_5.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e0819a1048304b45b69c80194ef34463573d63b838512072a9fb42e817f82b8 -size 27615 +oid sha256:e578d5b5cb7819d090802d5969eb4d47d17c878eb4b69075bb2f5c27749ba959 +size 32042 diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6.png b/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6.png index 8157a52aff..f228ddaa6d 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7137605333930680696c79760e283f529d78ecb6eda0f1c8600cfe0fd16815ab -size 29607 +oid sha256:1c365a6c2c5a4a5442aa57c62dae3f31775870be56d057f807208e4f20713edb +size 29672 diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6_small_font.png b/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6_small_font.png index 11ee77af2c..3edd0f4d61 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6_small_font.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_galaxy_watch_6_small_font.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9d37f1e0e0f11324d27d98c5372fefd2a98a926353f6b4ee5455ed28a6df7e7 -size 28398 +oid sha256:36e4090fe33392672febfff12aca13c043920f2282dae51cd85815f23f990300 +size 28721 diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_large_round.png b/sample/src/test/screenshots/SelectAccountScreenTest_large_round.png index 34673c670b..c23e818f75 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_large_round.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_large_round.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2b30df4f74663acbd2618d1314beb1f2386438bb108db88b0e4268e92dc1ee62 -size 29667 +oid sha256:c7e1060d82bc99fb8f26ba8fd4bdb7765a7f24ac34c0be28098334d1513ef415 +size 29841 diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch.png b/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch.png index 16ca0cf17c..8245695338 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae6d324c448d45ad6ae359daf63356b56facd457cf12e769afe97082d8e7cb93 -size 27414 +oid sha256:78094688b8b142205d91f8b0ac71772adf7d85a99edf7d5854a40a106e9e4380 +size 29961 diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch_large_font.png b/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch_large_font.png index 97d48dd953..8975d456ed 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch_large_font.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_pixel_watch_large_font.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:54d7029beef4d22c46bffdadc431b1f687f7b91e1987a18b0e2ec224c2a90f4f -size 30179 +oid sha256:34f383ff5844820efad4a710193d304c411062212a4dcaadd2f973bf81980a08 +size 30619 diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_small_round.png b/sample/src/test/screenshots/SelectAccountScreenTest_small_round.png index 16ca0cf17c..8245695338 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_small_round.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_small_round.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae6d324c448d45ad6ae359daf63356b56facd457cf12e769afe97082d8e7cb93 -size 27414 +oid sha256:78094688b8b142205d91f8b0ac71772adf7d85a99edf7d5854a40a106e9e4380 +size 29961 diff --git a/sample/src/test/screenshots/SelectAccountScreenTest_ticwatch_pro_5.png b/sample/src/test/screenshots/SelectAccountScreenTest_ticwatch_pro_5.png index 414c00bb4b..09ae38e13b 100644 --- a/sample/src/test/screenshots/SelectAccountScreenTest_ticwatch_pro_5.png +++ b/sample/src/test/screenshots/SelectAccountScreenTest_ticwatch_pro_5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6544e03ececcc236477be16b1690b93543ca3984c5f67c71b632c88990bb8987 -size 29886 +oid sha256:4191997b440461d8abbdd20a7c79454a68a7c0c35f61c7bc5431e3c3bf76fb41 +size 30197 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[0]_mobvoiticwatchpro5.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[0]_mobvoiticwatchpro5.png index fde3e8b2af..81ddc62e71 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[0]_mobvoiticwatchpro5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[0]_mobvoiticwatchpro5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4a75eadac1dcc541b68dbc4df39dfdb3a65d9bde92ce7c5e7445e42a2ddc638d -size 31159 +oid sha256:cc27773caf684f3f1358092653fa05065adc17ad0e3736cc1e31c22a15c25006 +size 28389 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[1]_samsunggalaxywatch5.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[1]_samsunggalaxywatch5.png index a466bca337..f8e3601498 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[1]_samsunggalaxywatch5.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[1]_samsunggalaxywatch5.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ed96a829c59659e2d705998aa3dc87918e8389129497358c7cc148fca3db529 -size 25971 +oid sha256:3b0d0018cff9c5261373cac38c93462ecbf6e7bcf4c654105ea14811528dc145 +size 23729 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[2]_samsunggalaxywatch6large.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[2]_samsunggalaxywatch6large.png index ed443dc86e..47c9a64874 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[2]_samsunggalaxywatch6large.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[2]_samsunggalaxywatch6large.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2fb6d191d0b4685a6cd251c2dc21fc743d8c75b739753f92db08794680cc5c48 -size 31902 +oid sha256:28fcbf0d3855c1e5b87c44a6382cfe68ae7da36031c556538bef4e58d0b759e2 +size 28685 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[3]_googlepixelwatch.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[3]_googlepixelwatch.png index 3b33ec4f92..8aa9dae22b 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[3]_googlepixelwatch.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[3]_googlepixelwatch.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:de5b7112c4ad49f6ef9e9e7c7c1a272f2b9fc7154e2e4f22dbf972621d816083 -size 25384 +oid sha256:107b64f73ea376a5cd733d8d7c04a03fce6c46e30a9cc0a87e6fd5c08c7b8147 +size 23375 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[4]_genericsmallround.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[4]_genericsmallround.png index 3b33ec4f92..8aa9dae22b 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[4]_genericsmallround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[4]_genericsmallround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:de5b7112c4ad49f6ef9e9e7c7c1a272f2b9fc7154e2e4f22dbf972621d816083 -size 25384 +oid sha256:107b64f73ea376a5cd733d8d7c04a03fce6c46e30a9cc0a87e6fd5c08c7b8147 +size 23375 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[5]_genericlargeround.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[5]_genericlargeround.png index 01b22ff892..fe51d6d47f 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[5]_genericlargeround.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[5]_genericlargeround.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:29867652f9f0e8198d000cd584627765cd84bc67e11d550f184f0477d2a14b45 -size 30257 +oid sha256:4b381146a3d2eda15d8247f5dc9668caa26e3fb7353876f702b42f4dad5c1444 +size 27289 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[6]_smalldevicebigfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[6]_smalldevicebigfonts.png index 207a5d5514..9eae25b9eb 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[6]_smalldevicebigfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[6]_smalldevicebigfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:340b073dfacf2204ca3bcace6931a6c92734c0d45e5454494eda74d5c763dec9 -size 26229 +oid sha256:eea04da70810563afc0dac838e47ebab2efb79a841278048b01ee1ac8634019a +size 24618 diff --git a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[7]_largedevicesmallfonts.png b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[7]_largedevicesmallfonts.png index da32ebbd70..dc80b5110e 100644 --- a/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[7]_largedevicesmallfonts.png +++ b/sample/src/test/snapshots/images/com.google.android.horologist.screensizes_MediaPlayerLibraryTest_screenshot[7]_largedevicesmallfonts.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:468267394e43c2ad8bd484b196c06b7bb2d257fa688690332a30bdcbd5a6e30d -size 30389 +oid sha256:7b8cdddb71868ccc577accf031a3f3f08a16fd2fd6a84635f82dc6b47c4ac925 +size 27650