diff --git a/app/src/main/java/helium314/keyboard/settings/PrefScreen.kt b/app/src/main/java/helium314/keyboard/settings/PrefScreen.kt deleted file mode 100644 index 5be2f7ba5..000000000 --- a/app/src/main/java/helium314/keyboard/settings/PrefScreen.kt +++ /dev/null @@ -1,62 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-only -package helium314.keyboard.settings - -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.ColumnScope -import androidx.compose.foundation.layout.WindowInsets -import androidx.compose.foundation.layout.WindowInsetsSides -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.only -import androidx.compose.foundation.layout.safeDrawing -import androidx.compose.foundation.layout.windowInsetsPadding -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.LocalTextStyle -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar -import androidx.compose.material3.TopAppBarDefaults -import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider -import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource -import helium314.keyboard.latin.R - -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun PrefScreen( - onClickBack: () -> Unit, - title: String, - content: @Composable ColumnScope.() -> Unit -) { - Column(Modifier.fillMaxSize()) { - TopAppBar( - title = { Text(title) }, - windowInsets = TopAppBarDefaults.windowInsets, - navigationIcon = { - IconButton(onClick = onClickBack) { - Icon( - painterResource(R.drawable.ic_arrow_left), // see SearchScreen - stringResource(R.string.spoken_description_action_previous) - ) - } - }, - ) - CompositionLocalProvider(LocalTextStyle provides MaterialTheme.typography.bodyLarge) { - Column( - Modifier - .verticalScroll(rememberScrollState()) - .windowInsetsPadding( - WindowInsets.safeDrawing.only( - WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom - )) - ) { - content() - } - } - } -} diff --git a/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt b/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt index b09a83654..537d7448e 100644 --- a/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt +++ b/app/src/main/java/helium314/keyboard/settings/SettingsActivity.kt @@ -14,17 +14,20 @@ import kotlinx.coroutines.flow.MutableStateFlow // todo // make all prefs actually work +// PRs adding prefs -> need to do before continuing +// 1319 (soon) +// 1263 (no response for 3 weeks) +// merge main to implement all the new settings // consider IME insets when searching -// improve performance when loading screens with many settings (lazyColumn?) -// screens could have a lazy column of preferences and category separators, and the list has an if-setting-then-null for hiding -// lazyColumn also has the key, this should be used! and must be unique // consider that stuff in composables can get called quite often on any changes -> use remember for things that are slow (maybe add test logging) // dialogs should be rememberSaveable to survive display orientation change and stuff? // default buttons for toolbar key(s) customizer and toolbar reorder dialog -// merge main to implement all the new settings // later -// one single place for default values (in composables and settings) +// improve performance when loading screens with many settings (lazyColumn?) +// first check whether it's really necessary (test advanced or correction screen normal and with lazyColumn) +// screens could have a lazy column of preferences and category separators, and the list has an if-setting-then-null for hiding +// lazyColumn also has the key, this should be used! and must be unique // nice arrows (in top bar, and as next-screen indicator) // animations when stuff (dis)appears // LaunchedEffect, AnimatedVisibility @@ -57,6 +60,8 @@ import kotlinx.coroutines.flow.MutableStateFlow // language settings (separate commit / PR, should change more than just move to compose) // user dictionary settings (separate commit / PR, or maybe leave old state for a while?) // color settings (separate commit / PR, should at least change how colors are stored) +// one single place for default values (to be used in composables and settings) +// better a separate commit // maybe later // weird problem with app sometimes closing on back, but that's related to "old" settings (don't care if all are removed before next release)