Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java

Issue 2023133002: Use Event to render feedback animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java b/remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java
index 45dab790a2c3012a486115f42e55466289824cec..a599fd6b12871f474798c52290a791e8e48da8c9 100644
--- a/remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java
+++ b/remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java
@@ -42,10 +42,10 @@ public class TapGestureDetector {
}
/** The listener to which notifications are sent. */
- private OnTapListener mListener;
+ private final OnTapListener mListener;
/** Handler used for posting tasks to be executed in the future. */
- private Handler mHandler;
+ private final Handler mHandler;
/** The maximum number of fingers seen in the gesture. */
private int mPointerCount = 0;
@@ -81,9 +81,10 @@ public class TapGestureDetector {
public void handleMessage(Message message) {
TapGestureDetector detector = mDetector.get();
if (detector != null) {
+ detector.mTapCancelled = true;
detector.mListener.onLongPress(
detector.mPointerCount, detector.mInitialPoint.x, detector.mInitialPoint.y);
- detector.mTapCancelled = true;
+ detector.mInitialPoint = null;
}
}
}
@@ -102,9 +103,9 @@ public class TapGestureDetector {
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
reset();
+ trackDownEvent(event);
// Cause a long-press notification to be triggered after the timeout.
Lambros 2016/06/01 23:51:37 Blank line before comment.
Hzj_jie 2016/06/02 02:21:37 Done.
mHandler.sendEmptyMessageDelayed(0, ViewConfiguration.getLongPressTimeout());
- trackDownEvent(event);
mPointerCount = 1;
break;

Powered by Google App Engine
This is Rietveld 408576698