summaryrefslogtreecommitdiff
path: root/core/java/android/widget/ProgressBar.java
Commit message (Collapse)AuthorAgeFilesLines
* Use state description of "in progress" for indeterminte ProgressBaryingleiw2021-05-051-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | When a ProgressBar is set to indeterminate, we assign a default state description of "in progress" to AccessibilityNodeInfo. We only assign default state description to AccessibilityNodeInfo, but not to View. If the developer sets a custom state description through either View API or AccessibilityNodeInfo API, the custom state description will be used for both indeterminate and determinate progressbar instead of default ones. We put the "in progress" in state description instead of content description to prevent accessibility services like talkback from automatically assigning a state description when the state description is null or empty. Fix: b/182582617 Test: tested manually with a material linear indeterminate progressbar with talkback. It says "In progress, progress bar". Unit tests added. Change-Id: I24477622bf8992f80a19b8df3a6032bac7f9d5bd
* Expose tint lists and other runtime functionality to RemoteViewsStevie Kideckel2021-02-221-0/+2
| | | | | | Bug: 180086170 Test: sample app using new methods, atest Change-Id: I5aa5476d95d6c9fb992c4548d97f577234d747a7
* Add RemoteViews.setBlendMode and expose target methodsStevie Kideckel2021-02-121-0/+4
| | | | | | Bug: 180086170 Test: sample app,atest Change-Id: I2323d297412afb64d142bddb6608978ccc8d292f
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-2/+2
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+2
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-2/+2
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Add accessibility manager enabled check in progressbaryingleiw2020-08-311-4/+4
| | | | | | | | | | | | | | | | | formatStateDescription() in onProgressRefresh() is causing performance degradation with accessibility off. Note that stateDescription is set in onInitializeAccessibilityNodeInfo to ensure that accessibility always get the update-to-date stateDescription. Otherwise, stateDescription might be stale on first accessibility focus and the user might get wrong information. Fix: b/166215147 Test: tested with talkback enabled from the beginning or from the middle. Change-Id: I9fb99b479b172d87c8d0fa1b8765dab53445b993
* Avoid churning NumberFormat instances in ProgressBarChristopher Tate2020-07-161-2/+13
| | | | | | | | | | Don't construct a new locale-specific NumberFormat every time a progress bar's state is refreshed or updated. We now do this only when necessary due to a locale change. Bug: 161264248 Test: atest ProgressBarTest Change-Id: I349ec28268a3471184e5746b164f81428ad80cc8
* [ProgressBar] Fix: Media volume bar indicates a wrong valueTetsutoki Shiozawa2020-02-141-0/+15
| | | | | | | | | | | | | | | | | | | | Symptom: Media volume bar shows non-zero value even during the mute state. Root cause: A request for updating progress of ProgressBar has 2 kind of updating ways, animated and non-animated. If a non-animated request is invoked before completing an animated request, the visual progress can be overwritten by the old animated request. As a result, the visual progress value becomes different from the actual value. Solution: A running animation on the primary progress should be canceled before handling a new non-animated request. Bug: 148759348 Test: atest CtsWidgetTestCases:ProgressBarTest Change-Id: I569dbea4c6346ecfff8141d8378b4952fb1fa530
* Set stateDescription during ProgressBar initializationyingleiw2020-01-221-3/+4
| | | | | | | | | | | onProgressRefresh() is only called when the progress changes. So we should set stateDescription during initialization. Test: tested with talkback test app. Without this change, the stateDescription is not available when we focus on the seekbar. After the change, the stateDescription is avaiable. Change-Id: I56071ed28e6917c6bd14162884b10440c6955751
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-061-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: I41e12e425284e74561c6b61663241df364ae54a1
* Adopt the accessibility state api in progress baryingleiw2019-11-141-2/+50
| | | | | | | | | | | | | | | When the progress changes, instead of sending TYPE_VIEW_SELECTED event, CONTENT_CHANGE_TYPE_STATE_DESCRIPTION event sent. Developers can override onInitializeAccessibilityNodeInfo() and call info.setStateDescription() to provide customized state description. Bug: 123346875 Test: The default implementation of StateDescriptionFormatter maintains the current format talkback uses. Also tested on talkback_test to set customized state description based on progress. Note: this change should not be merged until CL/275509401 (google3) is merged. Change-Id: I8f1a0c91c55a498593c360483827ed050656d943
* remove accessibility event throttling in Progressbaryingleiw2019-10-211-32/+1
| | | | | | | | | | | | | | | The current throttling is not good: when we update progress periodically at an interval smaller than 200ms, no progress is announced except for the last 100% in talkback. We will reply on the throttling when sending out state change events after adopting the accessibility state api: we only send out state change events when the state description actually changes. Bug: 143079143 Test: tested with talkback test when updating progress at different frequencies. Change-Id: I7480a3420130fc42645df17074b093cdced430ae
* Added BlendMode equivalent APIs to replace deprecated PorterDuffNader Jawad2019-04-151-20/+147
| | | | | | | | | | | | | variants Updated various framework Views to have equivalent BlendMode APIs to replace the deprecated PorterDuff equivalents. Updated InspectableProperty annotations to refer to the same xml attributes as the original tintmode APIs Bug: 126726419 Test: Added CTS tests to verify new BlendMode APIs Change-Id: Id9ab36d3d4d29f351250723e9d13d49bc6062c83
* All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
| | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Merge "Removing reflection access ProgressBar#mDuration"Shep Shapard2019-02-151-3/+38
|\
| * Removing reflection access ProgressBar#mDurationshepshapard2019-02-141-3/+38
| | | | | | | | | | | | | | | | | | | | | | | | For the following reasons: 1. Developers can set this via XML 2. Using this value is inferior to setting an indeterminate drawable that implements Animatable. Fixes: 124052713 Test: No new implementation, so no tests. Change-Id: Ie1e23f75328cce5d8f4d317625d8f38c0a166352
* | Merge "Update core widgets to save attribute source info."Aurimas Liutikas2019-02-111-0/+2
|\ \
| * | Update core widgets to save attribute source info.Aurimas Liutikas2019-02-071-0/+2
| |/ | | | | | | | | | | Bug: 111439551 Test: make -j Change-Id: I72997a87122f38b32e38e42a690385acc7d0e521
* | Merge "Allow reflection access to ProgressBar#mOnlyIndeterminate."TreeHugger Robot2019-02-111-1/+1
|\ \
| * | Allow reflection access to ProgressBar#mOnlyIndeterminate.Sumir Kataria2019-02-091-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | I think this one is fine to punt. The field applies to the default progress bar, which can only be indeterminate. However, if someone can't customize their themes and styles, they may end up in a situation where they need this to be different and there is no public API for it. Making a public API is messy because it is really hard to reason about and the behavior would be a no-op much of the time. It's better to avoid adding confusion for the majority of developers. Test: N/A Bug: 124049927 Change-Id: Ie63429831ec803d2d3c50464176c4e6f8a30ec33
* / Make ProgressBar#getCurrentDrawable() publicMihai Popa2019-02-111-3/+13
|/ | | | | | | | | | | | The CL adds ProgressBar#getCurrentDrawable() to the public API, and transitions mCurrentDrawable in ProgressBar to dark gray list. Developers can use getCurrentDrawable(), setProgressDrawable() and setIndeterminateDrawable() instead of accessing mCurrentDrawable directly. Bug: 123769441 Test: none Change-Id: Ia9876f97dc2ec2c69902b8281cd7876b516dbdd4
* Enable changing ProgressBar min/max width/heightMihai Popa2019-02-061-3/+84
| | | | | | | | | | The CL adds getters and setters for the min/max width/height attributes of ProgressBar. This could be already specified in xml, but not post inflation. Bug: 123769470 Test: atest android.widget.cts.ProgressBarTest Change-Id: I3bb4992da0c34cd88078588253ef6789fa8f1856
* Merge "Restrict reflection for ProgressBar#mIndeterminate"TreeHugger Robot2019-02-051-1/+2
|\
| * Restrict reflection for ProgressBar#mIndeterminateAdam Powell2019-02-051-1/+2
| | | | | | | | | | Change-Id: Ie60de396a7f57be57caa9abdec5e24f3f8a04b10 Fixes: 123769456
* | @InspectableProperty coverage for android.widgetAshley Rose2019-02-041-0/+18
|/ | | | | | | | | A few getters for view properties have been added where they were missing. CTS tests for the new APIs are pending in b/123894719. Test: m framework Bug: 120492712 Change-Id: I743ce693d384eaf749ced3db7f81bda7d19ed275
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-211-0/+14
| | | | | | | | | | | | | | | | 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 bug and docs assuming progressBar min is 0 instead of getMin()Chet Haase2018-03-281-6/+8
| | | | | | | | | This code and docs predates the existence of get/setMin() on ProgressBar, should have been updated when we introduced the new min property. Test: Ran TalkBack Bug: 74357845 Change-Id: I318f26bb8ecacc5ecdbf7d026d8568f871cf2369
* docs: Update ProgressBar JavaDoc commentsJoe Fernandez2017-04-251-88/+46
| | | | | | | | | | | | - link to material design guidelines for a visual example of determinate/indeterminate patterns - reword introduction for clarity - remove confusing code example, in favor of a concise explanation of determinate/indeterminate uses - adds a note about not using progress bar in a dialog Test: docs change only. Tested with a docs build Change-Id: I872f7a647eafa6d0f1652549ad2d9d2db4fc81e3
* Add color temperature preference for Night DisplayChristine Franks2017-03-201-0/+7
| | | | | | | | Bug: 32463283 Test: adb shell settings put secure night_display_color_temperature XXXX, where XXXX is {0, 2900, 4000, 7000}, and the temperatures outside the valid range are capped at the min/max, respectively. Change-Id: I322c0a907b30742fc312a9938fd0c47f679e580b
* Add methods to query animation stateChet Haase2017-01-301-0/+12
| | | | | | | | | | | | | Testing utilities want the ability to know whether things in the UI are in flux and they need to wait before testing on-screen values. These changes (a subset of what's needed, but will have to do for a start) allow querying of ActivityTransitions and ProgressBar, two common/difficult pieces in the puzzle. Test: CTS tests at ag/1835467 Bug: 30978257 Provide view transition Api to prevent flaky tests Change-Id: If63b3d0dde2178d826ac1dbfad0fc50e5ed9a780
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-2/+1
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Merge "Added min support to ProgressBar and SeekBar"Keyvan Amiri2016-10-111-9/+65
|\
| * Added min support to ProgressBar and SeekBarKeyvan Amiri2016-10-041-9/+65
| | | | | | | | | | | | | | ProgressBar, AbsSeekBar, and SeekBar now support min attributes for the lower range of the progress bar. It used to be 0 by default. Change-Id: I3308eff80f4c7f58a940dec9cc517dcdff4a1d83
* | Scale bitmap shaders for target densityAlan Viverette2016-10-071-8/+8
|/ | | | | | | | | | | | Also fixes progress bar sample tile to reflect density and ensures that ProgressBar.tileify() clones inner drawables into the correct density. Bug: 31841123 Test: BitmapDrawableTest#testPreloadDensity() Test: ThemeHostTest Test: Visual inspection of ApiDemos Change-Id: I9dcb9817d8d91d61ff0215987247e9e7fb089c46
* API review feedback for ProgressBarAlan Viverette2016-04-201-1/+5
| | | | | Bug: 28296059 Change-Id: Icb9cfdc799391735a497b16290fa780dddd76e36
* Fall back to setting the level of the entire progress drawableAlan Viverette2016-04-121-0/+7
| | | | | Bug: 27775791 Change-Id: I3f5bd31bdd4a970898899a9a64c1bdc23097b8e7
* Refinement for onVisibilityAggregatedAdam Powell2016-03-161-3/+3
| | | | | | | | | | | | Change the args for onVisibilityAggregated to a single boolean for visibility to the user. Also fix an ordering bug that could trigger a view background drawable call to setVisible before the view would respond true to verifyDrawable, which caused issues with some apps. Bug 27461617 Bug 27689884 Change-Id: I58bdc7c4364264f7fa0863689ba2b76df904ef81
* Add View#onVisibilityAggregatedAdam Powell2016-03-151-38/+14
| | | | | | | | | | | | | | | | There's a common misconception (even across the framework) that View#onVisibilityChanged determines and reports visibility on 'this' up to the changed view and the total visibility within the window. Knowing this is useful for things like starting/stopping animations. onVisibilityChanged only reports the visibility for the specific changed view, not the effects that would have down the tree. Add onVisibilityAggregated to report what some code thought it was getting already, and move ImageView and ProgressBar over to using it. Bug 27461617 Change-Id: I433f41de453e27a53f907f1d9805350f30f31de9
* Add consistent @NonNull annotations for drawable callbacksAlan Viverette2016-03-111-2/+2
| | | | | Bug: 27599515 Change-Id: I33fdc5392302403bfff9cc74a8226173ec962af6
* Stop ProgressBar animations when not visibleAdam Powell2016-03-041-16/+44
| | | | | | | | | Propagate setVisible calls to current drawable. Take window visibility into account when determining drawable visibility. Bug 27461595 Change-Id: Ia1de1d1686f26c2cf27630c5bde70f23c2c332bd
* Fix @code escapesNeil Fuller2015-12-021-1/+1
| | | | | | | | | The body of {@code} must not be HTML escaped. This is one of several changes that fix the source in conjunction with a doclava fix. Bug: 25757239 Change-Id: Ib38a0fa2dd2a3d68e467f78a812071e763d7e881
* Smooth progress bar animationsAlan Viverette2015-09-231-34/+114
| | | | | | | Removes smooth progress bar hack from volume dialog. Bug: 23566299 Change-Id: Iafa32538b4f92705c4c1ca2a02145c078add2532
* Invalidate when Drawable.setState() returns trueAlan Viverette2015-09-041-4/+11
| | | | | | | | Ensures views that manage drawables follow the contract set forth in the Drawable.setState() documentation. Bug: 23792020 Change-Id: I4e5a449cd6535487873fd8443da50555c38e8ed9
* am aa439dc3: am eb5d77e9: am 1f861997: Merge "Use new hierarchy viewer ↵Siva Velusamy2015-05-081-0/+13
|\ | | | | | | | | | | | | protocol in all View subclasses" into mnc-dev * commit 'aa439dc38c6e276f763ba3127ad020938ba620f8': Use new hierarchy viewer protocol in all View subclasses
| * Use new hierarchy viewer protocol in all View subclassesSiva Velusamy2015-05-071-0/+13
| | | | | | | | | | | | | | | | | | A previous CL introduced a new way of encoding view properties for use by heirarchy viewer. This CL updates all views using the old @ExportedProperty annotation to use this new method. The older mechanism will be removed in a subsequent CL. Change-Id: I6cc23b90cd9da1c6ce89b4caffe54874db203452
* | Add API for set progress on ProgressBar/SeekBarMaxim Bogatov2015-05-071-0/+13
|/ | | | | | b/12912083 Change-Id: I3a7807f0ac40220139da21248d539fa796d0a544
* D-pad should be able to push seek bar to 0 or max valueAlan Viverette2015-04-161-11/+11
| | | | | Bug: 20198766 Change-Id: Ibd48919fea9915e38a1f6746fa43ea5125d0d087
* Update rating bar assets for MaterialAlan Viverette2015-04-081-18/+61
| | | | | | | | Also ensures that ProgressBar doesn't create a tiled drawable when it doesn't actually need to. Bug: 19574820 Change-Id: Id3b9b00e05a56055ed4b19def7044a0bf38e8ec1
* am f401d637: am 947b5029: am 8391e03b: Merge "ProgressBar: Fix error of ↵Adam Powell2015-04-071-3/+1
|\ | | | | | | | | | | | | process bar cannot update on some condition." * commit 'f401d63796d9a7f81e8d1a4adf6ae2615faa7d91': ProgressBar: Fix error of process bar cannot update on some condition.