Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of columnState param #830

Merged
merged 1 commit into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion auth-ui/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -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<kotlin.Unit> 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<? super androidx.wear.compose.material.ScalingLazyListScope,kotlin.Unit> content);
method @androidx.compose.runtime.Composable @com.google.android.horologist.auth.ui.ExperimentalHorologistAuthUiApi public static void SignInPromptScreen(String message, kotlin.jvm.functions.Function0<kotlin.Unit> 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<? super androidx.wear.compose.material.ScalingLazyListScope,kotlin.Unit> content);
}

@com.google.android.horologist.auth.ui.ExperimentalHorologistAuthUiApi public abstract sealed class SignInPromptScreenState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -76,8 +76,8 @@ public fun SignInPromptScreen(

SignInPromptScreenState.SignedOut -> {
ScalingLazyColumn(
modifier = modifier,
columnState = columnState
columnState = columnState,
modifier = modifier
) {
item { Title(text = title) }
item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public fun SectionedList(
sections: List<Section<*>> = emptyList()
) {
ScalingLazyColumn(
columnState = columnState,
modifier = modifier
.fillMaxSize(),
columnState = columnState
.fillMaxSize()
) {
sections.forEach { section ->
section.display(this)
Expand Down
2 changes: 1 addition & 1 deletion compose-layout/api/current.api
Original file line number Diff line number Diff line change
Expand Up @@ -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<? super androidx.wear.compose.material.ScalingLazyListScope,kotlin.Unit> 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<? super androidx.wear.compose.material.ScalingLazyListScope,kotlin.Unit> content);
}

public final class ScrollAwayKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public class ScalingLazyColumnState(

@Composable
public fun ScalingLazyColumn(
modifier: Modifier = Modifier,
columnState: ScalingLazyColumnState,
modifier: Modifier = Modifier,
Copy link
Member Author

@luizgrp luizgrp Dec 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yschimke are you happy with this change? highlighting it as this composable is not marked as experimental

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably should be. Can you add?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will add in another PR as I have another branch chained to this one

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are loads of classes in compose-layout without the experimental annotation. Should I apply it to all or just this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content: ScalingLazyListScope.() -> Unit
) {
val focusRequester = rememberActiveFocusRequester()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ fun AudioDebugScreen(
val uiState by audioDebugScreenViewModel.uiState.collectAsStateWithLifecycle()

ScalingLazyColumn(
columnState = columnState,
modifier = modifier
.fillMaxSize(),
columnState = columnState
.fillMaxSize()
) {
item {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ fun SamplesScreen(
val uiState by samplesScreenViewModel.uiState.collectAsStateWithLifecycle()

ScalingLazyColumn(
columnState = columnState,
modifier = modifier
.fillMaxSize(),
columnState = columnState
.fillMaxSize()
) {
item {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ fun DeveloperOptionsScreen(
val uiState by developerOptionsScreenViewModel.uiState.collectAsStateWithLifecycle()

ScalingLazyColumn(
columnState = columnState,
modifier = modifier
.fillMaxSize(),
columnState = columnState
.fillMaxSize()
) {
item {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ fun UampSettingsScreen(
modifier: Modifier = Modifier
) {
ScalingLazyColumn(
columnState = columnState,
modifier = modifier
.fillMaxSize(),
columnState = columnState
.fillMaxSize()
) {
item {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public fun EntityScreen(
content: (ScalingLazyListScope.() -> Unit)? = null
) {
ScalingLazyColumn(
columnState = columnState,
modifier = modifier
.fillMaxSize(),
columnState = columnState
.fillMaxSize()
) {
item {
headerContent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ fun DataLayerNodesScreen(
val state by viewModel.state.collectAsStateWithLifecycle()

ScalingLazyColumn(
modifier = modifier,
columnState = columnState
columnState = columnState,
modifier = modifier
) {
item {
ListHeader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ fun MenuScreen(
columnState: ScalingLazyColumnState
) {
ScalingLazyColumn(
modifier = modifier,
columnState = columnState
columnState = columnState,
modifier = modifier
) {
item {
ListHeader {
Expand Down