Merge "Update scrollIndicators XML enums to match View constants" into mnc-dev
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index e1f1816..9e16b4b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4265,12 +4265,13 @@
}
mForegroundInfo.mInsidePadding = a.getBoolean(attr,
mForegroundInfo.mInsidePadding);
+ break;
case R.styleable.View_scrollIndicators:
final int scrollIndicators =
- a.getInt(attr, SCROLL_INDICATORS_NONE) & SCROLL_INDICATORS_PFLAG3_MASK;
+ (a.getInt(attr, 0) << SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT)
+ & SCROLL_INDICATORS_PFLAG3_MASK;
if (scrollIndicators != 0) {
- viewFlagValues |= scrollIndicators;
- viewFlagMasks |= SCROLL_INDICATORS_PFLAG3_MASK;
+ mPrivateFlags3 |= scrollIndicators;
initializeScrollIndicators = true;
}
break;
@@ -4884,7 +4885,8 @@
* @attr ref android.R.styleable#View_scrollIndicators
*/
public void setScrollIndicators(@ScrollIndicators int indicators) {
- setScrollIndicators(indicators, SCROLL_INDICATORS_PFLAG3_MASK);
+ setScrollIndicators(indicators,
+ SCROLL_INDICATORS_PFLAG3_MASK >>> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT);
}
/**
@@ -4954,36 +4956,6 @@
>>> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT;
}
- /**
- * Returns whether the specified scroll indicator is enabled.
- * <p>
- * Multiple indicator types may be queried by passing the logical OR of the
- * desired types. If multiple types are specified, the return value
- * represents whether they are all enabled.
- *
- * @param direction the indicator direction, or the logical OR of multiple
- * indicator directions. One or more of:
- * <ul>
- * <li>{@link #SCROLL_INDICATOR_TOP}</li>
- * <li>{@link #SCROLL_INDICATOR_BOTTOM}</li>
- * <li>{@link #SCROLL_INDICATOR_LEFT}</li>
- * <li>{@link #SCROLL_INDICATOR_RIGHT}</li>
- * <li>{@link #SCROLL_INDICATOR_START}</li>
- * <li>{@link #SCROLL_INDICATOR_END}</li>
- * </ul>
- * @return {@code true} if the specified indicator(s) are enabled,
- * {@code false} otherwise
- * @attr ref android.R.styleable#View_scrollIndicators
- */
- public boolean isScrollIndicatorEnabled(int direction) {
- // Shift and sanitize input.
- direction <<= SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT;
- direction &= SCROLL_INDICATORS_PFLAG3_MASK;
-
- // All of the flags must be set.
- return (mPrivateFlags3 & direction) == direction;
- }
-
ListenerInfo getListenerInfo() {
if (mListenerInfo != null) {
return mListenerInfo;
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 726401c..0d7d868 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2722,21 +2722,21 @@
for example "top|bottom". -->
<attr name="scrollIndicators">
<!-- No scroll indicators are displayed. -->
- <flag name="none" value="0x0000" />
+ <flag name="none" value="0x00" />
<!-- Displays top scroll indicator when view can be scrolled up. -->
- <flag name="top" value="0x0100" />
+ <flag name="top" value="0x01" />
<!-- Displays bottom scroll indicator when vew can be scrolled down. -->
- <flag name="bottom" value="0x0200" />
+ <flag name="bottom" value="0x02" />
<!-- Displays left scroll indicator when vew can be scrolled left. -->
- <flag name="left" value="0x0400" />
+ <flag name="left" value="0x04" />
<!-- Displays right scroll indicator when vew can be scrolled right. -->
- <flag name="right" value="0x0800" />
+ <flag name="right" value="0x08" />
<!-- Displays right scroll indicator when vew can be scrolled in the
start direction. -->
- <flag name="start" value="0x1000" />
+ <flag name="start" value="0x10" />
<!-- Displays right scroll indicator when vew can be scrolled in the
end direction. -->
- <flag name="end" value="0x2000" />
+ <flag name="end" value="0x20" />
</attr>
</declare-styleable>