Loading Android.mk +4 −4 Original line number Diff line number Diff line Loading @@ -403,10 +403,10 @@ framework_docs_SDK_CURRENT_DIR:=$(framework_docs_SDK_VERSION)_r$(framework_docs_ framework_docs_SDK_PREVIEW:=0 ## Latest ADT version identifiers, for reference from published docs framework_docs_ADT_VERSION:=0.9.5 framework_docs_ADT_DOWNLOAD:=ADT-0.9.5.zip framework_docs_ADT_BYTES:=3372982 framework_docs_ADT_CHECKSUM:=227ec538359fbe417ccde7f0ad614a96 framework_docs_ADT_VERSION:=0.9.6 framework_docs_ADT_DOWNLOAD:=ADT-0.9.6.zip framework_docs_ADT_BYTES:=7456339 framework_docs_ADT_CHECKSUM:=ea45d271be52b87b5dd1c9fb17536223 framework_docs_LOCAL_DROIDDOC_OPTIONS += \ -hdf sdk.version $(framework_docs_SDK_VERSION) \ Loading core/java/android/text/format/DateUtils.java +56 −33 Original line number Diff line number Diff line Loading @@ -497,7 +497,7 @@ public class DateUtils } } } else if (duration < WEEK_IN_MILLIS && minResolution < WEEK_IN_MILLIS) { count = duration / DAY_IN_MILLIS; count = getNumberOfDaysPassed(time, now); if (past) { if (abbrevRelative) { resId = com.android.internal.R.plurals.abbrev_num_days_ago; Loading @@ -521,6 +521,24 @@ public class DateUtils return String.format(format, count); } /** * Returns the number of days passed between two dates. * * @param date1 first date * @param date2 second date * @return number of days passed between to dates. */ private synchronized static long getNumberOfDaysPassed(long date1, long date2) { if (sThenTime == null) { sThenTime = new Time(); } sThenTime.set(date1); int day1 = Time.getJulianDay(date1, sThenTime.gmtoff); sThenTime.set(date2); int day2 = Time.getJulianDay(date2, sThenTime.gmtoff); return Math.abs(day2 - day1); } /** * Return string describing the elapsed time since startTime formatted like * "[relative time/date], [time]". Loading Loading @@ -1655,18 +1673,22 @@ public class DateUtils public static CharSequence getRelativeTimeSpanString(Context c, long millis, boolean withPreposition) { String result; long now = System.currentTimeMillis(); long span = now - millis; synchronized (DateUtils.class) { if (sNowTime == null) { sNowTime = new Time(); } if (sThenTime == null) { sThenTime = new Time(); } sNowTime.set(now); sThenTime.set(millis); String result; int prepositionId; if (span < DAY_IN_MILLIS && sNowTime.weekDay == sThenTime.weekDay) { // Same day Loading @@ -1690,6 +1712,7 @@ public class DateUtils Resources res = c.getResources(); result = res.getString(prepositionId, result); } } return result; } Loading core/java/android/text/method/PasswordTransformationMethod.java +11 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher sp.removeSpan(vr[i]); } removeVisibleSpans(sp); sp.setSpan(new ViewReference(view), 0, 0, Spannable.SPAN_POINT_POINT); } Loading Loading @@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher int pref = TextKeyListener.getInstance().getPrefs(v.getContext()); if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) { if (count > 0) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } removeVisibleSpans(sp); if (count == 1) { sp.setSpan(new Visible(sp, this), start, start + count, Loading @@ -125,13 +124,17 @@ implements TransformationMethod, TextWatcher if (sourceText instanceof Spannable) { Spannable sp = (Spannable) sourceText; removeVisibleSpans(sp); } } } private static void removeVisibleSpans(Spannable sp) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } } } } private static class PasswordCharSequence implements CharSequence, GetChars Loading core/java/android/view/View.java +3 −0 Original line number Diff line number Diff line Loading @@ -8210,6 +8210,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * Cancels any animations for this view. */ public void clearAnimation() { if (mCurrentAnimation != null) { mCurrentAnimation.detach(); } mCurrentAnimation = null; } Loading core/java/android/view/animation/Animation.java +33 −1 Original line number Diff line number Diff line Loading @@ -255,6 +255,38 @@ public abstract class Animation implements Cloneable { mOneMoreTime = true; } /** * Cancel the animation. Cancelling an animation invokes the animation * listener, if set, to notify the end of the animation. * * If you cancel an animation manually, you must call {@link #reset()} * before starting the animation again. * * @see #reset() * @see #start() * @see #startNow() * @hide */ public void cancel() { if (mStarted && !mEnded) { if (mListener != null) mListener.onAnimationEnd(this); mEnded = true; } // Make sure we move the animation to the end mStartTime = Long.MIN_VALUE; mMore = mOneMoreTime = false; } /** * @hide */ public void detach() { if (mStarted && !mEnded) { mEnded = true; if (mListener != null) mListener.onAnimationEnd(this); } } /** * Whether or not the animation has been initialized. * Loading Loading @@ -745,10 +777,10 @@ public abstract class Animation implements Cloneable { if (expired) { if (mRepeatCount == mRepeated) { if (!mEnded) { mEnded = true; if (mListener != null) { mListener.onAnimationEnd(this); } mEnded = true; } } else { if (mRepeatCount > 0) { Loading Loading
Android.mk +4 −4 Original line number Diff line number Diff line Loading @@ -403,10 +403,10 @@ framework_docs_SDK_CURRENT_DIR:=$(framework_docs_SDK_VERSION)_r$(framework_docs_ framework_docs_SDK_PREVIEW:=0 ## Latest ADT version identifiers, for reference from published docs framework_docs_ADT_VERSION:=0.9.5 framework_docs_ADT_DOWNLOAD:=ADT-0.9.5.zip framework_docs_ADT_BYTES:=3372982 framework_docs_ADT_CHECKSUM:=227ec538359fbe417ccde7f0ad614a96 framework_docs_ADT_VERSION:=0.9.6 framework_docs_ADT_DOWNLOAD:=ADT-0.9.6.zip framework_docs_ADT_BYTES:=7456339 framework_docs_ADT_CHECKSUM:=ea45d271be52b87b5dd1c9fb17536223 framework_docs_LOCAL_DROIDDOC_OPTIONS += \ -hdf sdk.version $(framework_docs_SDK_VERSION) \ Loading
core/java/android/text/format/DateUtils.java +56 −33 Original line number Diff line number Diff line Loading @@ -497,7 +497,7 @@ public class DateUtils } } } else if (duration < WEEK_IN_MILLIS && minResolution < WEEK_IN_MILLIS) { count = duration / DAY_IN_MILLIS; count = getNumberOfDaysPassed(time, now); if (past) { if (abbrevRelative) { resId = com.android.internal.R.plurals.abbrev_num_days_ago; Loading @@ -521,6 +521,24 @@ public class DateUtils return String.format(format, count); } /** * Returns the number of days passed between two dates. * * @param date1 first date * @param date2 second date * @return number of days passed between to dates. */ private synchronized static long getNumberOfDaysPassed(long date1, long date2) { if (sThenTime == null) { sThenTime = new Time(); } sThenTime.set(date1); int day1 = Time.getJulianDay(date1, sThenTime.gmtoff); sThenTime.set(date2); int day2 = Time.getJulianDay(date2, sThenTime.gmtoff); return Math.abs(day2 - day1); } /** * Return string describing the elapsed time since startTime formatted like * "[relative time/date], [time]". Loading Loading @@ -1655,18 +1673,22 @@ public class DateUtils public static CharSequence getRelativeTimeSpanString(Context c, long millis, boolean withPreposition) { String result; long now = System.currentTimeMillis(); long span = now - millis; synchronized (DateUtils.class) { if (sNowTime == null) { sNowTime = new Time(); } if (sThenTime == null) { sThenTime = new Time(); } sNowTime.set(now); sThenTime.set(millis); String result; int prepositionId; if (span < DAY_IN_MILLIS && sNowTime.weekDay == sThenTime.weekDay) { // Same day Loading @@ -1690,6 +1712,7 @@ public class DateUtils Resources res = c.getResources(); result = res.getString(prepositionId, result); } } return result; } Loading
core/java/android/text/method/PasswordTransformationMethod.java +11 −8 Original line number Diff line number Diff line Loading @@ -51,6 +51,8 @@ implements TransformationMethod, TextWatcher sp.removeSpan(vr[i]); } removeVisibleSpans(sp); sp.setSpan(new ViewReference(view), 0, 0, Spannable.SPAN_POINT_POINT); } Loading Loading @@ -100,10 +102,7 @@ implements TransformationMethod, TextWatcher int pref = TextKeyListener.getInstance().getPrefs(v.getContext()); if ((pref & TextKeyListener.SHOW_PASSWORD) != 0) { if (count > 0) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } removeVisibleSpans(sp); if (count == 1) { sp.setSpan(new Visible(sp, this), start, start + count, Loading @@ -125,13 +124,17 @@ implements TransformationMethod, TextWatcher if (sourceText instanceof Spannable) { Spannable sp = (Spannable) sourceText; removeVisibleSpans(sp); } } } private static void removeVisibleSpans(Spannable sp) { Visible[] old = sp.getSpans(0, sp.length(), Visible.class); for (int i = 0; i < old.length; i++) { sp.removeSpan(old[i]); } } } } private static class PasswordCharSequence implements CharSequence, GetChars Loading
core/java/android/view/View.java +3 −0 Original line number Diff line number Diff line Loading @@ -8210,6 +8210,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * Cancels any animations for this view. */ public void clearAnimation() { if (mCurrentAnimation != null) { mCurrentAnimation.detach(); } mCurrentAnimation = null; } Loading
core/java/android/view/animation/Animation.java +33 −1 Original line number Diff line number Diff line Loading @@ -255,6 +255,38 @@ public abstract class Animation implements Cloneable { mOneMoreTime = true; } /** * Cancel the animation. Cancelling an animation invokes the animation * listener, if set, to notify the end of the animation. * * If you cancel an animation manually, you must call {@link #reset()} * before starting the animation again. * * @see #reset() * @see #start() * @see #startNow() * @hide */ public void cancel() { if (mStarted && !mEnded) { if (mListener != null) mListener.onAnimationEnd(this); mEnded = true; } // Make sure we move the animation to the end mStartTime = Long.MIN_VALUE; mMore = mOneMoreTime = false; } /** * @hide */ public void detach() { if (mStarted && !mEnded) { mEnded = true; if (mListener != null) mListener.onAnimationEnd(this); } } /** * Whether or not the animation has been initialized. * Loading Loading @@ -745,10 +777,10 @@ public abstract class Animation implements Cloneable { if (expired) { if (mRepeatCount == mRepeated) { if (!mEnded) { mEnded = true; if (mListener != null) { mListener.onAnimationEnd(this); } mEnded = true; } } else { if (mRepeatCount > 0) { Loading