Commit 01ff17f3 by Oliver Woodman Committed by Andrew Lewis

Merge pull request #7304 from AChep:patch-1

PiperOrigin-RevId: 309395364
parent 2fa2fb73
...@@ -195,7 +195,6 @@ public class DefaultTimeBar extends View implements TimeBar { ...@@ -195,7 +195,6 @@ public class DefaultTimeBar extends View implements TimeBar {
private final Formatter formatter; private final Formatter formatter;
private final Runnable stopScrubbingRunnable; private final Runnable stopScrubbingRunnable;
private final CopyOnWriteArraySet<OnScrubListener> listeners; private final CopyOnWriteArraySet<OnScrubListener> listeners;
private final int[] locationOnScreen;
private final Point touchPosition; private final Point touchPosition;
private final float density; private final float density;
...@@ -249,7 +248,6 @@ public class DefaultTimeBar extends View implements TimeBar { ...@@ -249,7 +248,6 @@ public class DefaultTimeBar extends View implements TimeBar {
scrubberPaint = new Paint(); scrubberPaint = new Paint();
scrubberPaint.setAntiAlias(true); scrubberPaint.setAntiAlias(true);
listeners = new CopyOnWriteArraySet<>(); listeners = new CopyOnWriteArraySet<>();
locationOnScreen = new int[2];
touchPosition = new Point(); touchPosition = new Point();
// Calculate the dimensions and paints for drawn elements. // Calculate the dimensions and paints for drawn elements.
...@@ -755,10 +753,7 @@ public class DefaultTimeBar extends View implements TimeBar { ...@@ -755,10 +753,7 @@ public class DefaultTimeBar extends View implements TimeBar {
} }
private Point resolveRelativeTouchPosition(MotionEvent motionEvent) { private Point resolveRelativeTouchPosition(MotionEvent motionEvent) {
getLocationOnScreen(locationOnScreen); touchPosition.set((int) motionEvent.getX(), (int) motionEvent.getY());
touchPosition.set(
((int) motionEvent.getRawX()) - locationOnScreen[0],
((int) motionEvent.getRawY()) - locationOnScreen[1]);
return touchPosition; return touchPosition;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment