misc improvements, update todo

This commit is contained in:
Helium314 2023-12-10 15:52:10 +01:00
parent f471cf81ed
commit c5f3d4bfcf
4 changed files with 15 additions and 11 deletions

View file

@ -67,10 +67,7 @@ open class KeyboardBuilder<KP : KeyboardParams>(protected val mContext: Context,
return this return this
// todo: further plan // todo: further plan
// make split layout work for emoji keyboard // re-check the LayoutInfos, they should really to the right things!
// more settings for localized number row, so it can be different in shift or symbols
// setting which moreKeys to prefer (default: symbol or important language, always symbol, always language)
// setting whether to show duplicate moreKeys (describe properly what it actually does)
// some keyboard_layout_set have supportedScript that is enum synced with script id in ScriptUtils // some keyboard_layout_set have supportedScript that is enum synced with script id in ScriptUtils
// that's one more reason for using language tags... // that's one more reason for using language tags...
// currently it's still read from xml outside the keyboard parser, but should still go to some other place // currently it's still read from xml outside the keyboard parser, but should still go to some other place
@ -106,7 +103,7 @@ open class KeyboardBuilder<KP : KeyboardParams>(protected val mContext: Context,
// allow users to import layouts, which essentially just fills the text from a file // allow users to import layouts, which essentially just fills the text from a file
// add setting to use moreKeys from symbol layout (always, never, only if none defined) // add setting to use moreKeys from symbol layout (always, never, only if none defined)
// should also have sth related to hint, because hint and start morekey maybe should stay // should also have sth related to hint, because hint and start morekey maybe should stay
// option to add extra keys for all layouts? // option to add language extra keys for all layouts?
// labelFlags should be set correctly // labelFlags should be set correctly
// alignHintLabelToBottom: on lxx and rounded themes, but did not find what it actually does... // alignHintLabelToBottom: on lxx and rounded themes, but did not find what it actually does...

View file

@ -876,7 +876,7 @@ public final class InputLogic {
|| mWordComposer.isComposingWord() // emoji will be part of the word in this case, better do nothing || mWordComposer.isComposingWord() // emoji will be part of the word in this case, better do nothing
|| !settingsValues.mBigramPredictionEnabled // this is only for next word suggestions, so they need to be enabled || !settingsValues.mBigramPredictionEnabled // this is only for next word suggestions, so they need to be enabled
|| settingsValues.mIncognitoModeEnabled || settingsValues.mIncognitoModeEnabled
|| settingsValues.mInputAttributes.mInputTypeNoAutoCorrect // see comment in performAdditionToUserHistoryDictionary || settingsValues.mInputAttributes.mShouldShowSuggestions // see comment in performAdditionToUserHistoryDictionary
|| !StringUtilsKt.isEmoji(text) || !StringUtilsKt.isEmoji(text)
) return; ) return;
if (mConnection.hasSlowInputConnection()) { if (mConnection.hasSlowInputConnection()) {
@ -1556,7 +1556,8 @@ public final class InputLogic {
// If correction is not enabled, we don't add words to the user history dictionary. // If correction is not enabled, we don't add words to the user history dictionary.
// That's to avoid unintended additions in some sensitive fields, or fields that // That's to avoid unintended additions in some sensitive fields, or fields that
// expect to receive non-words. // expect to receive non-words.
if (settingsValues.mInputAttributes.mInputTypeNoAutoCorrect || settingsValues.mIncognitoModeEnabled) // mInputTypeNoAutoCorrect changed to !mShouldShowSuggestions because this was cancelling learning way too often
if (!settingsValues.mInputAttributes.mShouldShowSuggestions || settingsValues.mIncognitoModeEnabled)
return; return;
if (mConnection.hasSlowInputConnection()) { if (mConnection.hasSlowInputConnection()) {
// Since we don't unlearn when the user backspaces on a slow InputConnection, // Since we don't unlearn when the user backspaces on a slow InputConnection,

View file

@ -56,6 +56,7 @@ public final class DebugSettingsFragment extends SubScreenFragment
mServiceNeedsRestart = false; mServiceNeedsRestart = false;
mDebugMode = findPreference(DebugSettings.PREF_DEBUG_MODE); mDebugMode = findPreference(DebugSettings.PREF_DEBUG_MODE);
findPreference(DebugSettings.PREF_SHOW_SUGGESTION_INFOS).setVisible(mDebugMode.isChecked());
updateDebugMode(); updateDebugMode();
} }
@ -95,7 +96,9 @@ public final class DebugSettingsFragment extends SubScreenFragment
@Override @Override
public void onSharedPreferenceChanged(final SharedPreferences prefs, final String key) { public void onSharedPreferenceChanged(final SharedPreferences prefs, final String key) {
if (key.equals(DebugSettings.PREF_DEBUG_MODE) && mDebugMode != null) { if (key.equals(DebugSettings.PREF_DEBUG_MODE) && mDebugMode != null) {
mDebugMode.setChecked(prefs.getBoolean(DebugSettings.PREF_DEBUG_MODE, false)); final boolean enabled = prefs.getBoolean(DebugSettings.PREF_DEBUG_MODE, false);
mDebugMode.setChecked(enabled);
findPreference(DebugSettings.PREF_SHOW_SUGGESTION_INFOS).setVisible(enabled);
mServiceNeedsRestart = true; mServiceNeedsRestart = true;
} else if (key.equals(DebugSettings.PREF_FORCE_NON_DISTINCT_MULTITOUCH)) { } else if (key.equals(DebugSettings.PREF_FORCE_NON_DISTINCT_MULTITOUCH)) {
mServiceNeedsRestart = true; mServiceNeedsRestart = true;

View file

@ -162,6 +162,8 @@ class LanguageSettingsDialog(
addSecondaryLocaleView(locale) addSecondaryLocaleView(locale)
di.dismiss() di.dismiss()
reloadSetting() reloadSetting()
reloadDictionaries()
KeyboardLayoutSet.onSystemLocaleChanged()
} }
.setNegativeButton(android.R.string.cancel, null) .setNegativeButton(android.R.string.cancel, null)
.show() .show()
@ -183,11 +185,11 @@ class LanguageSettingsDialog(
Settings.setSecondaryLocales(prefs, mainLocaleString, localeStrings - locale.toString()) Settings.setSecondaryLocales(prefs, mainLocaleString, localeStrings - locale.toString())
binding.secondaryLocales.removeView(rowBinding.root) binding.secondaryLocales.removeView(rowBinding.root)
reloadSetting() reloadSetting()
reloadDictionaries()
KeyboardLayoutSet.onSystemLocaleChanged() KeyboardLayoutSet.onSystemLocaleChanged()
} }
} }
binding.secondaryLocales.addView(rowBinding.root) binding.secondaryLocales.addView(rowBinding.root)
KeyboardLayoutSet.onSystemLocaleChanged()
} }
private fun fillDictionariesView() { private fun fillDictionariesView() {
@ -268,8 +270,7 @@ class LanguageSettingsDialog(
dictFile.delete() dictFile.delete()
if (parent?.list()?.isEmpty() == true) if (parent?.list()?.isEmpty() == true)
parent.delete() parent.delete()
val newDictBroadcast = Intent(DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION) reloadDictionaries()
fragment?.activity?.sendBroadcast(newDictBroadcast)
binding.dictionaries.removeView(rowBinding.root) binding.dictionaries.removeView(rowBinding.root)
if (binding.dictionaries.size < 2) { // first view is "Dictionaries" if (binding.dictionaries.size < 2) { // first view is "Dictionaries"
infos.forEach { it.hasDictionary = false } infos.forEach { it.hasDictionary = false }
@ -284,6 +285,8 @@ class LanguageSettingsDialog(
} }
binding.dictionaries.addView(rowBinding.root) binding.dictionaries.addView(rowBinding.root)
} }
private fun reloadDictionaries() = fragment?.activity?.sendBroadcast(Intent(DictionaryPackConstants.NEW_DICTIONARY_INTENT_ACTION))
} }
/** @return list of user dictionary files and whether an internal dictionary exists */ /** @return list of user dictionary files and whether an internal dictionary exists */