mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-06 23:00:15 +00:00
remove some outdated todos
This commit is contained in:
parent
9ff5fda8ed
commit
adc5c8cf1c
5 changed files with 7 additions and 14 deletions
|
@ -75,9 +75,6 @@ object SettingsWithoutKey {
|
||||||
const val HIDDEN_FEATURES = "hidden_features"
|
const val HIDDEN_FEATURES = "hidden_features"
|
||||||
const val GITHUB = "github"
|
const val GITHUB = "github"
|
||||||
const val SAVE_LOG = "save_log"
|
const val SAVE_LOG = "save_log"
|
||||||
const val CUSTOM_KEY_CODES = "customize_key_codes"
|
|
||||||
// const val CUSTOM_SYMBOLS_NUMBER_LAYOUTS = "custom_symbols_number_layouts"
|
|
||||||
// const val CUSTOM_FUNCTIONAL_LAYOUTS = "custom_functional_key_layouts"
|
|
||||||
const val BACKUP_RESTORE = "backup_restore"
|
const val BACKUP_RESTORE = "backup_restore"
|
||||||
const val DEBUG_SETTINGS = "screen_debug"
|
const val DEBUG_SETTINGS = "screen_debug"
|
||||||
const val LOAD_GESTURE_LIB = "load_gesture_library"
|
const val LOAD_GESTURE_LIB = "load_gesture_library"
|
||||||
|
|
|
@ -44,7 +44,6 @@ import helium314.keyboard.latin.utils.Log
|
||||||
import helium314.keyboard.latin.utils.SubtypeSettings
|
import helium314.keyboard.latin.utils.SubtypeSettings
|
||||||
import helium314.keyboard.latin.utils.getActivity
|
import helium314.keyboard.latin.utils.getActivity
|
||||||
import helium314.keyboard.latin.utils.getStringResourceOrName
|
import helium314.keyboard.latin.utils.getStringResourceOrName
|
||||||
import helium314.keyboard.latin.utils.mainLayoutName
|
|
||||||
import helium314.keyboard.latin.utils.prefs
|
import helium314.keyboard.latin.utils.prefs
|
||||||
import helium314.keyboard.settings.Setting
|
import helium314.keyboard.settings.Setting
|
||||||
import helium314.keyboard.settings.SettingsActivity
|
import helium314.keyboard.settings.SettingsActivity
|
||||||
|
@ -52,9 +51,6 @@ import helium314.keyboard.settings.keyboardNeedsReload
|
||||||
import helium314.keyboard.settings.layoutFilePicker
|
import helium314.keyboard.settings.layoutFilePicker
|
||||||
import helium314.keyboard.settings.layoutIntent
|
import helium314.keyboard.settings.layoutIntent
|
||||||
|
|
||||||
// modified copy of ColorPickerDialog, later check whether stuff can be re-used
|
|
||||||
// todo:
|
|
||||||
// call SubtypeSettings.onRenameLayout on rename!
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LayoutPickerDialog(
|
fun LayoutPickerDialog(
|
||||||
onDismissRequest: () -> Unit,
|
onDismissRequest: () -> Unit,
|
||||||
|
|
|
@ -38,6 +38,7 @@ import helium314.keyboard.settings.screens.GetIcon
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ToolbarKeysCustomizer(
|
fun ToolbarKeysCustomizer(
|
||||||
|
key: String,
|
||||||
onDismissRequest: () -> Unit
|
onDismissRequest: () -> Unit
|
||||||
) {
|
) {
|
||||||
val ctx = LocalContext.current
|
val ctx = LocalContext.current
|
||||||
|
@ -79,7 +80,7 @@ fun ToolbarKeysCustomizer(
|
||||||
onConfirmed = {
|
onConfirmed = {
|
||||||
showDeletePrefConfirmDialog = false
|
showDeletePrefConfirmDialog = false
|
||||||
onDismissRequest()
|
onDismissRequest()
|
||||||
prefs.edit().remove(Settings.PREF_TOOLBAR_CUSTOM_KEY_CODES).apply()
|
prefs.edit().remove(key).apply()
|
||||||
},
|
},
|
||||||
text = { Text(stringResource(R.string.customize_toolbar_key_code_reset_message)) }
|
text = { Text(stringResource(R.string.customize_toolbar_key_code_reset_message)) }
|
||||||
)
|
)
|
||||||
|
@ -149,7 +150,7 @@ fun PreviewToolbarKeyCustomizer() {
|
||||||
fun PreviewToolbarKeysCustomizer() {
|
fun PreviewToolbarKeysCustomizer() {
|
||||||
Settings.init(LocalContext.current)
|
Settings.init(LocalContext.current)
|
||||||
KeyboardIconsSet.instance.loadIcons(LocalContext.current)
|
KeyboardIconsSet.instance.loadIcons(LocalContext.current)
|
||||||
ToolbarKeysCustomizer { }
|
ToolbarKeysCustomizer("") { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkCode(code: TextFieldValue) = runCatching {
|
private fun checkCode(code: TextFieldValue) = runCatching {
|
||||||
|
|
|
@ -108,11 +108,10 @@ fun LanguageScreen(
|
||||||
SubtypeDialog(
|
SubtypeDialog(
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
selectedSubtype = null
|
selectedSubtype = null
|
||||||
sortedSubtypes = getSortedSubtypes(ctx) // todo: not good, only necessary when a main layout is deleted
|
sortedSubtypes = getSortedSubtypes(ctx)
|
||||||
},
|
},
|
||||||
onConfirmed = {
|
onConfirmed = {
|
||||||
SubtypeUtilsAdditional.changeAdditionalSubtype(oldSubtype.toSettingsSubtype(), it, ctx)
|
SubtypeUtilsAdditional.changeAdditionalSubtype(oldSubtype.toSettingsSubtype(), it, ctx)
|
||||||
sortedSubtypes = getSortedSubtypes(ctx)
|
|
||||||
},
|
},
|
||||||
subtype = oldSubtype
|
subtype = oldSubtype
|
||||||
)
|
)
|
||||||
|
|
|
@ -47,7 +47,7 @@ fun ToolbarScreen(
|
||||||
Settings.PREF_TOOLBAR_KEYS,
|
Settings.PREF_TOOLBAR_KEYS,
|
||||||
Settings.PREF_PINNED_TOOLBAR_KEYS,
|
Settings.PREF_PINNED_TOOLBAR_KEYS,
|
||||||
Settings.PREF_CLIPBOARD_TOOLBAR_KEYS,
|
Settings.PREF_CLIPBOARD_TOOLBAR_KEYS,
|
||||||
SettingsWithoutKey.CUSTOM_KEY_CODES,
|
Settings.PREF_TOOLBAR_CUSTOM_KEY_CODES,
|
||||||
Settings.PREF_QUICK_PIN_TOOLBAR_KEYS,
|
Settings.PREF_QUICK_PIN_TOOLBAR_KEYS,
|
||||||
Settings.PREF_AUTO_SHOW_TOOLBAR,
|
Settings.PREF_AUTO_SHOW_TOOLBAR,
|
||||||
Settings.PREF_AUTO_HIDE_TOOLBAR,
|
Settings.PREF_AUTO_HIDE_TOOLBAR,
|
||||||
|
@ -70,15 +70,15 @@ fun createToolbarSettings(context: Context) = listOf(
|
||||||
Setting(context, Settings.PREF_CLIPBOARD_TOOLBAR_KEYS, R.string.clipboard_toolbar_keys) {
|
Setting(context, Settings.PREF_CLIPBOARD_TOOLBAR_KEYS, R.string.clipboard_toolbar_keys) {
|
||||||
ReorderSwitchPreference(it, Defaults.PREF_CLIPBOARD_TOOLBAR_KEYS)
|
ReorderSwitchPreference(it, Defaults.PREF_CLIPBOARD_TOOLBAR_KEYS)
|
||||||
},
|
},
|
||||||
Setting(context, SettingsWithoutKey.CUSTOM_KEY_CODES, R.string.customize_toolbar_key_codes) {
|
Setting(context, Settings.PREF_TOOLBAR_CUSTOM_KEY_CODES, R.string.customize_toolbar_key_codes) {
|
||||||
var showDialog by rememberSaveable { mutableStateOf(false) }
|
var showDialog by rememberSaveable { mutableStateOf(false) }
|
||||||
Preference(
|
Preference(
|
||||||
name = it.title,
|
name = it.title,
|
||||||
onClick = { showDialog = true },
|
onClick = { showDialog = true },
|
||||||
)
|
)
|
||||||
if (showDialog)
|
if (showDialog)
|
||||||
// todo (later): CUSTOM_KEY_CODES vs the 2 actual prefs that are changed...
|
|
||||||
ToolbarKeysCustomizer(
|
ToolbarKeysCustomizer(
|
||||||
|
key = it.key,
|
||||||
onDismissRequest = { showDialog = false }
|
onDismissRequest = { showDialog = false }
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue