summaryrefslogtreecommitdiff
path: root/core/java/android/widget/AnalogClock.java
Commit message (Collapse)AuthorAgeFilesLines
* AnalogClock: Allow subclasses to override the "now" instant.Dan Sandler2021-07-131-3/+17
| | | | | | | | | | | | Allows you to use the (deprecated) AnalogClock widget to display times other than the current system clock time. While we're at it, update the AnalogClock widget assets to contemporary vector drawables. Bug: 177962166 Test: atest AnalogClockTest Change-Id: I69e9e89b8f42030e910086ee79bb5a447a00bb84
* Add a config value for the default of the analog clock flagStevie Kideckel2021-06-251-4/+9
| | | | | | | | | Also, handle this config value being set to 0 by hiding the seconds hand and ticking once per minute. Bug: 191269485 Test: locally Change-Id: Ib2b705437d570d46328174d618ec0de6193212ca
* Schedule time ticks for the next minute when no seconds hand is presentStevie Kideckel2021-06-081-23/+47
| | | | | | | | | | | The TIME_TICK broadcast was removed as it's bad for performance to use it while the view is not visible and adds unneeded overhead. Instead we can use the internal handler callback scheduling method. Bug: 190274204 Test: verified locally with app, including across DST time skip Change-Id: I4eb5e64b16c953baf473331dc7d498de19cfdbc9
* Merge "Add a flag for the fps of the AnalogClock" into sc-devStevie Kideckel2021-05-251-3/+9
|\
| * Add a flag for the fps of the AnalogClockStevie Kideckel2021-05-201-3/+9
| | | | | | | | | | | | Bug: 188414386 Test: tested locally Change-Id: I3e28f63bea6aafa0760c6938b706e44643fc12f3
* | Attaching broadcast receiver on attach/detachSunny Goyal2021-05-191-8/+24
|/ | | | | | | | | | | | | instead of everytime visibility changes > Adding a broadcast receiver makes a synchronous system API call which can delay draw pass > Also removing TIME_TICK broadcast, instead using an internal timer to aboud unnecessary calls while app is stopped Bug: 188574817 Test: Manual Change-Id: I37677aa40189bf4fb75e7e2372bda81ea3e6fda3
* Performance/jank improvements to AnalogClockStevie Kideckel2021-05-121-28/+45
| | | | | | | | | | | | | | | | This addresses rounding of the seconds hand fraction to avoid advancing by inconsistent amounts. It also moves to a less janky 30FPS update rate. This also optimizes seconds ticking to only schedule callbacks as needed and avoids spurious updates to the content description. Also, potential NPE fix and dead code removed. Bug: 186099601 Test: Local testing with sample app Change-Id: I771b4c3f1d18f7836cd42202810a1495d25a9db5
* Apply tints when setting dial/hands to iconsStevie Kideckel2021-04-081-0/+12
| | | | | | Bug: 184731376 Test: local testing with sample app Change-Id: Ib7c1aeaec6f805e93b9a731bc2d34e2182243ae1
* Recycle the TypedArray used in AnalogClock's constructorStevie Kideckel2021-02-251-0/+2
| | | | | | Test: Flashed to local device, AnalogClock widgets worked fine Bug: 177997338 Change-Id: I58edf7643e8f701abc02ce1147a2ae718fde47c7
* Add tint list/mode APIs to AnalogClockStevie Kideckel2021-02-171-0/+363
| | | | | | Bug: 177997338 Test: atest Change-Id: I12846543c4d017e19ec4bccf60eeaf7509534b07
* Add support for time zones to AnalogClockSteven Kideckel2021-02-021-6/+90
| | | | | | | | | | | The format, attribute and method names are analogous to the existing APIs in TextClock. Bug: 177997338 Test: Manual: wrote a local app that uses time zones from XML and RemoteViews.setString, including with null/invalid values Change-Id: Ic40c1c6846e923475b7c26e5ec2912786e046c96
* Add support for seconds hand to AnalogClockSteven Kideckel2021-02-021-10/+104
| | | | | | | Bug: 177997338 Test: manual - wrote app to use runtime apis Change-Id: I05b3ebb19598a4f1d605f9ba62005aaab733666d Merged-In: I05b3ebb19598a4f1d605f9ba62005aaab733666d
* Making time-zone an API constantSuprabh Shukla2020-03-101-1/+1
| | | | | | | | | | This is already effectively an API the way it is documented. Updating all the references of the hard-coded constant. Test: make update-api && make Bug: 151112929 Change-Id: Iadeb03c516215cfc51bc8604b67250348d5a4375
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
* Merge "Switch widgets away from android.text.format.Time"Neil Fuller2019-07-091-14/+24
|\ | | | | | | | | | | am: db31e6d07a Change-Id: I550b2c7ac5e3e5b07eda51c190c354e5236a561e
| * Switch widgets away from android.text.format.TimeNeil Fuller2019-06-181-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android.text.format.Time is limited to 32-bit seconds from the beginning of the Unix epoch and so classes that use it are limited to 1901 - 2038. Switching to java.time avoids this issue. Manual Testing: AnalogClock is deprecated and not used anywhere so difficult to test. DateTimeView is used in the status bar. Behavior was verified with current date/time and also Europe/London around 2019-03-31 01:00 (skip forward) and around 2019-10-27 02:00 (fall back). The time picker in settings uses android.icu.util.Calendar which favored the later time if there are two local times with the same display time (e.g. the fall back case). The "repeat" case was tested with "date @1572137900" to set the clock to "the first" 01:58, then waiting 2 minutes to ensure that the 01:59 -> 01:00 transition occurs correctly. Bug: 16550209 Test: build / boot / treehugger Test: See above Change-Id: Ibadad3041a2e54fe12d347960bf1e0f3ebe10c01
| * Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.widget This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Idf7ccc7a850fa984ea16f91cdd70159087274e5c Merged-In: Ic61019b1df85448a158fc2ba55c326353222c6b9
* | Update core widgets to save attribute source info.Aurimas Liutikas2019-02-071-0/+2
| | | | | | | | | | | | Bug: 111439551 Test: make -j Change-Id: I72997a87122f38b32e38e42a690385acc7d0e521
* | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+4
|/ | | | | | | | | | | | | | | | For packages: android.widget This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ic61019b1df85448a158fc2ba55c326353222c6b9
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-3/+2
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Fix a few view ctors to not call Looper.myLooperJohn Reck2015-10-201-2/+1
| | | | | Bug: 25116730 Change-Id: I4e394c281feef6f7987433298d66f2df11352416
* Deprecate AnalogClock widget, Integer methods on TimePickerViewAlan Viverette2015-03-181-0/+2
| | | | | Bug: 19754178 Change-Id: Ic51c40995ce841040d745070243e483d4d97ce5c
* Allow adding widgets from user profiles.Svetoslav2014-08-061-1/+9
| | | | | | | | | | | | | | | The goal of this change is to enable support for appwidget from user profiles to the user main profile. A user profile is a user which is associated as a child of the main user profile. For example, a user may have a personal (parent) and corporate (child) profile. The device policy should be able to control whether adding a widget from a child profile and given packages is allowed. This change assumes that all packages from managed profiles are white listed. Another change will add the device policy changes. (cherrypicked 8cd27c3c to work around Gerrit issue) Change-Id: I267260b55d74c48b112a29979a9f59eef7a8194e
* Add APIs for obtaining themed Drawable from Theme, ContextAlan Viverette2014-02-031-3/+3
| | | | | BUG: 12611005 Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
* Add View constructor that supplies a default style resourceAlan Viverette2013-09-091-7/+10
| | | | | | | Also updates the constructor of every class that extends View. BUG: 10676369 Change-Id: Ifaf27bf82028d180afa4931c0e906df88d858ac3
* add analog clock attributes to docsScott Main2012-09-261-0/+4
| | | | Change-Id: I70e8a7897f9e076664ea5069ee9e19e458e8b36b
* Accessibility services cannot obtain the source of an event coming from a ↵Svetoslav Ganov2011-10-031-0/+10
| | | | | | | | | | | | | | | root namespace descendant. 1. The user can touch the screen at an arbitrary location potentially crossing the root namespace bounday which will send an accessibility event to accessibility services and they should be able to obtain the event source. Also accessibility ids are guaranteed to be unique in the window. Added a package scoped findViewByAccessibilityId method that dives into nested root namespaces. 2. Added accessibility support to the AnalogClock. bug:5405934 Change-Id: I84edcb554bae41aafcbbc2723c5e62c1ef8a6ddf
* Implement smarter sizing of WRAP_CONTENT windows.Dianne Hackborn2010-12-031-2/+2
| | | | | | | | | | | | | | This extends the view hierarchy's measure pass to allow view to propagate up to their parent additional information besides just their measured size. They can now report that their measured width and/or height should be larger than the size their parent is limiting them to (even though by definition they need to contrain their reported measurements to the limits imposed by the parent). ViewRoot uses this information to determine if it should remeasure the window with a larger size limit to try to make it fit. Change-Id: I90af3b7a8ec45d0a5c003fb009857025209d83eb
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-0/+246
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-031-243/+0
|
* auto import from //depot/cupcake/@132589The Android Open Source Project2009-03-031-10/+7
|
* auto import from //depot/cupcake/@137055The Android Open Source Project2009-03-021-7/+10
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-101-0/+2
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-171-1/+1
|
* Initial ContributionThe Android Open Source Project2008-10-211-0/+241