Add attr allowClickWhenDisabled for the new API View#setAllowClickWhenDisabled

Fix: 152628656
Test: Manual
Change-Id: I10d149b618dfc0f06d5e395e8d053dce2f5df452
This commit is contained in:
Priyank Singh
2020-03-27 15:09:16 -07:00
parent f0d53133f7
commit 911dd88ca6
4 changed files with 32 additions and 0 deletions

View File

@@ -289,6 +289,7 @@ package android {
field public static final int allowAudioPlaybackCapture = 16844289; // 0x1010601
field public static final int allowBackup = 16843392; // 0x1010280
field public static final int allowClearUserData = 16842757; // 0x1010005
field public static final int allowClickWhenDisabled = 16844325; // 0x1010625
field public static final int allowEmbedded = 16843765; // 0x10103f5
field public static final int allowNativeHeapPointerTagging = 16844307; // 0x1010613
field public static final int allowParallelSyncs = 16843570; // 0x1010332

View File

@@ -728,6 +728,7 @@ import java.util.function.Predicate;
* </p>
*
* @attr ref android.R.styleable#View_accessibilityHeading
* @attr ref android.R.styleable#View_allowClickWhenDisabled
* @attr ref android.R.styleable#View_alpha
* @attr ref android.R.styleable#View_background
* @attr ref android.R.styleable#View_clickable
@@ -5586,6 +5587,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
viewFlagMasks |= CLICKABLE;
}
break;
case com.android.internal.R.styleable.View_allowClickWhenDisabled:
setAllowClickWhenDisabled(a.getBoolean(attr, false));
break;
case com.android.internal.R.styleable.View_longClickable:
if (a.getBoolean(attr, false)) {
viewFlagValues |= LONG_CLICKABLE;
@@ -12140,6 +12144,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* Enables or disables click events for this view when disabled.
*
* @param clickableWhenDisabled true to make the view clickable, false otherwise
*
* @attr ref android.R.styleable#View_allowClickWhenDisabled
*/
public void setAllowClickWhenDisabled(boolean clickableWhenDisabled) {
if (clickableWhenDisabled) {

View File

@@ -3182,6 +3182,9 @@
<!-- Whether or not this view is a heading for accessibility purposes. -->
<attr name="accessibilityHeading" format="boolean"/>
<!-- Whether or not allow clicks on disabled view. -->
<attr name="allowClickWhenDisabled" format="boolean"/>
<!-- Sets the color of the spot shadow that is drawn when the view has a positive Z or
elevation value.
<p>

View File

@@ -3075,6 +3075,28 @@
<!-- @hide -->
<public name="config_customSessionPolicyProvider" />
</public-group>
<!-- ===============================================================
Resources added in version S of the platform
NOTE: add <public> elements within a <public-group> like so:
<public-group type="attr" first-id="0x01010531">
<public name="exampleAttr1" />
<public name="exampleAttr2" />
</public-group>
To add a new public-group block, choose an id value that is 1 greater
than the last of that item above. For example, the last "attr" id
value above is 0x01010530, so the public-group of attrs below has
the id value of 0x01010531.
=============================================================== -->
<eat-comment />
<public-group type="attr" first-id="0x01010625">
<public name="allowClickWhenDisabled" />
</public-group>
<!-- ===============================================================
DO NOT ADD UN-GROUPED ITEMS HERE