mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-15 06:22:45 +00:00
load the correct file when editing symbols layouts, fixes #407
This commit is contained in:
parent
095946738e
commit
3b48e49067
1 changed files with 6 additions and 6 deletions
|
@ -98,15 +98,15 @@ class AdvancedSettingsFragment : SubScreenFragment() {
|
|||
findPreference<Preference>("pref_backup_restore")?.setOnPreferenceClickListener { showBackupRestoreDialog() }
|
||||
|
||||
findPreference<Preference>("custom_symbols_layout")?.setOnPreferenceClickListener {
|
||||
val file = "${CUSTOM_LAYOUT_PREFIX}symbols.txt"
|
||||
val oldLayout = if (File(file).exists()) null else context.assets.open("layouts${File.separator}symbols.txt").reader().readText()
|
||||
editCustomLayout(file, context, oldLayout, true)
|
||||
val layoutName = Settings.readSymbolsLayoutName(context, context.resources.configuration.locale).takeIf { it.startsWith(CUSTOM_LAYOUT_PREFIX) }
|
||||
val oldLayout = if (layoutName != null) null else context.assets.open("layouts${File.separator}symbols.txt").reader().readText()
|
||||
editCustomLayout(layoutName ?: "${CUSTOM_LAYOUT_PREFIX}symbols.txt", context, oldLayout, true)
|
||||
true
|
||||
}
|
||||
findPreference<Preference>("custom_shift_symbols_layout")?.setOnPreferenceClickListener {
|
||||
val file = "${CUSTOM_LAYOUT_PREFIX}shift_symbols.txt"
|
||||
val oldLayout = if (File(file).exists()) null else context.assets.open("layouts${File.separator}symbols_shifted.txt").reader().readText()
|
||||
editCustomLayout(file, context, oldLayout, true)
|
||||
val layoutName = Settings.readShiftedSymbolsLayoutName(context).takeIf { it.startsWith(CUSTOM_LAYOUT_PREFIX) }
|
||||
val oldLayout = if (layoutName != null) null else context.assets.open("layouts${File.separator}symbols_shifted.txt").reader().readText()
|
||||
editCustomLayout(layoutName ?: "${CUSTOM_LAYOUT_PREFIX}shift_symbols.txt", context, oldLayout, true)
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue