From a789325a0fddadd80f9ce24f020c3eab3e6c6489 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Tue, 12 May 2015 16:25:47 -0700 Subject: [PATCH] Update scrollIndicators XML enums to match View constants Bug: 21027462 Change-Id: I41e503e218253cf63bc44a82345f8b086261e379 --- core/java/android/view/View.java | 40 +++++--------------------------- core/res/res/values/attrs.xml | 14 +++++------ 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index e1f1816d993bb..9e16b4bd37932 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -4265,12 +4265,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } 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 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @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 @@ public class View implements Drawable.Callback, KeyEvent.Callback, >>> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT; } - /** - * Returns whether the specified scroll indicator is enabled. - *

- * 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: - *

- * @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 0b96d22eb4952..004bb2f38d555 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -2722,21 +2722,21 @@ for example "top|bottom". --> - + - + - + - + - + - + - +