Inline the scroll state.

This commit is contained in:
Benoit Marty 2023-06-09 18:09:09 +02:00
parent 4fa30f384d
commit f8a16f2ea3
4 changed files with 4 additions and 18 deletions

View file

@ -63,8 +63,6 @@ fun ChangeAccountProviderView(
onOtherProviderClicked: () -> Unit, onOtherProviderClicked: () -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val scrollState = rememberScrollState()
Scaffold( Scaffold(
modifier = modifier, modifier = modifier,
topBar = { topBar = {
@ -83,9 +81,7 @@ fun ChangeAccountProviderView(
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
.verticalScroll( .verticalScroll(state = rememberScrollState())
state = scrollState,
)
) { ) {
IconTitleSubtitleMolecule( IconTitleSubtitleMolecule(
modifier = Modifier.padding(top = 16.dp, bottom = 32.dp, start = 16.dp, end = 16.dp), modifier = Modifier.padding(top = 16.dp, bottom = 32.dp, start = 16.dp, end = 16.dp),

View file

@ -81,8 +81,6 @@ fun SearchAccountProviderView(
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val eventSink = state.eventSink val eventSink = state.eventSink
val scrollState = rememberScrollState()
Scaffold( Scaffold(
modifier = modifier, modifier = modifier,
topBar = { topBar = {
@ -101,9 +99,7 @@ fun SearchAccountProviderView(
) { ) {
Column( Column(
modifier = Modifier modifier = Modifier
.verticalScroll( .verticalScroll(state = rememberScrollState())
state = scrollState,
)
) { ) {
IconTitleSubtitleMolecule( IconTitleSubtitleMolecule(
modifier = Modifier.padding(top = 16.dp, bottom = 40.dp, start = 16.dp, end = 16.dp), modifier = Modifier.padding(top = 16.dp, bottom = 40.dp, start = 16.dp, end = 16.dp),

View file

@ -81,12 +81,9 @@ fun BugReportView(
.systemBarsPadding() .systemBarsPadding()
.imePadding() .imePadding()
) { ) {
val scrollState = rememberScrollState()
Column( Column(
modifier = Modifier modifier = Modifier
.verticalScroll( .verticalScroll(state = rememberScrollState())
state = scrollState,
)
.padding(horizontal = 16.dp), .padding(horizontal = 16.dp),
) { ) {
val isError = state.sending is Async.Failure val isError = state.sending is Async.Failure

View file

@ -68,14 +68,11 @@ fun PreferenceView(
) )
}, },
content = { content = {
val scrollState = rememberScrollState()
Column( Column(
modifier = Modifier modifier = Modifier
.padding(it) .padding(it)
.consumeWindowInsets(it) .consumeWindowInsets(it)
.verticalScroll( .verticalScroll(state = rememberScrollState())
state = scrollState,
)
) { ) {
content() content()
} }