summaryrefslogtreecommitdiff
path: root/core/java/android/widget/CompoundButton.java
Commit message (Collapse)AuthorAgeFilesLines
* Enable use of of CompoundButtons in RemoteViewsSteven Kideckel2021-02-031-0/+28
| | | | | | | | | | | | | | | | | This change adds @RemoteView and @RemotableViewMethod to the relevant views we'd like to enable. New APIs have been added to set Icons in CompooundButton and Switch. onCheckedChange support will be added in a follow-up CL. CompoundButton.setChecked and RadioGroup.check aren't directly remotable since RemoteViews will need to control those calls directly to ensure that any onCheckedChange listeners aren't triggered by RemoteViews actions. Bug: 179245670 Test: manual, atest Change-Id: I85e2aee62cf39ed008d9c9c1fece813293841fbd
* Delay sending accessibility events a little for temporarily detached viewyingleiw2020-07-141-3/+5
| | | | | | | | | | | | | | | | | | | In RV, a view could be temporarily detached in one draw cycle. Accessibility events sent during this time will be lost. To prevent the events from being lost, we will set a flag when a view is detached by parent. And when sending accessibility events for detached view, we will delay it a little by ViewConfiguration.getSendRecurringAccessibilityEventsInterval. This way, if the view is attached in one draw cycle, the events will be sent out. Also add more setStateDescription() in CompoundButton to for safer code. (this is not the cause of this bug though). Fix: 151125936 Test: tested that the bug is fixed. Change-Id: Iffca8c87bad4fa2f66862b966e351562d77d6d76
* 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
* change CompoundButton button to use the accessibility state APIyingleiw2019-11-191-2/+42
| | | | | | | Test: tested with updated talkback (see CL/274237446). It works as before. Change-Id: I928350c8bc9112252e8b8a703c465489f03fde11
* Added BlendMode equivalent APIs to replace deprecated PorterDuffNader Jawad2019-04-151-12/+41
| | | | | | | | | | | | | 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
* Update core widgets to save attribute source info.Aurimas Liutikas2019-02-071-0/+2
| | | | | | Bug: 111439551 Test: make -j Change-Id: I72997a87122f38b32e38e42a690385acc7d0e521
* @InspectableProperty coverage for android.widgetAshley Rose2019-02-041-0/+5
| | | | | | | | | 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
* Minor Content Capture-related changes.Felipe Leme2018-11-141-3/+8
| | | | | | | | | | | | | - Refactored onProvideStructureForAssistOrAutofillOrViewCapture() into a common, hidden onProvideStructure(viewFor) method on View that (hopefully :-) makes it easier to understand / extend. - Renamed / documentted some methods on TextView. Bug: 111276913 Test: atest CtsAutoFillServiceTestCases CtsAssistTestCases \ AssistFrameworksCoreTests:AssistStructureTest Change-Id: I328ce3f26a42e7408015cc0014a3f707801ebeb9
* 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
* Revert "Move A11y events throttling away from View(RootImpl)"Eugene Susla2018-01-261-1/+1
| | | | | | | | This reverts commit e4d31b3c103045d5b2b141a05084dced595cc64f. Fixes: 71904218 Test: presubmit Change-Id: Id73bde1a0c11696cf561c84cde027cdca4c6a00f
* Move A11y events throttling away from View(RootImpl)Eugene Susla2018-01-091-1/+1
| | | | | | | | | | | | ..and also extract common code into a common superclass This also preserves the order of the throttled events (TYPE_VIEW_SCROLLED & TYPE_WINDOW_CONTENT_CHANGED) with regards to the rest of events by flushing any pending throttled events immediately if another event is requested to be sent. Test: ensure no new a11y CTS failures Change-Id: I948a16716521974393aaa1cf822d0a0324e9ce3a
* Minor fixes on Autofill Framework:Felipe Leme2017-04-241-2/+0
| | | | | | | | | | | | | | | | | | - Removed default implementation of onProvideAutofillVirtualStructure() that was using accessibility API (it's useless because without the View calling AutofillManager.notifyViewEntered(), it would never be triggered). - Fixed obsolete TODOs. - Removed obsolete service class name constant. - Removed unused debug constant. Test: CtsAutoFillServiceTestCases (on oc-dev) pass Test: manual verification (on oc-dev) Bug: 37078783 Bug: 33197203 Bug: 33802548 Bug: 35956626 Change-Id: I834d34b8af8bf0d781dc7e0ffcd6e600bfa2d183
* Simplified autofill() methods by returning void instead of boolean.Felipe Leme2017-03-291-6/+5
| | | | | | Test: CtsAutoFillServiceTestCases pass Change-Id: Ic94e6686e291fed60ef6715bd160f9b568bf0ea6
* TRON log important auto-fill eventsPhilip P. Moltmann2017-03-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example log from android.autofillservice.cts.LoginActivityTest#testAutoFill#testAutoFillOneDatasetAndSave (translated from numbers of human readable string): AUTOFILL_SESSION_STARTED package=android.autofillservice.cts AUTOFILL_REQUEST type=TYPE_SUCCESS package=android.autofillservice.cts FIELD_AUTOFILL_SERVICE=android.autofillservice.cts FIELD_AUTOFILL_NUM_DATASETS=1 AUTOFILL_FILL_UI type=TYPE_ACTION package=android.autofillservice.cts FIELD_AUTOFILL_NUM_DATASETS=1 FIELD_AUTOFILL_FILTERTEXT_LEN=0 AUTOFILL_DATASET_APPLIED package=android.autofillservice.cts FIELD_AUTOFILL_NUM_VALUES=2 FIELD_AUTOFILL_NUM_VIEWS_FILLED=2 AUTOFILL_SAVE_UI package=android.autofillservice.cts FIELD_AUTOFILL_NUM_IDS=2 AUTOFILL_DATA_SAVE_REQUEST type=TYPE_SUCCESS package=android.autofillservice.cts FIELD_AUTOFILL_SERVICE=android.autofillservice.cts AUTOFILL_SESSION_FINISHED package=android.autofillservice.cts Test: Ran auto-fill tests and looked at event log. Change-Id: I58aaa58e4435e7d04c8cd91878411943d3eb13de
* Merge "Make it clear which type of AutoFillValue is set"Philip P. Moltmann2017-03-141-1/+7
|\
| * Make it clear which type of AutoFillValue is setPhilip P. Moltmann2017-03-141-1/+7
| | | | | | | | | | | | | | throw and handle errors if the wrong value is set for a view Test: android.autofillservice.cts.AutofillValueTest Change-Id: Ida80da7913a210bede6c47d6b7a6f215a012a84c
* | Merge "Renamed ViewStructure.setSanitized() to setDataIsSensitive()."TreeHugger Robot2017-03-141-1/+1
|\ \ | |/ |/|
| * Renamed ViewStructure.setSanitized() to setDataIsSensitive().Felipe Leme2017-03-141-1/+1
| | | | | | | | | | | | | | | | Bug: 36126001 Test: CtsAutoFillServiceTestCases pass Test: m update-api Change-Id: I182355b63d8743cd8cd8612f29a9269e258283c2
* | Fix a few auto fill ussuesSvet Ganov2017-03-131-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Ensure clicking on a focused view brings up autofill if needed 2. Notify the autofill manager in a couple of cases we missed 3. Renamed the AutofillManager app facing APIs to better reflect what they do and added a API for the app to cancel the autofill interaction 4. Fix view structure dispatch where the ordering of children for autofill was mixed with ordering of direct view children - the autofill children may be indirect as views can be marked not important for autofill 5. Show scrollbars only if there are more fill options than want is shown 6. Show only three fill options and the rest can be accessed with a scroll 7. Remove the list divider to allow fill items to control all fill window content 8. Renamed the autofill manager internal service classes to xxAutofillxx 9. Fixed a comment that was not addressed in a previous CL 10. Showing max three fill options - rest needs a scroll 11. Make sure fill UI shown when filter with no matches is changed to filter with some matches 12. Make sure the fill window has a shadow Test: Autofill CTS tests pass and manual bug:36038929 bug:36040101 bug:36149166 bug:36034681 bug:36126001 bug:36035654 Change-Id: Ic8726146fc3c0a19d3e536becdd63fb65622136e
* Replaced auto-fill by autofill to keep it consistent with API style.Felipe Leme2017-03-091-10/+10
| | | | | | | | | | | | | | This change will affects 2 types of apps: autofill service implementations and apps that use autofill APIs. Since just the former is known to be used at the moment, we're not trying to keep backward compatibility with the latter. Bug: 35956626 Test: CtsAutoFillServiceTestCases pass Test: android.provider.SettingsBackupTest pass Change-Id: Ia720083508716deae9e887f9faa7ae7c5a82f471
* Replace AutoFillType by view constants.Felipe Leme2017-03-071-3/+2
| | | | | | | | | | | | | | | Now that AutoFillType does have any logic (since the "subType" logic was moved to AutoFillHint), it makes more sense to get rid of the type and use constants directly. This change creates the contants and "pseudo-deprecate" the old stuff: it's still available because some clients are using it, but it will be removed once they migrate. Bug: 35956626 Test: CtsAutoFillServiceTestCases pass Change-Id: I0efe7f0cc101c86164a18c85903bb871e1f13ba2
* Added auto-fill support for DatePicker and TimePicker.Felipe Leme2017-03-011-1/+1
| | | | | | | | | | | | Also fixed some getAutoFillType() implementations to return null when the view is disabled. Bug: 33550221 Bug: 35840787 Test: CtsAutoFillServiceTestCases (with new tests) pass Test: m update-api Change-Id: I46acc1fb106cf2153515cc1c9567b34cfabd1c62
* Added sanitization for CompoundButton and RadioGroup.Felipe Leme2017-02-221-0/+14
| | | | | | | | Bug: 33269702 Bug: 33550221 Test: CtsAutoFillServiceTestCases (with new tests) pass Change-Id: Ie2c8d2784227371588aa02973b8ef3ac1a6950aa
* Added auto-fill listeners for RadioGroup and CompoundButton.Felipe Leme2017-02-211-3/+6
| | | | | | | | Bug: 33550221 Bug: 3380254 Test: CtsAutoFillServiceTestCases pass Change-Id: Ia9293d16b6fe092552e19563328697c298451f8a
* Refined session management so Save can be automatically called.Felipe Leme2017-02-061-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is yet another big refactoring: - AutoFillManager keeps track of its current AutoFillSession. - Views call AFM.startSession(View) when they can trigger autofill. (virtual views can call it as well). At this point, the manager sets an AutoFillSession, gets the activity token, and passes it to the service. - Subsequent calls to AFM.start() will be ignored since the session is set. - When the Activity is gone, it calls AFM.finishSession(). - Simlilarly, virtual views could call it as well. - Added getAutoFillValue() to View. - Removed AFM.updateAutoFillInput(childId): virtual views should now call startSession(childId) to start a session, and use the VirtualViewListener callbacks for updates. - Change AutoFillValue to use String (which is immutable) instead of CharSequence for text values. - Check if view is enabled before auto-filling. - Removed 'cmd autofill fill' since it would require the appCallback - Automatically dismiss the snack bar after 30s - Moved the "don't change autofill value when autofilling" Inception logic into the service side. - Etc... BUG: 34819567 BUG: 33269702 BUG: 31001899 Test: manual verification Test: CtsAutoFillServiceTestCases passes Change-Id: I5fad928d4d666701302049d142026a1efa7291cd
* Improved AutoFill Save workflow.Felipe Leme2017-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the onProvideAutoFillStructure() methods can be called twice: to auto-fill an activity and to save the activity's data in the service. The problem with this approach is that when the save workflow is called, the activity might have been gone. Hence, a proper approach is to keep the initial AssistStructure data in the system_service memory, watch for view changes, and then passed the new structure back to the AutoFillService. A side effect of this change is that we need another way to determine if the view is sanitized or not. For "standard" views, that will be defined based on whether the view content come from a resource or not, but that logic is not implemented yet (for now, all views will be considered sanitized, except for TextView passwords). For "custom" views (such as WebView), this logic is responsibility of the view implementation, through the newChild() method, which now takes a flag (whose value could be AUTO_FILL_FLAG_SANITIZED for sanitized views). The SaveCallback.onSuccess() method was simplified: it does not need a list of saved ids anymore the auto-fill UI will not use it anymore. Another side effect is that the Save notification is gone - until it's attached again, it can be test by using: adb shell cmd autofill save Finally, hook AutoFillUI on ACTION_CLOSE_SYSTEM_DIALOGS events. BUG: 33269702 BUG: 31001899 Test: manual verification Test: CtsAutoFillServiceTestCases passes Change-Id: I907a7e21d1b3cd1ab6dec3a08d144a52655da46f
* YAMAFFR - Yet Another Major AutoFill Framework RefactoringFelipe Leme2017-01-101-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Explicitly split View methods into Assist and AutoFill methods, rather than use an overloaded method that takes flags. - Simarly, renamed ASSIST_FLAG_SANITIZED_TEXT and ASSIST_FLAG_NON_SANITIZED_TEXT flags to AUTO_FILL_FLAG_TYPE_FILL and AUTO_FILL_FLAG_TYPE_SAVE respectively. - Created a AutoFillUI class to host the auto-fill bar and other UI affordances. - Moved the temporary notifications to AutoFillUI (eventually that class will host the real UI). - Moved FillData to android.app.view.autofill package. - Split IAutoFillCallback in 2 (IAutoFillAppCallback and IAutoFillServerCallback, residing at the app and system_server respectively), so service cannot fill the app directly (which lets the framework control the UI). - Moved assist's IResultReceiver to AutoFillServiceImpl so system_server can act as a mediator between the AutoFillService implementation and the app being auto-filled. - Replaced FillData and FillableInputFields by a bunch of new objects: - FillResponse contains a group of Datasets, each representing different values that can be used to auto-fill an activity (for example, different user accounts), optional id of fields the service is interested to save, and an optional bundle for service-side extras. - Dataset contains a name, Fields, and an optional bundle for service-side extras. - Fields contain an AutoFillId (parcelable) and a value (Bundle) - Changed the temporary notifications to emulate the new workflow: - Initial notification requests the auto-fill data but do not auto-fill. - Once service calls back, a new notification is shown with the results. - Then if the user selects a dataset, the activity is auto-filled with it. - It also shows a notification to emulate what can be saved. - Created an VirtualViewDelegate for views that uses a virtual hierarchy for assist data. - Added new methods on ViewStructure to add children with virtual ids. - Added 2 methods on View to support auto-fill: - autoFill(Bundle) to auto-fill the view. - getAutoFillType() to return how the view can be auto-filled. - AutoFillType defines the input fields that support auto-fill: - Text fields (like EditText) - Toggle fields (like CheckBox) - Lists (like RadioGroup) - AutoFillType can also have a sub-type representing its semantic (for now only text fields have it, and it's the same as getInputType()). - etc :-) Bug: 31001899 Test: manual verification Change-Id: I2dd2fdedcb3ecd1e4403f9c32fa644cb914e186f
* Add @Nullable to CompoundButton#setOnCheckedChangeListener().Jason Long2016-12-011-1/+1
| | | | | | Test: n/a Change-Id: I3db93bfcfba528e7271be21356e585e9f9a0799d
* Fix import statements in android.widget package.Aurimas Liutikas2016-10-111-6/+6
| | | | | | | Additionally this CL removes spaces at the end of the line. Test: code still compiles. Change-Id: I1ce98b4e70aa3ae614f87966c3bc6181fa4389a4
* Remove @Nullable from primitive/void types.Ian Rogers2016-05-101-1/+0
| | | | | | | Erroneous use of @Nullable caught by error prone. Bug: 27723540 Change-Id: Ida76b2fd221142980da5c018e57c96cc6920ebc0
* Add consistent @NonNull annotations for drawable callbacksAlan Viverette2016-03-111-1/+1
| | | | | Bug: 27599515 Change-Id: I33fdc5392302403bfff9cc74a8226173ec962af6
* Invalidate when Drawable.setState() returns trueAlan Viverette2015-09-041-8/+5
| | | | | | | | Ensures views that manage drawables follow the contract set forth in the Drawable.setState() documentation. Bug: 23792020 Change-Id: I4e5a449cd6535487873fd8443da50555c38e8ed9
* Resolve CompoundButton's foreground drawable for layout direction changeDoris Liu2015-06-301-0/+11
| | | | | | | | | | | This CL adds a step to resolve CompoundButton's foreground drawable when layout direction has been changed. Prior this CL, only background drawable of the button resolves its layout direciton in respond to system wide layout direction change. This CL makes the foreground and background drawables consistent in layout direciton. Bug: 16376848 Change-Id: I9a4eb1e010e6ab61ef8684005508bd36486ec1f3
* Use new hierarchy viewer protocol in all View subclassesSiva Velusamy2015-05-071-1/+10
| | | | | | | | | 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
* Remove unused imports in frameworks/base.John Spurlock2015-02-281-1/+0
| | | | Change-Id: I031443de83f93eb57a98863001826671b18f3b17
* Add @ResourceInt annotations on APIsTor Norbye2015-02-181-0/+1
| | | | Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
* Add missing accessor to CompoundDrawable, clean up javadocAlan Viverette2015-02-121-27/+35
| | | | | | | Removes button resource identifier field, which was useless. Bug: 19369976 Change-Id: I1a34cb981a2db93d10e93ff954294f76ea604006
* First quick implementation of auto assist data.Dianne Hackborn2015-02-061-2/+5
| | | | | | | | | | | | | | Introduce new AssistData class that contains all data the framework automatically generates for assist. Currently populated with a very simple tree structure representing the app's view hierarchy. Reworked how we populate the class name for accessibility info, so this is provided through a new method call on View that subclasses can override. This method is also used to populate the class name in AssistData. Change-Id: Ibd0acdc8354727d4291473283b5e4b70894905dc
* Fix accessibility delegationAlan Viverette2015-01-071-4/+6
| | | | | | | | | | | | | | | Ensures that delegate code is run last. Previously, calling the super method from an accessibility delegate set on a widget would only run code in the widget's parent. Next, the delegate code would run. Finally, the widget's code would run. As a result, the widget code would override any data supplied by the delegate. By moving all overridden code to internal methods, we ensure that the call chain for super includes the widget's parent code followed by the widget's code. The delegate code will always run last. BUG: 17641433 Change-Id: Ib9d403156c1fc4fb04f65f3c126d1277a44b3740
* Update drawable state after updating tint listAlan Viverette2014-10-291-0/+6
| | | | | BUG: 18155988 Change-Id: Ic536027a54c10b2082fbc22476530165b76e2c59
* Play CLICK sound effect when compound buttons are clickedAlan Viverette2014-10-271-8/+10
| | | | | | | | Also plays the sound effect when the switch changes state as a result of dragging, since that's effectively the same as the click action. BUG: 16308311 Change-Id: Ic187ece2a8190082617f5ac7aaf05c3511fa80b5
* Translate compound button drawable by scroll positionAlan Viverette2014-10-171-1/+9
| | | | | BUG: 18028674 Change-Id: Iaba848642b87f0d134c6a6c57e5756d883e45904
* Clean up view drawable tinting methods, fix default modesAlan Viverette2014-09-141-10/+21
| | | | | | | Calling setTint now only modifies the tint. It won't force a mode change. BUG: 17494736 Change-Id: I91392634869ed23981d8e61a403bb2be42aa7a07
* Separate tint and tintMode propertiesAlan Viverette2014-08-061-13/+14
| | | | | BUG: 16054922 Change-Id: I820fb857b671faf9eb27612e470e820c5c4cd6b5
* Clean up view tinting APIs, tileModeX/Y attribute docsAlan Viverette2014-07-221-33/+16
| | | | | | BUG: 16400590 BUG: 16403307 Change-Id: Ie924815a39eb0e683d1982b08ec478ed3edbfb7b
* Fix switch & slider anim, make View drawable hotspot API publicAlan Viverette2014-06-181-4/+2
| | | | | BUG: 15287810 Change-Id: Ic7a9549dc1ba8afd07e9a196371ed349a54aaf2f
* Add attributes and accessors for tinting View drawablesAlan Viverette2014-06-171-12/+123
| | | | | | | Also cleans up handling in setters for managed drawables. BUG: 15391544 Change-Id: Idc08f7eaea0050feb6403566985a6d58185b81f8
* Support hotspots in View drawablesAlan Viverette2014-06-131-0/+10
| | | | | BUG: 15285217 Change-Id: Iad44454fe16ac27ed20b9c17ae2df69649339eed
* TouchFeedbackDrawable is now RippleDrawableAlan Viverette2014-05-191-1/+1
| | | | Change-Id: I59f5f04b73089215c6320560556ac21beb03db06