Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15638aec authored by Jean Chalard's avatar Jean Chalard
Browse files

Show the value of the "Show suggestions" option in summary.

Have the "Show correction suggestions" option display its value
in its description.

Bug: 3282448
Change-Id: Id76b5032ed5776d0567e1679d2a74ee758045919
parent 2f4cc01e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ public class Settings extends PreferenceActivity
    private CheckBoxPreference mQuickFixes;
    private ListPreference mVoicePreference;
    private ListPreference mSettingsKeyPreference;
    private ListPreference mShowCorrectionSuggestionsPreference;
    private ListPreference mAutoCorrectionThreshold;
    private CheckBoxPreference mBigramSuggestion;
    private boolean mVoiceOn;
@@ -102,6 +103,8 @@ public class Settings extends PreferenceActivity
        mQuickFixes = (CheckBoxPreference) findPreference(PREF_QUICK_FIXES);
        mVoicePreference = (ListPreference) findPreference(PREF_VOICE_SETTINGS_KEY);
        mSettingsKeyPreference = (ListPreference) findPreference(PREF_SETTINGS_KEY);
        mShowCorrectionSuggestionsPreference =
                (ListPreference) findPreference(PREF_SHOW_SUGGESTIONS_SETTING);
        SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
        prefs.registerOnSharedPreferenceChangeListener(this);

@@ -188,6 +191,7 @@ public class Settings extends PreferenceActivity
            updateVoiceModeSummary();
        }
        updateSettingsKeySummary();
        updateShowCorrectionSuggestionsSummary();
    }

    @Override
@@ -212,6 +216,7 @@ public class Settings extends PreferenceActivity
                .equals(mVoiceModeOff));
        updateVoiceModeSummary();
        updateSettingsKeySummary();
        updateShowCorrectionSuggestionsSummary();
    }

    @Override
@@ -230,6 +235,13 @@ public class Settings extends PreferenceActivity
        return false;
    }

    private void updateShowCorrectionSuggestionsSummary() {
        mShowCorrectionSuggestionsPreference.setSummary(
                getResources().getStringArray(R.array.prefs_suggestion_visibilities)
                [mShowCorrectionSuggestionsPreference.findIndexOfValue(
                        mShowCorrectionSuggestionsPreference.getValue())]);
    }

    private void updateSettingsKeySummary() {
        mSettingsKeyPreference.setSummary(
                getResources().getStringArray(R.array.settings_key_modes)