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

Commit 62b8dddb authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Add gesture input enable settings

Bug: 6845325
Change-Id: I3165465b0b280e32a9288da16abb75baa67288dc
parent b8bd45a2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -111,6 +111,11 @@
    <!-- Description for "next word suggestion" option. This displays suggestions even when there is no input, based on the previous word. -->
    <string name="bigram_prediction_summary">Based on previous word</string>

    <!-- Option to enable gesture input. The user can input a word by tracing the letters of a word without releasing the finger from the screen. [CHAR LIMIT=20]-->
    <string name="gesture_input">Gesture input</string>
    <!-- Description for "gesture_input" option. The user can input a word by tracing the letters of a word without releasing the finger from the screen. [CHAR LIMIT=65]-->
    <string name="gesture_input_summary">Input a word by tracing the letters of a word</string>

    <!-- Indicates that a word has been added to the dictionary -->
    <string name="added_word"><xliff:g id="word">%s</xliff:g> : Saved</string>

+6 −0
Original line number Diff line number Diff line
@@ -86,6 +86,12 @@
            android:summary="@string/bigram_prediction_summary"
            android:persistent="true"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="gesture_input"
            android:title="@string/gesture_input"
            android:summary="@string/gesture_input_summary"
            android:persistent="true"
            android:defaultValue="true" />
        <CheckBoxPreference
            android:key="usability_study_mode"
            android:title="@string/prefs_usability_study_mode"
+4 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
        new KeyboardTheme("Basic",            0, R.style.KeyboardTheme),
        new KeyboardTheme("HighContrast",     1, R.style.KeyboardTheme_HighContrast),
        new KeyboardTheme("Stone",            6, R.style.KeyboardTheme_Stone),
        new KeyboardTheme("Stne.Bold",        7, R.style.KeyboardTheme_Stone_Bold),
        new KeyboardTheme("Stone.Bold",       7, R.style.KeyboardTheme_Stone_Bold),
        new KeyboardTheme("GingerBread",      8, R.style.KeyboardTheme_Gingerbread),
        new KeyboardTheme("IceCreamSandwich", 5, R.style.KeyboardTheme_IceCreamSandwich),
    };
@@ -74,6 +74,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
    private LatinKeyboardView mKeyboardView;
    private LatinIME mLatinIME;
    private Resources mResources;
    private SettingsValues mCurrentSettingsValues;

    private KeyboardState mState;

@@ -135,6 +136,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
    }

    public void loadKeyboard(EditorInfo editorInfo, SettingsValues settingsValues) {
        mCurrentSettingsValues = settingsValues;
        final KeyboardLayoutSet.Builder builder = new KeyboardLayoutSet.Builder(
                mThemeContext, editorInfo);
        builder.setScreenGeometry(mThemeContext.getResources().getConfiguration().orientation,
@@ -170,6 +172,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {

    private void setKeyboard(final Keyboard keyboard) {
        final Keyboard oldKeyboard = mKeyboardView.getKeyboard();
        mKeyboardView.setGestureInputEnabled(mCurrentSettingsValues.mGestureInputEnabled);
        mKeyboardView.setKeyboard(keyboard);
        mCurrentInputView.setKeyboardGeometry(keyboard.mTopPadding);
        mKeyboardView.setKeyPreviewPopupEnabled(
+7 −0
Original line number Diff line number Diff line
@@ -109,6 +109,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
    private int mDelayAfterPreview;
    private ViewGroup mPreviewPlacer;

    /** True if the gesture input is enabled. */
    protected boolean mGestureInputEnabled;

    // Drawing
    /** True if the entire keyboard needs to be dimmed. */
    private boolean mNeedsToDimEntireKeyboard;
@@ -438,6 +441,10 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
        return mShowKeyPreviewPopup;
    }

    public void setGestureInputEnabled(boolean gestureInputEnabled) {
        mGestureInputEnabled = gestureInputEnabled;
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        if (mKeyboard != null) {
+2 −5
Original line number Diff line number Diff line
@@ -345,10 +345,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
        final boolean needsPhantomSuddenMoveEventHack = Boolean.parseBoolean(
                Utils.getDeviceOverrideValue(res,
                        R.array.phantom_sudden_move_event_device_list, "false"));
        final boolean gestureInputEnabledByBuildConfig = res.getBoolean(
                R.bool.config_gesture_input_enabled_by_build_config);
        PointerTracker.init(mHasDistinctMultitouch, needsPhantomSuddenMoveEventHack,
                gestureInputEnabledByBuildConfig);
        PointerTracker.init(mHasDistinctMultitouch, needsPhantomSuddenMoveEventHack);

        final TypedArray a = context.obtainStyledAttributes(
                attrs, R.styleable.LatinKeyboardView, defStyle, R.style.LatinKeyboardView);
@@ -464,7 +461,7 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
        super.setKeyboard(keyboard);
        mKeyDetector.setKeyboard(
                keyboard, -getPaddingLeft(), -getPaddingTop() + mVerticalCorrection);
        PointerTracker.setKeyDetector(mKeyDetector);
        PointerTracker.setKeyDetector(mKeyDetector, mGestureInputEnabled);
        mTouchScreenRegulator.setKeyboard(keyboard);
        mMoreKeysPanelCache.clear();

Loading