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

Commit b72a335a authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Voice input replaces selected text." into gingerbread

parents 66e60604 e507a9e4
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -6668,10 +6668,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            if (mInputContentType != null) {
                mInputContentType.enterDown = false;
            }
            hideInsertionPointCursorController();
            if (mSelectionModifierCursorController != null) {
                mSelectionModifierCursorController.hide();
            }
            hideControllers();
        }

        startStopMarquee(hasWindowFocus);
@@ -6681,10 +6678,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    protected void onVisibilityChanged(View changedView, int visibility) {
        super.onVisibilityChanged(changedView, visibility);
        if (visibility != VISIBLE) {
            hideInsertionPointCursorController();
            if (mSelectionModifierCursorController != null) {
                mSelectionModifierCursorController.hide();
            }
            hideControllers();
        }
    }

@@ -7643,10 +7637,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    private void stopTextSelectionMode() {
        if (mIsInTextSelectionMode) {
            Selection.setSelection((Spannable) mText, getSelectionEnd());
            if (mSelectionModifierCursorController != null) {
                mSelectionModifierCursorController.hide();
            }

            hideSelectionModifierCursorController();
            mIsInTextSelectionMode = false;
        }
    }
@@ -8182,9 +8173,15 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        }
    }

    private void hideSelectionModifierCursorController() {
        if (mSelectionModifierCursorController != null) {
            mSelectionModifierCursorController.hide();
        }
    }
    
    private void hideControllers() {
        hideInsertionPointCursorController();
        stopTextSelectionMode();
        hideSelectionModifierCursorController();
    }

    private int getOffsetForHorizontal(int line, int x) {