Loading core/java/android/view/View.java +6 −34 Original line number Original line Diff line number Diff line Loading @@ -4265,12 +4265,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } mForegroundInfo.mInsidePadding = a.getBoolean(attr, mForegroundInfo.mInsidePadding = a.getBoolean(attr, mForegroundInfo.mInsidePadding); mForegroundInfo.mInsidePadding); break; case R.styleable.View_scrollIndicators: case R.styleable.View_scrollIndicators: final int 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) { if (scrollIndicators != 0) { viewFlagValues |= scrollIndicators; mPrivateFlags3 |= scrollIndicators; viewFlagMasks |= SCROLL_INDICATORS_PFLAG3_MASK; initializeScrollIndicators = true; initializeScrollIndicators = true; } } break; break; Loading Loading @@ -4884,7 +4885,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @attr ref android.R.styleable#View_scrollIndicators * @attr ref android.R.styleable#View_scrollIndicators */ */ public void setScrollIndicators(@ScrollIndicators int indicators) { public void setScrollIndicators(@ScrollIndicators int indicators) { setScrollIndicators(indicators, SCROLL_INDICATORS_PFLAG3_MASK); setScrollIndicators(indicators, SCROLL_INDICATORS_PFLAG3_MASK >>> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT); } } /** /** Loading Loading @@ -4954,36 +4956,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, >>> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT; >>> 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() { ListenerInfo getListenerInfo() { if (mListenerInfo != null) { if (mListenerInfo != null) { return mListenerInfo; return mListenerInfo; Loading core/res/res/values/attrs.xml +7 −7 Original line number Original line Diff line number Diff line Loading @@ -2722,21 +2722,21 @@ for example "top|bottom". --> for example "top|bottom". --> <attr name="scrollIndicators"> <attr name="scrollIndicators"> <!-- No scroll indicators are displayed. --> <!-- 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. --> <!-- 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. --> <!-- 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. --> <!-- 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. --> <!-- 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 <!-- Displays right scroll indicator when vew can be scrolled in the start direction. --> start direction. --> <flag name="start" value="0x1000" /> <flag name="start" value="0x10" /> <!-- Displays right scroll indicator when vew can be scrolled in the <!-- Displays right scroll indicator when vew can be scrolled in the end direction. --> end direction. --> <flag name="end" value="0x2000" /> <flag name="end" value="0x20" /> </attr> </attr> </declare-styleable> </declare-styleable> Loading Loading
core/java/android/view/View.java +6 −34 Original line number Original line Diff line number Diff line Loading @@ -4265,12 +4265,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } mForegroundInfo.mInsidePadding = a.getBoolean(attr, mForegroundInfo.mInsidePadding = a.getBoolean(attr, mForegroundInfo.mInsidePadding); mForegroundInfo.mInsidePadding); break; case R.styleable.View_scrollIndicators: case R.styleable.View_scrollIndicators: final int 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) { if (scrollIndicators != 0) { viewFlagValues |= scrollIndicators; mPrivateFlags3 |= scrollIndicators; viewFlagMasks |= SCROLL_INDICATORS_PFLAG3_MASK; initializeScrollIndicators = true; initializeScrollIndicators = true; } } break; break; Loading Loading @@ -4884,7 +4885,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @attr ref android.R.styleable#View_scrollIndicators * @attr ref android.R.styleable#View_scrollIndicators */ */ public void setScrollIndicators(@ScrollIndicators int indicators) { public void setScrollIndicators(@ScrollIndicators int indicators) { setScrollIndicators(indicators, SCROLL_INDICATORS_PFLAG3_MASK); setScrollIndicators(indicators, SCROLL_INDICATORS_PFLAG3_MASK >>> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT); } } /** /** Loading Loading @@ -4954,36 +4956,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, >>> SCROLL_INDICATORS_TO_PFLAGS3_LSHIFT; >>> 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() { ListenerInfo getListenerInfo() { if (mListenerInfo != null) { if (mListenerInfo != null) { return mListenerInfo; return mListenerInfo; Loading
core/res/res/values/attrs.xml +7 −7 Original line number Original line Diff line number Diff line Loading @@ -2722,21 +2722,21 @@ for example "top|bottom". --> for example "top|bottom". --> <attr name="scrollIndicators"> <attr name="scrollIndicators"> <!-- No scroll indicators are displayed. --> <!-- 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. --> <!-- 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. --> <!-- 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. --> <!-- 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. --> <!-- 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 <!-- Displays right scroll indicator when vew can be scrolled in the start direction. --> start direction. --> <flag name="start" value="0x1000" /> <flag name="start" value="0x10" /> <!-- Displays right scroll indicator when vew can be scrolled in the <!-- Displays right scroll indicator when vew can be scrolled in the end direction. --> end direction. --> <flag name="end" value="0x2000" /> <flag name="end" value="0x20" /> </attr> </attr> </declare-styleable> </declare-styleable> Loading