summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-01-24 04:14:00 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-01-24 04:14:00 +0000
commit99eff853a073ece8f251e36115e90c46705a4dfd (patch)
tree9fc00e1ffc323bac7cf3bd890c8caf396b1300af
parentc51fbec471d28c0569e58df7e45109e0d90e4ae0 (diff)
parentbacad701091563e3cde35d556752dbfc54875f13 (diff)
Merge "Explicit delay in View.java"
-rw-r--r--core/java/android/view/View.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 9d0c9f42697f..483280e36bd1 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -13994,7 +13994,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (clickable) {
setPressed(true, x, y);
}
- checkForLongClick(0, x, y);
+ checkForLongClick(ViewConfiguration.getLongPressTimeout(), x, y);
return true;
}
}
@@ -14735,7 +14735,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mHasPerformedLongPress = false;
if (!clickable) {
- checkForLongClick(0, x, y);
+ checkForLongClick(ViewConfiguration.getLongPressTimeout(), x, y);
break;
}
@@ -14759,7 +14759,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
} else {
// Not inside a scrolling container, so show the feedback right away
setPressed(true, x, y);
- checkForLongClick(0, x, y);
+ checkForLongClick(ViewConfiguration.getLongPressTimeout(), x, y);
}
break;
@@ -25434,7 +25434,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
}
- private void checkForLongClick(int delayOffset, float x, float y) {
+ private void checkForLongClick(long delay, float x, float y) {
if ((mViewFlags & LONG_CLICKABLE) == LONG_CLICKABLE || (mViewFlags & TOOLTIP) == TOOLTIP) {
mHasPerformedLongPress = false;
@@ -25444,8 +25444,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mPendingCheckForLongPress.setAnchor(x, y);
mPendingCheckForLongPress.rememberWindowAttachCount();
mPendingCheckForLongPress.rememberPressedState();
- postDelayed(mPendingCheckForLongPress,
- ViewConfiguration.getLongPressTimeout() - delayOffset);
+ postDelayed(mPendingCheckForLongPress, delay);
}
}
@@ -27035,7 +27034,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
public void run() {
mPrivateFlags &= ~PFLAG_PREPRESSED;
setPressed(true, x, y);
- checkForLongClick(ViewConfiguration.getTapTimeout(), x, y);
+ final long delay =
+ ViewConfiguration.getLongPressTimeout() - ViewConfiguration.getTapTimeout();
+ checkForLongClick(delay, x, y);
}
}