summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorAndrei Stingaceanu <stg@google.com>2015-05-14 10:23:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-14 10:23:09 +0000
commitc398adf81c5167fc4b9b9cefd1550bc8fd4a54e6 (patch)
tree197746e77b80ae832be59fd5d1954bdb3bfdcd04 /core/java/android
parente738bb67224b47b1caa87e474d5530759aa1eea0 (diff)
parent77b9c388c9e1d34fedcd08c5c227fb072bd06786 (diff)
downloadframeworks_base-c398adf81c5167fc4b9b9cefd1550bc8fd4a54e6.zip
frameworks_base-c398adf81c5167fc4b9b9cefd1550bc8fd4a54e6.tar.gz
frameworks_base-c398adf81c5167fc4b9b9cefd1550bc8fd4a54e6.tar.bz2
Merge "Fix floating toolbar popping frequently after Replace/Copy" into mnc-dev
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/widget/Editor.java6
-rw-r--r--core/java/android/widget/TextView.java10
2 files changed, 9 insertions, 7 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index f281218..55f4562 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -3721,9 +3721,9 @@ public class Editor {
public void show() {
super.show();
- final long durationSinceCutOrCopy =
- SystemClock.uptimeMillis() - TextView.LAST_CUT_OR_COPY_TIME;
- if (durationSinceCutOrCopy < RECENT_CUT_COPY_DURATION) {
+ final long durationSinceLastCutCopyOrTextChanged =
+ SystemClock.uptimeMillis() - TextView.sLastCutCopyOrTextChangedTime;
+ if (durationSinceLastCutCopyOrTextChanged < RECENT_CUT_COPY_DURATION) {
startSelectionActionModeWithoutSelection();
}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 6fd5ebf..3df218e 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -292,8 +292,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// New state used to change background based on whether this TextView is multiline.
private static final int[] MULTILINE_STATE_SET = { R.attr.state_multiline };
- // System wide time for last cut or copy action.
- static long LAST_CUT_OR_COPY_TIME;
+ // System wide time for last cut, copy or text changed action.
+ static long sLastCutCopyOrTextChangedTime;
/**
* @hide
@@ -8005,6 +8005,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
* through a thunk.
*/
void sendAfterTextChanged(Editable text) {
+ sLastCutCopyOrTextChangedTime = 0;
+
if (mListeners != null) {
final ArrayList<TextWatcher> list = mListeners;
final int count = list.size();
@@ -9291,7 +9293,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
}
}
stopSelectionActionMode();
- LAST_CUT_OR_COPY_TIME = 0;
+ sLastCutCopyOrTextChangedTime = 0;
}
}
@@ -9311,7 +9313,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
ClipboardManager clipboard = (ClipboardManager) getContext().
getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setPrimaryClip(clip);
- LAST_CUT_OR_COPY_TIME = SystemClock.uptimeMillis();
+ sLastCutCopyOrTextChangedTime = SystemClock.uptimeMillis();
}
/**