diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-04-17 20:15:16 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-04-17 20:15:22 +0000 |
| commit | ff4e132cff6a118cf98a04e24faf571c550ee79d (patch) | |
| tree | ccde0ef0523b2b0ceae3af9c8bb96ef77e0ae6cf /core/java/android | |
| parent | 3b41407f1908cea425b753003b31a16b49bad822 (diff) | |
| parent | ba590a694bf110f3cc1240adbd358de61910f6a5 (diff) | |
Merge "Enhance Chronometer to better support Swedish countdowns." into oc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/widget/Chronometer.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/java/android/widget/Chronometer.java b/core/java/android/widget/Chronometer.java index 6c6079f202fd..d11c03ad6878 100644 --- a/core/java/android/widget/Chronometer.java +++ b/core/java/android/widget/Chronometer.java @@ -17,11 +17,13 @@ package android.widget; import android.content.Context; +import android.content.Intent; import android.content.res.TypedArray; import android.icu.text.MeasureFormat; import android.icu.text.MeasureFormat.FormatWidth; import android.icu.util.Measure; import android.icu.util.MeasureUnit; +import android.net.Uri; import android.os.SystemClock; import android.text.format.DateUtils; import android.util.AttributeSet; @@ -148,6 +150,22 @@ public class Chronometer extends TextView { } /** + * @return whether this is the final countdown + */ + public boolean isTheFinalCountDown() { + try { + getContext().startActivity( + new Intent(Intent.ACTION_VIEW, Uri.parse("https://youtu.be/9jK-NcRmVcw")) + .addCategory(Intent.CATEGORY_BROWSABLE) + .addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT + | Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT)); + return true; + } catch (Exception e) { + return false; + } + } + + /** * Set the time that the count-up timer is in reference to. * * @param base Use the {@link SystemClock#elapsedRealtime} time base. |
