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

Commit 27e48447 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Lingering gesture floating preview text a bit

Bug: 6936095
Change-Id: I873343e9aa6afdf6bdb223795f03232509b012a7
parent 2a0975be
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@
            <enum name="boldItalic" value="3" />
        </attr>

        <!-- Attributes for PreviewPlacerView -->
        <attr name="gestureFloatingPreviewTextSize" format="dimension" />
        <attr name="gestureFloatingPreviewTextColor" format="color" />
        <attr name="gestureFloatingPreviewTextOffset" format="dimension" />
@@ -128,6 +129,8 @@
        <attr name="gestureFloatingPreviewTextShadowBorder" format="dimension" />
        <attr name="gestureFloatingPreviewTextConnectorColor" format="color" />
        <attr name="gestureFloatingPreviewTextConnectorWidth" format="dimension" />
        <!-- Delay after gesture input and gesture floating preview text dismissing in millisecond -->
        <attr name="gestureFloatingPreviewTextLingerTimeout" format="integer" />
        <attr name="gesturePreviewTrailColor" format="color" />
        <attr name="gesturePreviewTrailWidth" format="dimension" />
    </declare-styleable>
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
         Configuration for KeyboardView
    -->
    <integer name="config_key_preview_linger_timeout">70</integer>
    <integer name="config_gesture_floating_preview_text_linger_timeout">200</integer>
    <!--
         Configuration for MainKeyboardView
    -->
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@
        <item name="gestureFloatingPreviewTextShadowBorder">@dimen/gesture_floating_preview_text_shadow_border</item>
        <item name="gestureFloatingPreviewTextConnectorColor">@android:color/white</item>
        <item name="gestureFloatingPreviewTextConnectorWidth">@dimen/gesture_floating_preview_text_connector_width</item>
        <item name="gestureFloatingPreviewTextLingerTimeout">@integer/config_gesture_floating_preview_text_linger_timeout</item>
        <item name="gesturePreviewTrailColor">@android:color/holo_blue_light</item>
        <item name="gesturePreviewTrailWidth">@dimen/gesture_preview_trail_width</item>
        <!-- Common attributes of MainKeyboardView -->
+6 −6
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
    // Implements {@link KeyboardState.SwitchActions}.
    @Override
    public void startDoubleTapTimer() {
        final MainKeyboardView keyboardView = getKeyboardView();
        final MainKeyboardView keyboardView = getMainKeyboardView();
        if (keyboardView != null) {
            final TimerProxy timer = keyboardView.getTimerProxy();
            timer.startDoubleTapTimer();
@@ -277,7 +277,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
    // Implements {@link KeyboardState.SwitchActions}.
    @Override
    public void cancelDoubleTapTimer() {
        final MainKeyboardView keyboardView = getKeyboardView();
        final MainKeyboardView keyboardView = getMainKeyboardView();
        if (keyboardView != null) {
            final TimerProxy timer = keyboardView.getTimerProxy();
            timer.cancelDoubleTapTimer();
@@ -287,7 +287,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
    // Implements {@link KeyboardState.SwitchActions}.
    @Override
    public boolean isInDoubleTapTimeout() {
        final MainKeyboardView keyboardView = getKeyboardView();
        final MainKeyboardView keyboardView = getMainKeyboardView();
        return (keyboardView != null)
                ? keyboardView.getTimerProxy().isInDoubleTapTimeout() : false;
    }
@@ -295,7 +295,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
    // Implements {@link KeyboardState.SwitchActions}.
    @Override
    public void startLongPressTimer(int code) {
        final MainKeyboardView keyboardView = getKeyboardView();
        final MainKeyboardView keyboardView = getMainKeyboardView();
        if (keyboardView != null) {
            final TimerProxy timer = keyboardView.getTimerProxy();
            timer.startLongPressTimer(code);
@@ -305,7 +305,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
    // Implements {@link KeyboardState.SwitchActions}.
    @Override
    public void cancelLongPressTimer() {
        final MainKeyboardView keyboardView = getKeyboardView();
        final MainKeyboardView keyboardView = getMainKeyboardView();
        if (keyboardView != null) {
            final TimerProxy timer = keyboardView.getTimerProxy();
            timer.cancelLongPressTimer();
@@ -345,7 +345,7 @@ public class KeyboardSwitcher implements KeyboardState.SwitchActions {
        mState.onCodeInput(code, isSinglePointer(), mLatinIME.getCurrentAutoCapsState());
    }

    public MainKeyboardView getKeyboardView() {
    public MainKeyboardView getMainKeyboardView() {
        return mKeyboardView;
    }

+9 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
    private final DrawingHandler mDrawingHandler = new DrawingHandler(this);

    public static class DrawingHandler extends StaticInnerHandlerWrapper<KeyboardView> {
        private static final int MSG_DISMISS_KEY_PREVIEW = 1;
        private static final int MSG_DISMISS_KEY_PREVIEW = 0;

        public DrawingHandler(KeyboardView outerInstance) {
            super(outerInstance);
@@ -902,6 +902,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {

    public void cancelAllMessages() {
        mDrawingHandler.cancelAllMessages();
        if (mPreviewPlacerView != null) {
            mPreviewPlacerView.cancelAllMessages();
        }
    }

    // Called by {@link PointerTracker} constructor to create a TextView.
@@ -943,6 +946,11 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
        mPreviewPlacerView.setGestureFloatingPreviewText(gestureFloatingPreviewText);
    }

    public void dismissGestureFloatingPreviewText() {
        locatePreviewPlacerView();
        mPreviewPlacerView.dismissGestureFloatingPreviewText();
    }

    @Override
    public void showGestureTrail(PointerTracker tracker) {
        locatePreviewPlacerView();
Loading