Merge branch 'epic/linux-mcompile' into feat/mac/mcompile_mac
8
.github/workflows/api-verification.yml
vendored
|
|
@ -67,6 +67,8 @@ jobs:
|
|||
|
||||
- name: "Verify API for libkeymancore*.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }})"
|
||||
run: |
|
||||
echo "Verify API for libkeymancore*.so (${{ steps.environment_step.outputs.GIT_BRANCH }}, branch ${{ steps.environment_step.outputs.GIT_BASE_BRANCH }}, by ${{ steps.environment_step.outputs.GIT_USER }})" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
BIN_PACKAGE=$(ls "${GITHUB_WORKSPACE}/artifacts/" | grep "${PKG_NAME}[0-9]*_${{ steps.environment_step.outputs.VERSION }}-1${{ steps.environment_step.outputs.PRERELEASE_TAG }}+$(lsb_release -c -s)1_amd64.deb")
|
||||
cd ${{ github.workspace }}/keyman/linux
|
||||
./scripts/deb-packaging.sh \
|
||||
|
|
@ -93,19 +95,19 @@ jobs:
|
|||
if: needs.api_verification.result == 'success'
|
||||
run: |
|
||||
echo "RESULT=success" >> $GITHUB_ENV
|
||||
echo "MSG=Package build succeeded" >> $GITHUB_ENV
|
||||
echo "MSG=API verification succeeded" >> $GITHUB_ENV
|
||||
|
||||
- name: Set cancelled
|
||||
if: needs.api_verification.result == 'cancelled'
|
||||
run: |
|
||||
echo "RESULT=error" >> $GITHUB_ENV
|
||||
echo "MSG=Package build cancelled" >> $GITHUB_ENV
|
||||
echo "MSG=API verification cancelled" >> $GITHUB_ENV
|
||||
|
||||
- name: Set failure
|
||||
if: needs.api_verification.result == 'failure'
|
||||
run: |
|
||||
echo "RESULT=failure" >> $GITHUB_ENV
|
||||
echo "MSG=Package build failed" >> $GITHUB_ENV
|
||||
echo "MSG=API verification failed" >> $GITHUB_ENV
|
||||
|
||||
- name: Set final status
|
||||
run: |
|
||||
|
|
|
|||
3
.gitignore
vendored
|
|
@ -183,3 +183,6 @@ lcov.info
|
|||
/keyman*.buildinfo
|
||||
/keyman*.changes
|
||||
/keyman*.tar.?z
|
||||
|
||||
# flag file for build script
|
||||
.configured
|
||||
|
|
|
|||
92
HISTORY.md
|
|
@ -1,5 +1,97 @@
|
|||
# Keyman Version History
|
||||
|
||||
## 18.0.125 alpha 2024-10-10
|
||||
|
||||
* chore(common): allow to run `build.sh` scripts in `bashdb` debugger (#12518)
|
||||
* chore(linux): Improve output of API Verification (#12522)
|
||||
* chore(linux): allow to skip API change (#12519)
|
||||
* fix(linux): fix problem with API checks with merge commits (#12520)
|
||||
* refactor(web): move `KeyboardObject` type to `common/web/types` (#12514)
|
||||
|
||||
## 18.0.124 alpha 2024-10-09
|
||||
|
||||
* chore(common): fix links in minimum-versions.md (#12507)
|
||||
* fix(developer): use richedit in debug memo to support Egyptian cartouches (#12464)
|
||||
* feat(android): Add controls for auto-correct (#12443)
|
||||
|
||||
## 18.0.123 alpha 2024-10-08
|
||||
|
||||
* chore(developer,common): deps: replace xml2js with fast-xml-parser (#12502)
|
||||
* chore(ios): renew certificate (#12512)
|
||||
|
||||
## 18.0.122 alpha 2024-10-07
|
||||
|
||||
* feat(mac): both option keys generate right alt if no left alt mapping (#12458)
|
||||
* chore(common): improve configuration detection for hextobin (#12481)
|
||||
|
||||
## 18.0.121 alpha 2024-10-03
|
||||
|
||||
* docs(developer): Fix image links in help (#12488)
|
||||
* fix(oem/fv): Update keyboard versions and names for fv_all.kmp 13.1 (#12486)
|
||||
* feat(common): unified XML parser/writer (#12482)
|
||||
|
||||
## 18.0.120 alpha 2024-10-02
|
||||
|
||||
* chore(common): Add note on troubleshooting website errors (#12487)
|
||||
* docs(common): mention `KEYMAN_USE_NVM` in minimum versions doc (#12490)
|
||||
* docs(web): fix paths to several help pages (#12491)
|
||||
* docs(web): fix structure of test document (#12492)
|
||||
|
||||
## 18.0.119 alpha 2024-09-28
|
||||
|
||||
* refactor(developer): copy dev 17.0 help into repo (#12427)
|
||||
* fix(developer): warn before importing over touch layout (#12478)
|
||||
* chore(linux): display branch name with API verification (#12480)
|
||||
* docs(core): Update kmx-plus-file-format.md (#12479)
|
||||
|
||||
## 18.0.118 alpha 2024-09-26
|
||||
|
||||
* chore(developer): add context/options (#11566)
|
||||
* chore(deps-dev): bump rollup from 4.16.4 to 4.22.4 (#12462)
|
||||
* fix(developer): ignore excess whitespace in `<row keys>` attribute (#12468)
|
||||
* refactor(common): move help into common prod/docs/help folders (#12424)
|
||||
* fix(developer): publish developer-utils package during build (#12471)
|
||||
* fix(linux): ignore additional C++ symbol in API check (#12474)
|
||||
|
||||
## 18.0.117 alpha 2024-09-25
|
||||
|
||||
* docs(common): Document how to skip generating CDN on websites (#12446)
|
||||
* fix(android): Remove toggle for "Always Show Banner" (#12430)
|
||||
* fix(android): Hide suggestion banner on password fields (#12442)
|
||||
* fix(developer): prevent invalid string ids (#12465)
|
||||
|
||||
## 18.0.116 alpha 2024-09-20
|
||||
|
||||
* change(mac): remove verbose logging option (#12431)
|
||||
* chore(common): Allow to build offline (#12439)
|
||||
|
||||
## 18.0.115 alpha 2024-09-19
|
||||
|
||||
* chore(common): detect ssh remotes in git hooks (#12437)
|
||||
* fix(common): add proper configure output for hextobin (#12440)
|
||||
* fix(core): add missing dependency for core (#12438)
|
||||
* chore(developer): remove .js output from LDML compiler (#12432)
|
||||
|
||||
## 18.0.114 alpha 2024-09-17
|
||||
|
||||
* fix(developer): rewrite ldml visual keyboard compiler (#12402)
|
||||
* fix(developer): check vars string usage before definition (#12404)
|
||||
* change(mac): remove 'Always show OSK' option (#12355)
|
||||
|
||||
## 18.0.113 alpha 2024-09-16
|
||||
|
||||
* test(developer): kmcmplib compiler unit tests 3 (#11990)
|
||||
|
||||
## 18.0.112 alpha 2024-09-14
|
||||
|
||||
* chore(deps): bump express from 4.19.2 to 4.20.0 (#12396)
|
||||
|
||||
## 18.0.111 alpha 2024-09-13
|
||||
|
||||
* chore(common): Update crowdin strings for Italian (#12408)
|
||||
* fix(common): correct offsets in KMX+ spec (#12350)
|
||||
* fix(android): Add gating to setLongpressDelay() (#12410)
|
||||
|
||||
## 18.0.110 alpha 2024-09-12
|
||||
|
||||
* chore(common): Update to Unicode 16.0 (#12393)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
18.0.111
|
||||
18.0.126
|
||||
|
|
@ -24,7 +24,7 @@ function generateReleaseNotes() {
|
|||
# Pad release notes if whatsnew.md doesn't have any line items
|
||||
# Play Store release notes have a limit of 500 characters
|
||||
local DEFAULT_RELEASE_NOTE="* Additional bug fixes and improvements"
|
||||
local FILTERED_LINES=$( grep '^\s*\*.*$' "$KEYMAN_ROOT/android/help/about/whatsnew.md" || [[ $? == 1 ]] ) # Continue if grep has no matches
|
||||
local FILTERED_LINES=$( grep '^\s*\*.*$' "$KEYMAN_ROOT/android/docs/help/about/whatsnew.md" || [[ $? == 1 ]] ) # Continue if grep has no matches
|
||||
if [ -z "$FILTERED_LINES" ]; then
|
||||
FILTERED_LINES="$DEFAULT_RELEASE_NOTE"
|
||||
builder_warn "Warning: whatsnew.md empty so using default release note: '$FILTERED_LINES'"
|
||||
|
|
@ -32,7 +32,7 @@ function generateReleaseNotes() {
|
|||
|
||||
# Change IFS to new line
|
||||
local old_IFS="${IFS}"
|
||||
IFS=$'\n'
|
||||
IFS=$'\n'
|
||||
for line in $FILTERED_LINES
|
||||
do
|
||||
local CHARS_IN_RELEASE_NOTES=$( wc -m < "$PLAY_RELEASE_NOTES" )
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.tavultesoft.kmapro.KeymanSettingsActivity;
|
|||
import com.keyman.engine.KMManager;
|
||||
import com.keyman.engine.KMManager.KeyboardType;
|
||||
import com.keyman.engine.KMHardwareKeyboardInterpreter;
|
||||
import com.keyman.engine.KMManager.SuggestionType;
|
||||
import com.keyman.engine.KeyboardEventHandler.OnKeyboardEventListener;
|
||||
import com.keyman.engine.R;
|
||||
import com.keyman.engine.data.Keyboard;
|
||||
|
|
@ -169,8 +170,9 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
|
|||
if (kbInfo != null) {
|
||||
String langId = kbInfo.getLanguageID();
|
||||
SharedPreferences prefs = appContext.getSharedPreferences(appContext.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
|
||||
boolean mayPredict = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(langId), true);
|
||||
KMManager.setBannerOptions(mayPredict);
|
||||
int maySuggest = prefs.getInt(KMManager.getLanguageAutoCorrectionPreferenceKey(langId), KMManager.KMDefault_Suggestion);
|
||||
// Enable banner if maySuggest is not SuggestionType.SUGGESTIONS_DISABLED (0)
|
||||
KMManager.setBannerOptions(maySuggest != SuggestionType.SUGGESTIONS_DISABLED.toInt());
|
||||
} else {
|
||||
KMManager.setBannerOptions(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import androidx.appcompat.widget.Toolbar;
|
|||
public class KeymanSettingsActivity extends BaseActivity {
|
||||
protected static final String installedLanguagesKey = "InstalledLanguages";
|
||||
protected static final String installKeyboardOrDictionaryKey = "InstallKeyboardOrDictionary";
|
||||
protected static final String showBannerKey = "ShowBanner";
|
||||
protected static final String sendCrashReport = "SendCrashReport";
|
||||
public static final String spacebarTextKey = "SpacebarText";
|
||||
public static final String hapticFeedbackKey = "HapticFeedback";
|
||||
|
|
|
|||
|
|
@ -178,12 +178,6 @@ public class KeymanSettingsFragment extends PreferenceFragmentCompat {
|
|||
editor.putBoolean(KeymanSettingsActivity.showBannerKey, isChecked);
|
||||
as part of the default onClick() used by SwitchPreference.
|
||||
*/
|
||||
SwitchPreference bannerPreference = new SwitchPreference(context);
|
||||
bannerPreference.setKey(KeymanSettingsActivity.showBannerKey);
|
||||
bannerPreference.setTitle(getString(R.string.show_banner));
|
||||
bannerPreference.setSummaryOn(getString(R.string.show_banner_on));
|
||||
bannerPreference.setSummaryOff(getString(R.string.show_banner_off));
|
||||
|
||||
SwitchPreference getStartedPreference = new SwitchPreference(context);
|
||||
getStartedPreference.setKey(GetStartedActivity.showGetStartedKey);
|
||||
getStartedPreference.setTitle(String.format(getString(R.string.show_get_started), getString(R.string.get_started)));
|
||||
|
|
@ -207,7 +201,6 @@ public class KeymanSettingsFragment extends PreferenceFragmentCompat {
|
|||
screen.addPreference(spacebarTextPreference);
|
||||
|
||||
screen.addPreference(hapticFeedbackPreference);
|
||||
screen.addPreference(bannerPreference);
|
||||
screen.addPreference(getStartedPreference);
|
||||
screen.addPreference(sendCrashReportPreference);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,13 @@ import android.widget.AdapterView;
|
|||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RadioGroup.OnCheckedChangeListener;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
|
@ -55,50 +59,6 @@ public final class LanguageSettingsActivity extends AppCompatActivity {
|
|||
|
||||
private final static String TAG = "LanguageSettingsAct";
|
||||
|
||||
private class PreferenceToggleListener implements View.OnClickListener {
|
||||
String prefsKey;
|
||||
String lgCode;
|
||||
|
||||
public PreferenceToggleListener(String prefsKey, String lgCode) {
|
||||
this.prefsKey = prefsKey;
|
||||
this.lgCode = lgCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// For predictions/corrections toggle
|
||||
SwitchCompat toggle = (SwitchCompat) v;
|
||||
|
||||
SharedPreferences.Editor prefEditor = prefs.edit();
|
||||
|
||||
// predictionsToggle overrides correctionToggle and correctionsTextView
|
||||
if (prefsKey.endsWith(KMManager.predictionPrefSuffix)) {
|
||||
boolean override = toggle.isChecked();
|
||||
overrideCorrectionsToggle(override);
|
||||
}
|
||||
|
||||
// This will allow preemptively making settings for languages without models.
|
||||
// Seems more trouble than it's worth to block this.
|
||||
prefEditor.putBoolean(prefsKey, toggle.isChecked());
|
||||
prefEditor.apply();
|
||||
|
||||
// Don't use/apply language modeling settings for languages without models.
|
||||
if (associatedLexicalModel.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Keyboard kbInfo = KMManager.getCurrentKeyboardInfo(context);
|
||||
if(kbInfo != null) {
|
||||
// If the active keyboard is for this language, immediately enact the new pref setting.
|
||||
String kbdLgCode = kbInfo.getLanguageID();
|
||||
if (kbdLgCode.equals(lgCode)) {
|
||||
// Not only registers the model but also applies our modeling preferences.
|
||||
KMManager.registerAssociatedLexicalModel(lgCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
@ -139,33 +99,48 @@ public final class LanguageSettingsActivity extends AppCompatActivity {
|
|||
|
||||
FilteredKeyboardsAdapter adapter = new FilteredKeyboardsAdapter(context, KeyboardPickerActivity.getInstalledDataset(context), lgCode);
|
||||
|
||||
// The following two layouts/toggles will need to link with these objects.
|
||||
// The following radio group will need to link with these objects.
|
||||
Context appContext = this.getApplicationContext();
|
||||
prefs = appContext.getSharedPreferences(appContext.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
|
||||
boolean mayPredict = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(lgCode), true);
|
||||
boolean mayCorrect = prefs.getBoolean(KMManager.getLanguageCorrectionPreferenceKey(lgCode), true);
|
||||
int maySuggest = prefs.getInt(KMManager.getLanguageAutoCorrectionPreferenceKey(lgCode), KMManager.KMDefault_Suggestion);
|
||||
|
||||
RelativeLayout layout = (RelativeLayout)findViewById(R.id.corrections_toggle);
|
||||
// Initialize Radio button group change listeners
|
||||
RadioGroup radioGroup = (RadioGroup) findViewById(R.id.suggestion_radio_group);
|
||||
radioGroup.clearCheck();
|
||||
|
||||
correctionsTextView = (TextView) layout.findViewById(R.id.text1);
|
||||
correctionsTextView.setText(getString(R.string.enable_corrections));
|
||||
correctionsToggle = layout.findViewById(R.id.toggle);
|
||||
correctionsToggle.setChecked(mayCorrect); // Link to persistent option storage! Also needs handler.
|
||||
String prefsKey = KMManager.getLanguageCorrectionPreferenceKey(lgCode);
|
||||
correctionsToggle.setOnClickListener(new PreferenceToggleListener(prefsKey, lgCode));
|
||||
int[] RadioButtonArray = {
|
||||
R.id.suggestion_radio_0,
|
||||
R.id.suggestion_radio_1,
|
||||
R.id.suggestion_radio_2,
|
||||
R.id.suggestion_radio_3};
|
||||
RadioButton radioButton = (RadioButton)radioGroup.findViewById(RadioButtonArray[maySuggest]);
|
||||
radioButton.setChecked(true);
|
||||
|
||||
layout = (RelativeLayout)findViewById(R.id.predictions_toggle);
|
||||
radioGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup group, @IdRes int checkId) {
|
||||
RadioButton checkedButton = (RadioButton)radioGroup.findViewById(checkId);
|
||||
int index = radioGroup.indexOfChild(checkedButton);
|
||||
KMManager.setMaySuggest(lgCode, KMManager.SuggestionType.fromInt(index));
|
||||
|
||||
textView = (TextView) layout.findViewById(R.id.text1);
|
||||
textView.setText(getString(R.string.enable_predictions));
|
||||
SwitchCompat predictionsToggle = layout.findViewById(R.id.toggle);
|
||||
predictionsToggle.setChecked(mayPredict); // Link to persistent option storage! Also needs handler.
|
||||
prefsKey = KMManager.getLanguagePredictionPreferenceKey(lgCode);
|
||||
predictionsToggle.setOnClickListener(new PreferenceToggleListener(prefsKey, lgCode));
|
||||
// Don't use/apply language modeling settings for languages without models.
|
||||
if (associatedLexicalModel.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
overrideCorrectionsToggle(mayPredict);
|
||||
Keyboard kbInfo = KMManager.getCurrentKeyboardInfo(context);
|
||||
if(kbInfo != null) {
|
||||
// If the active keyboard is for this language, immediately enact the new pref setting.
|
||||
String kbdLgCode = kbInfo.getLanguageID();
|
||||
if (kbdLgCode.equals(lgCode)) {
|
||||
// Not only registers the model but also applies our modeling preferences.
|
||||
KMManager.registerAssociatedLexicalModel(lgCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
layout = (RelativeLayout)findViewById(R.id.model_picker);
|
||||
RelativeLayout layout = (RelativeLayout)findViewById(R.id.model_picker);
|
||||
textView = (TextView) layout.findViewById(R.id.text1);
|
||||
textView.setText(getString(R.string.model_label));
|
||||
|
||||
|
|
|
|||
|
|
@ -147,13 +147,13 @@
|
|||
<!-- Context: Keyman Settings menu / Haptic feedback -->
|
||||
<string name="haptic_feedback" comment="haptic feedback on key press">Vibrate when typing</string>
|
||||
|
||||
<!-- Context: Keyman Settings menu -->
|
||||
<!-- Context: Keyman Settings menu. Removed in Keyman 18 -->
|
||||
<string name="show_banner" comment="text suggestions banner">Always show banner</string>
|
||||
|
||||
<!-- Context: Keyman Settings menu -->
|
||||
<!-- Context: Keyman Settings menu. Removed in Keyman 18 -->
|
||||
<string name="show_banner_on" comment="Description when toggle is on">To be implemented</string>
|
||||
|
||||
<!-- Context: Keyman Settings menu -->
|
||||
<!-- Context: Keyman Settings menu. Removed in Keyman 18 -->
|
||||
<string name="show_banner_off" comment="Description when toggle is off">When off, only shown when predictive text is enabled</string>
|
||||
|
||||
<!-- Context: Keyman Settings menu -->
|
||||
|
|
|
|||
|
|
@ -229,11 +229,23 @@ function deregisterModel(modelID) {
|
|||
keyman.removeModel(modelID);
|
||||
}
|
||||
|
||||
function enableSuggestions(model, mayPredict, mayCorrect) {
|
||||
function enableSuggestions(model, suggestionType) {
|
||||
// Set the options first so that KMW's ModelManager can properly handle model enablement states
|
||||
// the moment we actually register the new model.
|
||||
keyman.core.languageProcessor.mayPredict = mayPredict;
|
||||
keyman.core.languageProcessor.mayCorrect = mayCorrect;
|
||||
// Use console_debug
|
||||
console_debug('enableSuggestions(model, maySuggest='+suggestionType+')');
|
||||
const suggestionSettings = [
|
||||
// mayPredict, mayCorrect, mayAutoCorrect
|
||||
[false, false, false], // 0 = SuggestionType.SUGGESTIONS_DISABLED
|
||||
[true, false, false], // 1 = SuggestionType.PREDICTIONS_ONLY
|
||||
[true, true, false], // 2 = SuggestionType.PREDICTIONS_WITH_CORRECTIONS
|
||||
[true, true, true], // 3 = SuggestionType.PREDICTIONS_WITH_AUTO_CORRECT
|
||||
];
|
||||
const t = suggestionSettings[suggestionType]
|
||||
? suggestionSettings[suggestionType] : suggestionSettings[0];
|
||||
keyman.core.languageProcessor.mayPredict = t[0];
|
||||
keyman.core.languageProcessor.maySuggest = t[1];
|
||||
// keyman.core.languageProcessor.mayAutoCorrect = t[2];
|
||||
|
||||
registerModel(model);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import android.widget.RelativeLayout;
|
|||
import com.keyman.engine.KeyboardEventHandler.EventType;
|
||||
import com.keyman.engine.KMManager;
|
||||
import com.keyman.engine.KMManager.KeyboardType;
|
||||
import com.keyman.engine.KMManager.SuggestionType;
|
||||
import com.keyman.engine.util.KMLog;
|
||||
import com.keyman.engine.data.Keyboard;
|
||||
|
||||
|
|
@ -164,8 +165,10 @@ public final class KMKeyboardWebViewClient extends WebViewClient {
|
|||
// appContext instead of context?
|
||||
SharedPreferences prefs = context.getSharedPreferences(context.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
|
||||
boolean modelPredictionPref = false;
|
||||
if (KMManager.currentLexicalModel != null) {
|
||||
modelPredictionPref = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(KMManager.currentLexicalModel.get(KMManager.KMKey_LanguageID)), true);
|
||||
if (!KMManager.getMayPredictOverride() && KMManager.currentLexicalModel != null) {
|
||||
modelPredictionPref = prefs.getInt(KMManager.getLanguageAutoCorrectionPreferenceKey(
|
||||
KMManager.currentLexicalModel.get(KMManager.KMKey_LanguageID)), KMManager.KMDefault_Suggestion)
|
||||
!= SuggestionType.SUGGESTIONS_DISABLED.toInt();
|
||||
}
|
||||
KMManager.setBannerOptions(modelPredictionPref);
|
||||
RelativeLayout.LayoutParams params = KMManager.getKeyboardLayoutParams();
|
||||
|
|
|
|||
|
|
@ -192,6 +192,35 @@ public final class KMManager {
|
|||
DEFAULT, // Default ENTER action
|
||||
}
|
||||
|
||||
// Enum for whether the suggestion banner allows predictions, corrections, auto-corrections
|
||||
public enum SuggestionType {
|
||||
// Suggestion Disabled - No Predictions, No corrections, No auto-corrections
|
||||
SUGGESTIONS_DISABLED,
|
||||
|
||||
// Suggestions Enabled
|
||||
PREDICTIONS_ONLY, // Predictions with no corrections
|
||||
PREDICTIONS_WITH_CORRECTIONS, // Predictions with corrections
|
||||
PREDICTIONS_WITH_AUTO_CORRECT; // Predictions with auto-corrections
|
||||
|
||||
public static SuggestionType fromInt(int mode) {
|
||||
switch (mode) {
|
||||
case 0:
|
||||
return SUGGESTIONS_DISABLED;
|
||||
case 1:
|
||||
return PREDICTIONS_ONLY;
|
||||
case 2:
|
||||
return PREDICTIONS_WITH_CORRECTIONS;
|
||||
case 3:
|
||||
return PREDICTIONS_WITH_AUTO_CORRECT;
|
||||
}
|
||||
return SUGGESTIONS_DISABLED;
|
||||
}
|
||||
|
||||
public int toInt() {
|
||||
return this.ordinal();
|
||||
}
|
||||
}
|
||||
|
||||
protected static InputMethodService IMService;
|
||||
|
||||
private static boolean debugMode = false;
|
||||
|
|
@ -220,6 +249,7 @@ public final class KMManager {
|
|||
|
||||
public final static String predictionPrefSuffix = ".mayPredict";
|
||||
public final static String correctionPrefSuffix = ".mayCorrect";
|
||||
public final static String autoCorrectionPrefSuffix = ".mayAutoCorect";
|
||||
|
||||
// Special override for when the keyboard may have haptic feedback when typing.
|
||||
// haptic feedback disabled for hardware keystrokes
|
||||
|
|
@ -315,6 +345,8 @@ public final class KMManager {
|
|||
public static final int KMMinimum_LongpressDelay = 300;
|
||||
public static final int KMMaximum_LongpressDelay = 1500;
|
||||
|
||||
// Default prediction/correction setting
|
||||
public static final int KMDefault_Suggestion = SuggestionType.PREDICTIONS_WITH_CORRECTIONS.toInt();
|
||||
|
||||
// Keyman files
|
||||
protected static final String KMFilename_KeyboardHtml = "keyboard.html";
|
||||
|
|
@ -707,6 +739,10 @@ public final class KMManager {
|
|||
return langID + correctionPrefSuffix;
|
||||
}
|
||||
|
||||
public static String getLanguageAutoCorrectionPreferenceKey(String langID) {
|
||||
return langID + autoCorrectionPrefSuffix;
|
||||
}
|
||||
|
||||
public static void hideSystemKeyboard() {
|
||||
if (SystemKeyboard != null) {
|
||||
SystemKeyboard.hideKeyboard();
|
||||
|
|
@ -1350,6 +1386,18 @@ public final class KMManager {
|
|||
return mayPredictOverride;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store SuggestionType as int in preference
|
||||
* @param languageID as String
|
||||
* @param suggestType SuggestionType
|
||||
*/
|
||||
public static void setMaySuggest(String languageID, SuggestionType suggestType) {
|
||||
SharedPreferences prefs = appContext.getSharedPreferences(appContext.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(KMManager.getLanguageAutoCorrectionPreferenceKey(languageID), suggestType.toInt());
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the InputType field is a numeric field
|
||||
* @param inputType
|
||||
|
|
@ -1462,24 +1510,23 @@ public final class KMManager {
|
|||
model = model.replaceAll("\'", "\\\\'"); // Double-escaped-backslash b/c regex.
|
||||
model = model.replaceAll("\"", "'");
|
||||
|
||||
// When entering password field, mayPredict should override to false
|
||||
// When entering password field, maySuggest should override to disabled
|
||||
SharedPreferences prefs = appContext.getSharedPreferences(appContext.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE);
|
||||
boolean mayPredict = (mayPredictOverride) ? false :
|
||||
prefs.getBoolean(getLanguagePredictionPreferenceKey(languageID), true);
|
||||
boolean mayCorrect = prefs.getBoolean(getLanguageCorrectionPreferenceKey(languageID), true);
|
||||
int maySuggest = mayPredictOverride ? SuggestionType.SUGGESTIONS_DISABLED.toInt() :
|
||||
prefs.getInt(getLanguageAutoCorrectionPreferenceKey(languageID), KMDefault_Suggestion);
|
||||
|
||||
RelativeLayout.LayoutParams params;
|
||||
if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP) && !InAppKeyboard.shouldIgnoreTextChange() && modelFileExists) {
|
||||
params = getKeyboardLayoutParams();
|
||||
|
||||
// Do NOT re-layout here; it'll be triggered once the banner loads.
|
||||
InAppKeyboard.loadJavascript(KMString.format("enableSuggestions(%s, %s, %s)", model, mayPredict, mayCorrect));
|
||||
InAppKeyboard.loadJavascript(KMString.format("enableSuggestions(%s, %d)", model, maySuggest));
|
||||
}
|
||||
if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM) && !SystemKeyboard.shouldIgnoreTextChange() && modelFileExists) {
|
||||
params = getKeyboardLayoutParams();
|
||||
|
||||
// Do NOT re-layout here; it'll be triggered once the banner loads.
|
||||
SystemKeyboard.loadJavascript(KMString.format("enableSuggestions(%s, %s, %s)", model, mayPredict, mayCorrect));
|
||||
SystemKeyboard.loadJavascript(KMString.format("enableSuggestions(%s, %d)", model, maySuggest));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,17 +60,44 @@
|
|||
android:layout_height="2dp"
|
||||
android:background="?attr/colorAccent" />
|
||||
|
||||
<include
|
||||
android:id="@+id/predictions_toggle"
|
||||
layout="@layout/list_row_layout4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<!-- Predictions and corrections controls replaced by radio button group
|
||||
Sadly can't use LinearLayouts of list_row_layout4 because
|
||||
it breaks selections in RadioGroup -->
|
||||
<RadioGroup
|
||||
android:id="@+id/suggestion_radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/corrections_toggle"
|
||||
layout="@layout/list_row_layout4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||
android:id="@+id/suggestion_radio_0"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/suggestions_radio_0" />
|
||||
|
||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||
android:id="@+id/suggestion_radio_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/suggestions_radio_1" />
|
||||
|
||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||
android:id="@+id/suggestion_radio_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/suggestions_radio_2" />
|
||||
|
||||
<com.google.android.material.radiobutton.MaterialRadioButton
|
||||
android:id="@+id/suggestion_radio_3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:text="@string/suggestions_radio_3" />
|
||||
|
||||
</RadioGroup>
|
||||
|
||||
<include
|
||||
android:id="@+id/model_picker"
|
||||
|
|
@ -79,10 +106,6 @@
|
|||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Enable corrections toggle -->
|
||||
|
||||
<!-- Enable predictions toggle -->
|
||||
|
||||
<!-- Model picker -->
|
||||
|
||||
<!-- Model dictionary -->
|
||||
|
|
|
|||
|
|
@ -211,12 +211,21 @@
|
|||
<!-- Context: Language Settings Keyboard uninstall strings -->
|
||||
<string name="keyboard_deleted_toast" comment="Notification when a keyboard is deleted">Keyboard deleted</string>
|
||||
|
||||
<!-- Context: Language Settings menu strings -->
|
||||
<!-- Context: Language Settings menu strings. Removed in Keyman 18 -->
|
||||
<string name="enable_corrections" comment="Enable corrections from the suggestion banner">Enable corrections</string>
|
||||
|
||||
<!-- Context: Language Settings menu strings -->
|
||||
<!-- Context: Language Settings menu strings. Removed in Keyman 18 -->
|
||||
<string name="enable_predictions" comment="Enable predictions from the suggestion banner">Enable predictions</string>
|
||||
|
||||
<!-- Context: Language Settings menu strings - radio buttons -->
|
||||
<string name="suggestions_radio_0" comment="Predictions and corrections disabled">Disable suggestions</string>
|
||||
|
||||
<string name="suggestions_radio_1" comment="Suggestions Enabled: Predictions with no corrections">Predictions only</string>
|
||||
|
||||
<string name="suggestions_radio_2" comment="Suggestions Enabled: Predictions with corrections">Predictions with corrections</string>
|
||||
|
||||
<string name="suggestions_radio_3" comment="Suggestions Enabled: Predictions with auto-corrections">Predictions with auto-corrections</string>
|
||||
|
||||
<!-- Context: Language Settings menu strings -->
|
||||
<string name="model_label">Dictionary</string>
|
||||
<plurals name="model_count">
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 283 B After Width: | Height: | Size: 283 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 133 B After Width: | Height: | Size: 133 B |
|
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 536 B |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 298 B After Width: | Height: | Size: 298 B |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
BIN
android/docs/help/android_images/settings-screen-ap.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 992 B After Width: | Height: | Size: 992 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |