From 6ec4d964883736be5a26cc4101439017b9882979 Mon Sep 17 00:00:00 2001 From: Gustavo Pagani Date: Tue, 13 Dec 2022 10:35:55 +0000 Subject: [PATCH] Fix order of columnState param --- auth-ui/api/current.api | 2 +- .../horologist/auth/ui/common/screens/SignInPromptScreen.kt | 6 +++--- .../google/android/horologist/composables/SectionedList.kt | 4 ++-- compose-layout/api/current.api | 2 +- .../horologist/compose/navscaffold/NavScaffoldTest.kt | 4 ++-- .../horologist/compose/layout/ScalingLazyColumnState.kt | 2 +- .../horologist/mediasample/ui/debug/AudioDebugScreen.kt | 4 ++-- .../horologist/mediasample/ui/debug/SamplesScreen.kt | 4 ++-- .../mediasample/ui/settings/DeveloperOptionsScreen.kt | 4 ++-- .../mediasample/ui/settings/UampSettingsScreen.kt | 4 ++-- .../horologist/media/ui/screens/entity/EntityScreen.kt | 4 ++-- .../googlesignin/prompt/GoogleSignInPromptSampleScreen.kt | 4 ++-- .../oauth/devicegrant/AuthDeviceGrantSignInPromptScreen.kt | 4 ++-- .../auth/oauth/pkce/AuthPKCESignInPromptScreen.kt | 4 ++-- .../android/horologist/datalayer/DataLayerNodesScreen.kt | 4 ++-- .../com/google/android/horologist/networks/NetworkScreen.kt | 4 ++-- .../com/google/android/horologist/paging/PagingScreen.kt | 4 ++-- .../java/com/google/android/horologist/sample/MenuScreen.kt | 4 ++-- 18 files changed, 34 insertions(+), 34 deletions(-) diff --git a/auth-ui/api/current.api b/auth-ui/api/current.api index 88633eaae0..29e5d7faf0 100644 --- a/auth-ui/api/current.api +++ b/auth-ui/api/current.api @@ -12,7 +12,7 @@ package com.google.android.horologist.auth.ui.common.screens { } public final class SignInPromptScreenKt { - method @androidx.compose.runtime.Composable @com.google.android.horologist.auth.ui.ExperimentalHorologistAuthUiApi public static void SignInPromptScreen(String message, kotlin.jvm.functions.Function0 onAlreadySignedIn, optional androidx.compose.ui.Modifier modifier, optional String title, optional com.google.android.horologist.auth.ui.common.screens.SignInPromptViewModel viewModel, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, kotlin.jvm.functions.Function1 content); + method @androidx.compose.runtime.Composable @com.google.android.horologist.auth.ui.ExperimentalHorologistAuthUiApi public static void SignInPromptScreen(String message, kotlin.jvm.functions.Function0 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.SignInPromptViewModel viewModel, kotlin.jvm.functions.Function1 content); } @com.google.android.horologist.auth.ui.ExperimentalHorologistAuthUiApi public abstract sealed class SignInPromptScreenState { diff --git a/auth-ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/SignInPromptScreen.kt b/auth-ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/SignInPromptScreen.kt index 2b709a62e0..7bd890d3f3 100644 --- a/auth-ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/SignInPromptScreen.kt +++ b/auth-ui/src/main/java/com/google/android/horologist/auth/ui/common/screens/SignInPromptScreen.kt @@ -41,10 +41,10 @@ import com.google.android.horologist.compose.layout.ScalingLazyColumnState public fun SignInPromptScreen( message: String, onAlreadySignedIn: () -> Unit, + columnState: ScalingLazyColumnState, modifier: Modifier = Modifier, title: String = stringResource(id = R.string.horologist_signin_prompt_title), viewModel: SignInPromptViewModel = viewModel(), - columnState: ScalingLazyColumnState, content: ScalingLazyListScope.() -> Unit ) { val state by viewModel.uiState.collectAsStateWithLifecycle() @@ -76,8 +76,8 @@ public fun SignInPromptScreen( SignInPromptScreenState.SignedOut -> { ScalingLazyColumn( - modifier = modifier, - columnState = columnState + columnState = columnState, + modifier = modifier ) { item { Title(text = title) } item { 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 3abdb5d083..adb7c0d8ab 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 @@ -62,9 +62,9 @@ public fun SectionedList( sections: List> = emptyList() ) { ScalingLazyColumn( + columnState = columnState, modifier = modifier - .fillMaxSize(), - columnState = columnState + .fillMaxSize() ) { sections.forEach { section -> section.display(this) diff --git a/compose-layout/api/current.api b/compose-layout/api/current.api index 3076084e1c..97c6b793a9 100644 --- a/compose-layout/api/current.api +++ b/compose-layout/api/current.api @@ -92,7 +92,7 @@ package com.google.android.horologist.compose.layout { } public final class ScalingLazyColumnStateKt { - method @androidx.compose.runtime.Composable public static void ScalingLazyColumn(optional androidx.compose.ui.Modifier modifier, com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, kotlin.jvm.functions.Function1 content); + method @androidx.compose.runtime.Composable public static void ScalingLazyColumn(com.google.android.horologist.compose.layout.ScalingLazyColumnState columnState, optional androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1 content); } public final class ScrollAwayKt { diff --git a/compose-layout/src/androidTest/java/com/google/android/horologist/compose/navscaffold/NavScaffoldTest.kt b/compose-layout/src/androidTest/java/com/google/android/horologist/compose/navscaffold/NavScaffoldTest.kt index f11b2950cc..52ea9b3279 100644 --- a/compose-layout/src/androidTest/java/com/google/android/horologist/compose/navscaffold/NavScaffoldTest.kt +++ b/compose-layout/src/androidTest/java/com/google/android/horologist/compose/navscaffold/NavScaffoldTest.kt @@ -165,8 +165,8 @@ class NavScaffoldTest { route = "a" ) { ScalingLazyColumn( - modifier = Modifier.testTag("columna"), - columnState = it.columnState + columnState = it.columnState, + modifier = Modifier.testTag("columna") ) { items(100) { Text("Item $it") diff --git a/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt index 9d734ae8fd..069a07d9cb 100644 --- a/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt +++ b/compose-layout/src/main/java/com/google/android/horologist/compose/layout/ScalingLazyColumnState.kt @@ -100,8 +100,8 @@ public class ScalingLazyColumnState( @Composable public fun ScalingLazyColumn( - modifier: Modifier = Modifier, columnState: ScalingLazyColumnState, + modifier: Modifier = Modifier, content: ScalingLazyListScope.() -> Unit ) { val focusRequester = rememberActiveFocusRequester() 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 bed79c6827..8d9d37d0f1 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 @@ -45,9 +45,9 @@ fun AudioDebugScreen( val uiState by audioDebugScreenViewModel.uiState.collectAsStateWithLifecycle() ScalingLazyColumn( + columnState = columnState, modifier = modifier - .fillMaxSize(), - columnState = columnState + .fillMaxSize() ) { item { Text( 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 461ed51975..c59f8524b8 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 @@ -44,9 +44,9 @@ fun SamplesScreen( val uiState by samplesScreenViewModel.uiState.collectAsStateWithLifecycle() ScalingLazyColumn( + columnState = columnState, modifier = modifier - .fillMaxSize(), - columnState = columnState + .fillMaxSize() ) { item { Text( 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 76f47b278a..f82db4db18 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 @@ -48,9 +48,9 @@ fun DeveloperOptionsScreen( val uiState by developerOptionsScreenViewModel.uiState.collectAsStateWithLifecycle() ScalingLazyColumn( + columnState = columnState, modifier = modifier - .fillMaxSize(), - columnState = columnState + .fillMaxSize() ) { item { Text( diff --git a/media-sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/UampSettingsScreen.kt b/media-sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/UampSettingsScreen.kt index 541a0f8102..a1e68b54b2 100644 --- a/media-sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/UampSettingsScreen.kt +++ b/media-sample/src/main/java/com/google/android/horologist/mediasample/ui/settings/UampSettingsScreen.kt @@ -50,9 +50,9 @@ fun UampSettingsScreen( modifier: Modifier = Modifier ) { ScalingLazyColumn( + columnState = columnState, modifier = modifier - .fillMaxSize(), - columnState = columnState + .fillMaxSize() ) { item { Text( 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 7f9ac2b177..426ef39217 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 @@ -40,9 +40,9 @@ public fun EntityScreen( content: (ScalingLazyListScope.() -> Unit)? = null ) { ScalingLazyColumn( + columnState = columnState, modifier = modifier - .fillMaxSize(), - columnState = columnState + .fillMaxSize() ) { item { headerContent() diff --git a/sample/src/main/java/com/google/android/horologist/auth/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt b/sample/src/main/java/com/google/android/horologist/auth/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt index 2b0519e5ba..2ca927c3f3 100644 --- a/sample/src/main/java/com/google/android/horologist/auth/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt +++ b/sample/src/main/java/com/google/android/horologist/auth/googlesignin/prompt/GoogleSignInPromptSampleScreen.kt @@ -44,9 +44,9 @@ fun GoogleSignInPromptSampleScreen( SignInPromptScreen( message = stringResource(id = R.string.google_sign_in_prompt_message), onAlreadySignedIn = { navController.popBackStack() }, + columnState = columnState, modifier = modifier, - viewModel = viewModel, - columnState = columnState + viewModel = viewModel ) { item { SignInChip( diff --git a/sample/src/main/java/com/google/android/horologist/auth/oauth/devicegrant/AuthDeviceGrantSignInPromptScreen.kt b/sample/src/main/java/com/google/android/horologist/auth/oauth/devicegrant/AuthDeviceGrantSignInPromptScreen.kt index d43450f20c..e352d2ecf3 100644 --- a/sample/src/main/java/com/google/android/horologist/auth/oauth/devicegrant/AuthDeviceGrantSignInPromptScreen.kt +++ b/sample/src/main/java/com/google/android/horologist/auth/oauth/devicegrant/AuthDeviceGrantSignInPromptScreen.kt @@ -43,9 +43,9 @@ fun AuthDeviceGrantSignInPromptScreen( SignInPromptScreen( message = stringResource(id = R.string.auth_device_grant_sign_in_prompt_message), onAlreadySignedIn = { navController.popBackStack() }, + columnState = columnState, modifier = modifier, - viewModel = viewModel, - columnState = columnState + viewModel = viewModel ) { item { SignInChip( diff --git a/sample/src/main/java/com/google/android/horologist/auth/oauth/pkce/AuthPKCESignInPromptScreen.kt b/sample/src/main/java/com/google/android/horologist/auth/oauth/pkce/AuthPKCESignInPromptScreen.kt index a8e1cbb5d3..8dcb81f335 100644 --- a/sample/src/main/java/com/google/android/horologist/auth/oauth/pkce/AuthPKCESignInPromptScreen.kt +++ b/sample/src/main/java/com/google/android/horologist/auth/oauth/pkce/AuthPKCESignInPromptScreen.kt @@ -43,9 +43,9 @@ fun AuthPKCESignInPromptScreen( SignInPromptScreen( message = stringResource(id = R.string.auth_pkce_sign_in_prompt_message), onAlreadySignedIn = { navController.popBackStack() }, + columnState = columnState, modifier = modifier, - viewModel = viewModel, - columnState = columnState + viewModel = viewModel ) { item { SignInChip( diff --git a/sample/src/main/java/com/google/android/horologist/datalayer/DataLayerNodesScreen.kt b/sample/src/main/java/com/google/android/horologist/datalayer/DataLayerNodesScreen.kt index 1c0a799395..c29bc1a27e 100644 --- a/sample/src/main/java/com/google/android/horologist/datalayer/DataLayerNodesScreen.kt +++ b/sample/src/main/java/com/google/android/horologist/datalayer/DataLayerNodesScreen.kt @@ -37,8 +37,8 @@ fun DataLayerNodesScreen( val state by viewModel.state.collectAsStateWithLifecycle() ScalingLazyColumn( - modifier = modifier, - columnState = columnState + columnState = columnState, + modifier = modifier ) { item { ListHeader { diff --git a/sample/src/main/java/com/google/android/horologist/networks/NetworkScreen.kt b/sample/src/main/java/com/google/android/horologist/networks/NetworkScreen.kt index 5d6bf692ff..ac82f4c7d7 100644 --- a/sample/src/main/java/com/google/android/horologist/networks/NetworkScreen.kt +++ b/sample/src/main/java/com/google/android/horologist/networks/NetworkScreen.kt @@ -38,8 +38,8 @@ fun NetworkScreen( val uiState by viewModel.state.collectAsStateWithLifecycle() ScalingLazyColumn( - modifier = Modifier.fillMaxSize(), - columnState = columnState + columnState = columnState, + modifier = Modifier.fillMaxSize() ) { item { Chip( diff --git a/sample/src/main/java/com/google/android/horologist/paging/PagingScreen.kt b/sample/src/main/java/com/google/android/horologist/paging/PagingScreen.kt index 88a027c05a..b9c5ab48e3 100644 --- a/sample/src/main/java/com/google/android/horologist/paging/PagingScreen.kt +++ b/sample/src/main/java/com/google/android/horologist/paging/PagingScreen.kt @@ -75,8 +75,8 @@ fun PagingScreen( val lazyPagingItems = pager.flow.collectAsLazyPagingItems() ScalingLazyColumn( - modifier = modifier, - columnState = columnState + columnState = columnState, + modifier = modifier ) { if (lazyPagingItems.loadState.refresh == LoadState.Loading) { items(10) { diff --git a/sample/src/main/java/com/google/android/horologist/sample/MenuScreen.kt b/sample/src/main/java/com/google/android/horologist/sample/MenuScreen.kt index e609404bb4..c4dc752d90 100644 --- a/sample/src/main/java/com/google/android/horologist/sample/MenuScreen.kt +++ b/sample/src/main/java/com/google/android/horologist/sample/MenuScreen.kt @@ -46,8 +46,8 @@ fun MenuScreen( columnState: ScalingLazyColumnState ) { ScalingLazyColumn( - modifier = modifier, - columnState = columnState + columnState = columnState, + modifier = modifier ) { item { ListHeader {