diff --git a/app/src/main/java/org/pocketworkstation/pckeyboard/BinaryDictionary.kt b/app/src/main/java/org/pocketworkstation/pckeyboard/BinaryDictionary.kt index 8dbed9cd..f933fe69 100644 --- a/app/src/main/java/org/pocketworkstation/pckeyboard/BinaryDictionary.kt +++ b/app/src/main/java/org/pocketworkstation/pckeyboard/BinaryDictionary.kt @@ -220,8 +220,8 @@ class BinaryDictionary : Dictionary, AutoCloseable { min(alternatives.size, MAX_ALTERNATIVES) ) } - Arrays.fill(mOutputChars, 0.toChar()) - Arrays.fill(mFrequencies, 0) + mOutputChars.fill(0.toChar()) + mFrequencies.fill(0) if (mNativeDict == 0L) return diff --git a/app/src/main/java/org/pocketworkstation/pckeyboard/LatinIMESettings.kt b/app/src/main/java/org/pocketworkstation/pckeyboard/LatinIMESettings.kt index 6151b35b..5935b3a3 100644 --- a/app/src/main/java/org/pocketworkstation/pckeyboard/LatinIMESettings.kt +++ b/app/src/main/java/org/pocketworkstation/pckeyboard/LatinIMESettings.kt @@ -95,6 +95,7 @@ class LatinIMESettings : FragmentActivity(), OnSharedPreferenceChangeListener, override fun onResume() { super.onResume() + init() val autoTextSize = AutoText.getSize(fragment.listView) if (autoTextSize < 1) { (fragment.findPreference(PREDICTION_SETTINGS_KEY) as PreferenceGroup?)!!.removePreference( @@ -150,6 +151,7 @@ class LatinIMESettings : FragmentActivity(), OnSharedPreferenceChangeListener, } override fun onSharedPreferenceChanged(prefs: SharedPreferences, key: String?) { + init() BackupManager(this).dataChanged() // If turning on voice input, show dialog if (key == VOICE_SETTINGS_KEY && !mVoiceOn) { @@ -163,6 +165,7 @@ class LatinIMESettings : FragmentActivity(), OnSharedPreferenceChangeListener, } private fun updateSummaries() { + init() val res = resources mSettingsKeyPreference!!.setSummary( res.getStringArray(R.array.settings_key_modes)[mSettingsKeyPreference!!.findIndexOfValue( @@ -178,11 +181,13 @@ class LatinIMESettings : FragmentActivity(), OnSharedPreferenceChangeListener, } private fun showVoiceConfirmation() { + init() mOkClicked = false showDialog(VOICE_INPUT_CONFIRM_DIALOG) } private fun updateVoiceModeSummary() { + init() mVoicePreference!!.setSummary( resources.getStringArray(R.array.voice_input_modes_summary)[mVoicePreference!!.findIndexOfValue( mVoicePreference!!.value diff --git a/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreference.kt b/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreference.kt index 22fe3f2b..62569613 100644 --- a/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreference.kt +++ b/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreference.kt @@ -49,7 +49,7 @@ open class SeekBarPreference(context: Context, attrs: AttributeSet?) : } @Deprecated("Deprecated in Java") - override fun onSetInitialValue(restorePersistedValue: Boolean, defaultValue: Any) { + override fun onSetInitialValue(restorePersistedValue: Boolean, defaultValue: Any?) { if (restorePersistedValue) { setVal(getPersistedFloat(0.0f)) } else { diff --git a/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreferenceString.kt b/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreferenceString.kt index 21ae34ea..4ce78c8d 100644 --- a/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreferenceString.kt +++ b/app/src/main/java/org/pocketworkstation/pckeyboard/SeekBarPreferenceString.kt @@ -34,7 +34,7 @@ open class SeekBarPreferenceString(context: Context, attrs: AttributeSet?) : } @Deprecated("Deprecated in Java") - override fun onSetInitialValue(restorePersistedValue: Boolean, defaultValue: Any) { + override fun onSetInitialValue(restorePersistedValue: Boolean, defaultValue: Any?) { if (restorePersistedValue) { setVal(floatFromString(getPersistedString("0.0"))) } else { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ae043278..f9d37b8e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -306,6 +306,8 @@ Automatically press enter when searching or going to the next field. + Open the keyboard\n\n + Close the keyboard\n\nPress the Back key.