diff --git a/lib/java/com/google/android/material/timepicker/ClockHandView.java b/lib/java/com/google/android/material/timepicker/ClockHandView.java index 57a313d6598..1227259dee5 100644 --- a/lib/java/com/google/android/material/timepicker/ClockHandView.java +++ b/lib/java/com/google/android/material/timepicker/ClockHandView.java @@ -316,9 +316,7 @@ public boolean onTouchEvent(MotionEvent event) { break; case MotionEvent.ACTION_MOVE: case MotionEvent.ACTION_UP: - final int deltaX = (int) (x - downX); - final int deltaY = (int) (y - downY); - int distance = (deltaX * deltaX) + (deltaY * deltaY); + double distance = Math.hypot(x - downX, y - downY); isInTapRegion = distance > scaledTouchSlop; // If we saw a down/up pair without the value changing, assume // this is a single-tap selection and force a change.