mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Show usability study mode for research purposes
Bug: 5722703 Change-Id: I27acc374c5d4b52707708b83689dea5d78a573d7
This commit is contained in:
parent
d52e760530
commit
e0dfc54c5b
@ -166,4 +166,5 @@
|
|||||||
<string name="dictionary_pack_package_name">com.google.android.inputmethod.latin.dictionarypack</string>
|
<string name="dictionary_pack_package_name">com.google.android.inputmethod.latin.dictionarypack</string>
|
||||||
<string name="dictionary_pack_settings_activity">com.google.android.inputmethod.latin.dictionarypack.DictionarySettingsActivity</string>
|
<string name="dictionary_pack_settings_activity">com.google.android.inputmethod.latin.dictionarypack.DictionarySettingsActivity</string>
|
||||||
<string name="settings_ms">ms</string>
|
<string name="settings_ms">ms</string>
|
||||||
|
<string name="settings_warning_researcher_mode">Attention! You are using the special keyboard for research purposes.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -78,4 +78,8 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
|
|||||||
|
|
||||||
public static void onPrintAllUsabilityStudyLogs() {
|
public static void onPrintAllUsabilityStudyLogs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isResearcherPackage() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -457,12 +457,21 @@ public class Settings extends InputMethodSettingsActivity
|
|||||||
textCorrectionGroup.removePreference(dictionaryLink);
|
textCorrectionGroup.removePreference(dictionaryLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean showUsabilityModeStudyOption = res.getBoolean(
|
final boolean isResearcherPackage = LatinImeLogger.isResearcherPackage();
|
||||||
R.bool.config_enable_usability_study_mode_option);
|
final boolean showUsabilityStudyModeOption =
|
||||||
if (!showUsabilityModeStudyOption || !ENABLE_EXPERIMENTAL_SETTINGS) {
|
res.getBoolean(R.bool.config_enable_usability_study_mode_option)
|
||||||
final Preference pref = findPreference(PREF_USABILITY_STUDY_MODE);
|
|| isResearcherPackage || ENABLE_EXPERIMENTAL_SETTINGS;
|
||||||
if (pref != null) {
|
final Preference usabilityStudyPref = findPreference(PREF_USABILITY_STUDY_MODE);
|
||||||
miscSettings.removePreference(pref);
|
if (!showUsabilityStudyModeOption) {
|
||||||
|
if (usabilityStudyPref != null) {
|
||||||
|
miscSettings.removePreference(usabilityStudyPref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isResearcherPackage) {
|
||||||
|
if (usabilityStudyPref instanceof CheckBoxPreference) {
|
||||||
|
CheckBoxPreference checkbox = (CheckBoxPreference)usabilityStudyPref;
|
||||||
|
checkbox.setChecked(prefs.getBoolean(PREF_USABILITY_STUDY_MODE, true));
|
||||||
|
checkbox.setSummary(R.string.settings_warning_researcher_mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user