Skip to content

Commit

Permalink
Make PreferencesScreen scrollable (fixes #190)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinokuni committed Aug 30, 2024
1 parent be865aa commit 017fe40
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import android.os.PowerManager
import android.provider.Settings
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.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.ExperimentalMaterial3Api
Expand Down Expand Up @@ -50,6 +53,7 @@ class PreferencesScreen : AndroidScreen() {
val context = LocalContext.current
val screenModel = getScreenModel<PreferencesScreenModel>()

val scrollState = rememberScrollState()
val coroutineScope = rememberCoroutineScope()
val snackbarHostState = remember { SnackbarHostState() }

Expand Down Expand Up @@ -84,7 +88,12 @@ class PreferencesScreen : AndroidScreen() {
else -> {
val loadedState = (state as PreferencesScreenState.Loaded)

Column {
// a lazyColumn might be necessary in the future
Column(
modifier = Modifier
.fillMaxWidth()
.verticalScroll(scrollState)
) {
PreferenceHeader(text = stringResource(id = R.string.global))

ListPreferenceWidget(
Expand Down

0 comments on commit 017fe40

Please sign in to comment.