diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ccdd1554..71034ebfe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - [FIX] Paddings for update button - [FIX] Crash on app startup with WearOS app - [FIX] Expand verify signal bottom sheet only after signal is dispatched +- [FIX] Fix scroll on save edit screen - [CI] Add https://github.com/LionZXY/detekt-decompose-rule - [CI] Enabling detekt module for android and kmp modules - [CI] Bump target SDK to 34 diff --git a/components/keyedit/impl/src/main/java/com/flipperdevices/keyedit/impl/composable/ComposableEditScreen.kt b/components/keyedit/impl/src/main/java/com/flipperdevices/keyedit/impl/composable/ComposableEditScreen.kt index 2f4a9058e6..d22a525776 100644 --- a/components/keyedit/impl/src/main/java/com/flipperdevices/keyedit/impl/composable/ComposableEditScreen.kt +++ b/components/keyedit/impl/src/main/java/com/flipperdevices/keyedit/impl/composable/ComposableEditScreen.kt @@ -3,6 +3,8 @@ package com.flipperdevices.keyedit.impl.composable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material.CircularProgressIndicator import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -22,6 +24,7 @@ fun ComposableEditScreen( when (state) { KeyEditState.Loading, is KeyEditState.Saving -> ComposableEditScreenLoading() + is KeyEditState.Editing -> ComposableEditScreenEditing( onNameChange = onNameChange, onNoteChange = onNoteChange, @@ -30,6 +33,7 @@ fun ComposableEditScreen( onCancel = onBack, onSave = onSave ) + KeyEditState.Failed -> onBack() } } @@ -51,14 +55,18 @@ private fun ComposableEditScreenEditing( title: String?, state: KeyEditState.Editing, onCancel: () -> Unit, - onSave: () -> Unit + onSave: () -> Unit, + modifier: Modifier = Modifier ) { val buttonState = if (state.savingKeyActive) { SaveButtonState.ENABLED } else { SaveButtonState.DISABLED } - Column { + Column( + modifier = modifier + .verticalScroll(rememberScrollState()) + ) { ComposableEditAppBar( title = title, saveButtonState = buttonState, diff --git a/components/share/receive/src/main/java/com/flipperdevices/share/receive/composable/screens/ComposableKeySaveScreen.kt b/components/share/receive/src/main/java/com/flipperdevices/share/receive/composable/screens/ComposableKeySaveScreen.kt index 37d4000a96..0de211a79b 100644 --- a/components/share/receive/src/main/java/com/flipperdevices/share/receive/composable/screens/ComposableKeySaveScreen.kt +++ b/components/share/receive/src/main/java/com/flipperdevices/share/receive/composable/screens/ComposableKeySaveScreen.kt @@ -4,6 +4,8 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material.CircularProgressIndicator import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -26,10 +28,15 @@ fun ComposableKeySaveScreen( onCancel: () -> Unit, modifier: Modifier = Modifier, ) { - Column(modifier) { + Column( + modifier + ) { ComposableKeySaveBar(onCancel) keyScreenApi.KeyCard( - modifier = Modifier.padding(start = 24.dp, end = 24.dp, bottom = 24.dp), + modifier = Modifier + .weight(1f) + .verticalScroll(rememberScrollState()) + .padding(start = 24.dp, end = 24.dp, bottom = 12.dp), key = keyParsed, deleted = false ) @@ -44,7 +51,9 @@ fun ComposableKeySaveScreen( } } else { ComposableFlipperButton( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier + .fillMaxWidth() + .padding(top = 12.dp, bottom = 24.dp), text = stringResource(R.string.receive_save_btn), onClick = onSave )