summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2010-10-10 12:44:18 -0700
committerGilles Debunne <debunne@google.com>2010-10-10 12:44:18 -0700
commite507a9e4af9cd8a7333e2951649ac106829f7a45 (patch)
treec00ad45c3177b04eb2bae119e29558c599bfa7b0
parentd14230f1c7aa5073db9d291f8fbd6da5491955b9 (diff)
downloadframeworks_base-e507a9e4af9cd8a7333e2951649ac106829f7a45.zip
frameworks_base-e507a9e4af9cd8a7333e2951649ac106829f7a45.tar.gz
frameworks_base-e507a9e4af9cd8a7333e2951649ac106829f7a45.tar.bz2
Voice input replaces selected text.
Bug 3068128 Hiding controllers no longer stops text selection. Change-Id: Ie00c99948b3a14ce8a4a2a93c064c0635cadc993
-rw-r--r--core/java/android/widget/TextView.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 138aefa..5be52c4 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -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) {