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

Commit 0acb0d7a authored by Gilles Debunne's avatar Gilles Debunne Committed by Android Git Automerger
Browse files

am b72a335a: Merge "Voice input replaces selected text." into gingerbread

Merge commit 'b72a335a' into gingerbread-plus-aosp

* commit 'b72a335a':
  Voice input replaces selected text.
parents 2d39374f b72a335a
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -6673,10 +6673,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            if (mInputContentType != null) {
                mInputContentType.enterDown = false;
            }
            hideInsertionPointCursorController();
            if (mSelectionModifierCursorController != null) {
                mSelectionModifierCursorController.hide();
            }
            hideControllers();
        }

        startStopMarquee(hasWindowFocus);
@@ -6686,10 +6683,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();
        }
    }

@@ -7648,10 +7642,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;
        }
    }
@@ -8187,9 +8178,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) {