From 2d0e87b64402459d89adfd004083a748f81a0391 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Tue, 13 Jul 2010 10:14:24 -0700 Subject: [PATCH] Cosmetic changes around TextView. Fixed some warnings in the code. Change-Id: Id19395031a1ab41edcc47e3dc8cd9479c6e19f83 --- core/java/android/text/Selection.java | 4 ++-- core/java/android/view/AbsSavedState.java | 4 ++-- core/java/android/view/MotionEvent.java | 2 +- core/java/android/widget/TextView.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/java/android/text/Selection.java b/core/java/android/text/Selection.java index bb98bce67cee8..13cb5e6e305c2 100644 --- a/core/java/android/text/Selection.java +++ b/core/java/android/text/Selection.java @@ -417,8 +417,8 @@ public class Selection { } } - private static final class START implements NoCopySpan { }; - private static final class END implements NoCopySpan { }; + private static final class START implements NoCopySpan { } + private static final class END implements NoCopySpan { } /* * Public constants diff --git a/core/java/android/view/AbsSavedState.java b/core/java/android/view/AbsSavedState.java index 840d7c170bd8a..6ad33dd25d45c 100644 --- a/core/java/android/view/AbsSavedState.java +++ b/core/java/android/view/AbsSavedState.java @@ -54,7 +54,7 @@ public abstract class AbsSavedState implements Parcelable { */ protected AbsSavedState(Parcel source) { // FIXME need class loader - Parcelable superState = (Parcelable) source.readParcelable(null); + Parcelable superState = source.readParcelable(null); mSuperState = superState != null ? superState : EMPTY_STATE; } @@ -75,7 +75,7 @@ public abstract class AbsSavedState implements Parcelable { = new Parcelable.Creator() { public AbsSavedState createFromParcel(Parcel in) { - Parcelable superState = (Parcelable) in.readParcelable(null); + Parcelable superState = in.readParcelable(null); if (superState != null) { throw new IllegalStateException("superState must be null"); } diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java index ae8c21dd666bb..35e229aec1cd4 100644 --- a/core/java/android/view/MotionEvent.java +++ b/core/java/android/view/MotionEvent.java @@ -722,7 +722,7 @@ public final class MotionEvent implements Parcelable { * * @param pointerId The identifier of the pointer to be found. * @return Returns either the index of the pointer (for use with - * {@link #getX(int) et al.), or -1 if there is no data available for + * {@link #getX(int)} et al.), or -1 if there is no data available for * that pointer identifier. */ public final int findPointerIndex(int pointerId) { diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index a5cb151764e73..0ce81640ebc91 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -7709,14 +7709,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mOffsetX = (bounds.left + bounds.right) / 2.0f - x; mOffsetY = bounds.top - mCursorControllerVerticalOffset - y; - mOnDownTimerStart = System.currentTimeMillis(); + mOnDownTimerStart = event.getEventTime(); } } break; } case MotionEvent.ACTION_UP : { - int time = (int) (System.currentTimeMillis() - mOnDownTimerStart); + int time = (int) (event.getEventTime() - mOnDownTimerStart); if (time <= ViewConfiguration.getTapTimeout()) { // A tap on the controller is not grabbed, move the cursor instead