Add more guidance for how to write setStateDescription

This is to address the concern from API council for accessibility state
api. See b/143652980 for more details.

Bug: 143652980
Test: not needed for javadoc change
Change-Id: I3f219b7838b72fda86a957ebd14c063175657d47
This commit is contained in:
yingleiw
2019-11-13 17:56:20 -08:00
parent 34c56f7942
commit ac95cd587b

View File

@@ -10348,6 +10348,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* the user. It is a supplement to the boolean states (for example, checked/unchecked) and
* it is used for customized state description (for example, "wifi, connected, three bars").
* State description changes frequently while content description should change less often.
* State description should be localized. For android widgets which have default state
* descriptions, app developers can call this method to override the state descriptions.
* Setting state description to null restores the default behavior.
*
* @param stateDescription The state description.
* @see #getStateDescription()