mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-26 02:50:58 +00:00
reload enabled subtypes on settings restore
This commit is contained in:
parent
2020db2e63
commit
b714fc6566
2 changed files with 8 additions and 0 deletions
|
@ -36,6 +36,7 @@ import org.dslul.openboard.inputmethod.latin.utils.CUSTOM_LAYOUT_PREFIX
|
|||
import org.dslul.openboard.inputmethod.latin.utils.JniUtils
|
||||
import org.dslul.openboard.inputmethod.latin.utils.editCustomLayout
|
||||
import org.dslul.openboard.inputmethod.latin.utils.infoDialog
|
||||
import org.dslul.openboard.inputmethod.latin.utils.reloadEnabledSubtypes
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.io.FileOutputStream
|
||||
|
@ -324,6 +325,7 @@ class AdvancedSettingsFragment : SubScreenFragment() {
|
|||
}
|
||||
}
|
||||
checkVersionUpgrade(requireContext())
|
||||
reloadEnabledSubtypes(requireContext())
|
||||
val newDictBroadcast = Intent(DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION)
|
||||
activity?.sendBroadcast(newDictBroadcast)
|
||||
// reload current prefs screen
|
||||
|
|
|
@ -151,6 +151,12 @@ fun getAvailableSubtypeLocales(): Collection<Locale> {
|
|||
return resourceSubtypesByLocale.keys
|
||||
}
|
||||
|
||||
fun reloadEnabledSubtypes(context: Context) {
|
||||
require(initialized)
|
||||
enabledSubtypes.clear()
|
||||
loadEnabledSubtypes(context)
|
||||
}
|
||||
|
||||
fun init(context: Context) {
|
||||
if (initialized) return
|
||||
SubtypeLocaleUtils.init(context) // necessary to get the correct getKeyboardLayoutSetName
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue