Merge "Opt out default focus highlight for TV." into oc-dev
am: 6a08dfab0e
Change-Id: I94e6a4fc0d7ab06fc5fd477c0d0160e061e8b3ae
This commit is contained in:
@@ -3887,6 +3887,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
private Drawable mDefaultFocusHighlight;
|
||||
private Drawable mDefaultFocusHighlightCache;
|
||||
private boolean mDefaultFocusHighlightSizeChanged;
|
||||
/**
|
||||
* True if the default focus highlight is needed on the target device.
|
||||
*/
|
||||
private static boolean sUseDefaultFocusHighlight;
|
||||
|
||||
private String mTransitionName;
|
||||
|
||||
@@ -4464,6 +4468,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
|
||||
sAutoFocusableOffUIThreadWontNotifyParents = targetSdkVersion < Build.VERSION_CODES.O;
|
||||
|
||||
sUseDefaultFocusHighlight = context.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_useDefaultFocusHighlight);
|
||||
|
||||
sCompatibilityDone = true;
|
||||
}
|
||||
}
|
||||
@@ -19677,7 +19684,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
||||
final boolean hasFocusStateSpecified = background == null || !background.isStateful()
|
||||
|| !background.hasFocusStateSpecified();
|
||||
return !isInTouchMode() && getDefaultFocusHighlightEnabled() && hasFocusStateSpecified
|
||||
&& isAttachedToWindow();
|
||||
&& isAttachedToWindow() && sUseDefaultFocusHighlight;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,4 +36,7 @@
|
||||
<!-- The default gravity for the picture-in-picture window.
|
||||
Currently, this maps to Gravity.BOTTOM | Gravity.RIGHT -->
|
||||
<integer name="config_defaultPictureInPictureGravity">0x55</integer>
|
||||
|
||||
<!-- Whether the device uses the default focus highlight when focus state isn't specified. -->
|
||||
<bool name="config_useDefaultFocusHighlight">false</bool>
|
||||
</resources>
|
||||
|
||||
@@ -2830,4 +2830,7 @@
|
||||
specified name exists on the device, autofill will be disabled by default.
|
||||
-->
|
||||
<string name="config_defaultAutofillService" translatable="false"></string>
|
||||
|
||||
<!-- Whether the device uses the default focus highlight when focus state isn't specified. -->
|
||||
<bool name="config_useDefaultFocusHighlight">true</bool>
|
||||
</resources>
|
||||
|
||||
@@ -427,6 +427,7 @@
|
||||
<java-symbol type="integer" name="config_mdc_initial_max_retry" />
|
||||
<java-symbol type="integer" name="config_keepPreloadsMinDays" />
|
||||
<java-symbol type="bool" name="config_hasPermanentDpad" />
|
||||
<java-symbol type="bool" name="config_useDefaultFocusHighlight" />
|
||||
|
||||
<java-symbol type="color" name="tab_indicator_text_v4" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user