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

Unverified Commit 555c152a authored by Zhao Wei Liew's avatar Zhao Wei Liew Committed by Michael Bestas
Browse files

LatinIME: Remove gesture preference if gesture lib is unavailable

Gesture typing won't work without the gesture library,
so remove the preference to not mislead users
into thinking that gesture typing is supported.

Change-Id: I387ae83fd174b57fc48fe7bcfc37e3010ce89b12
parent 3a8b5fde
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
    public static final String SCREEN_ACCOUNTS = "screen_accounts";
    public static final String SCREEN_THEME = "screen_theme";
    public static final String SCREEN_DEBUG = "screen_debug";
    public static final String SCREEN_GESTURE = "screen_gesture";
    // In the same order as xml/prefs.xml
    public static final String PREF_AUTO_CAP = "auto_cap";
    public static final String PREF_VIBRATE_ON = "vibrate_on";
+5 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.define.ProductionFlags;
import com.android.inputmethod.latin.utils.ApplicationUtils;
import com.android.inputmethod.latin.utils.FeedbackUtils;
import com.android.inputmethod.latin.utils.JniUtils;
import com.android.inputmethodcommon.InputMethodSettingsFragment;

public final class SettingsFragment extends InputMethodSettingsFragment {
@@ -55,6 +56,10 @@ public final class SettingsFragment extends InputMethodSettingsFragment {
            final Preference accountsPreference = findPreference(Settings.SCREEN_ACCOUNTS);
            preferenceScreen.removePreference(accountsPreference);
        }
        if (!JniUtils.mHaveGestureLib) {
            final Preference gesturePreference = findPreference(Settings.SCREEN_GESTURE);
            preferenceScreen.removePreference(gesturePreference);
        }
    }

    @Override