diff options
author | Romain Guy <romainguy@google.com> | 2011-09-09 17:35:02 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-09 17:35:02 -0700 |
commit | 3593fc4c3fac8d957db0171387472e7b812c9073 (patch) | |
tree | fd5213562dcf66557bcf0d21c3f3bf0d1c3e8f5f /core | |
parent | fbab086933cfbfda2b41b2dbf69ac644f36a686f (diff) | |
parent | 1ef3fdbe047c805ce33b2be463ea51dec5952729 (diff) | |
download | frameworks_base-3593fc4c3fac8d957db0171387472e7b812c9073.zip frameworks_base-3593fc4c3fac8d957db0171387472e7b812c9073.tar.gz frameworks_base-3593fc4c3fac8d957db0171387472e7b812c9073.tar.bz2 |
Merge "Go faster!!!!"
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/View.java | 18 | ||||
-rwxr-xr-x | core/res/res/values/attrs.xml | 17 | ||||
-rw-r--r-- | core/res/res/values/public.xml | 2 |
3 files changed, 31 insertions, 6 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 7a35015..637f646 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -69,6 +69,8 @@ import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; import android.widget.ScrollBarDrawable; +import static android.os.Build.VERSION_CODES.*; + import com.android.internal.R; import com.android.internal.util.Predicate; import com.android.internal.view.menu.MenuBuilder; @@ -585,7 +587,7 @@ import java.util.concurrent.CopyOnWriteArrayList; * @attr ref android.R.styleable#View_drawingCacheQuality * @attr ref android.R.styleable#View_duplicateParentState * @attr ref android.R.styleable#View_id - * @attr ref android.R.styleable#View_fadingEdge + * @attr ref android.R.styleable#View_requiresFadingEdge * @attr ref android.R.styleable#View_fadingEdgeLength * @attr ref android.R.styleable#View_filterTouchesWhenObscured * @attr ref android.R.styleable#View_fitsSystemWindows @@ -2895,6 +2897,12 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal } break; case R.styleable.View_fadingEdge: + if (context.getApplicationInfo().targetSdkVersion >= ICE_CREAM_SANDWICH) { + // Ignore the attribute starting with ICS + break; + } + // With builds < ICS, fall through and apply fading edges + case R.styleable.View_requiresFadingEdge: final int fadingEdge = a.getInt(attr, FADING_EDGE_NONE); if (fadingEdge != FADING_EDGE_NONE) { viewFlagValues |= fadingEdge; @@ -8642,7 +8650,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * otherwise * * @see #setHorizontalFadingEdgeEnabled(boolean) - * @attr ref android.R.styleable#View_fadingEdge + * @attr ref android.R.styleable#View_requiresFadingEdge */ public boolean isHorizontalFadingEdgeEnabled() { return (mViewFlags & FADING_EDGE_HORIZONTAL) == FADING_EDGE_HORIZONTAL; @@ -8657,7 +8665,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * horizontally * * @see #isHorizontalFadingEdgeEnabled() - * @attr ref android.R.styleable#View_fadingEdge + * @attr ref android.R.styleable#View_requiresFadingEdge */ public void setHorizontalFadingEdgeEnabled(boolean horizontalFadingEdgeEnabled) { if (isHorizontalFadingEdgeEnabled() != horizontalFadingEdgeEnabled) { @@ -8677,7 +8685,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * otherwise * * @see #setVerticalFadingEdgeEnabled(boolean) - * @attr ref android.R.styleable#View_fadingEdge + * @attr ref android.R.styleable#View_requiresFadingEdge */ public boolean isVerticalFadingEdgeEnabled() { return (mViewFlags & FADING_EDGE_VERTICAL) == FADING_EDGE_VERTICAL; @@ -8692,7 +8700,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal * vertically * * @see #isVerticalFadingEdgeEnabled() - * @attr ref android.R.styleable#View_fadingEdge + * @attr ref android.R.styleable#View_requiresFadingEdge */ public void setVerticalFadingEdgeEnabled(boolean verticalFadingEdgeEnabled) { if (isVerticalFadingEdgeEnabled() != verticalFadingEdgeEnabled) { diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 525b03a..2e61cf5 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1804,7 +1804,13 @@ <!-- Defines whether the vertical scrollbar track should always be drawn. --> <attr name="scrollbarAlwaysDrawVerticalTrack" format="boolean" /> - <!-- Defines which edges should be fadeded on scrolling. --> + <!-- {@deprecated This attribute is deprecated and will be ignored as of + API level {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH}. + Using fading edges may introduce noticeable performance + degradations and should be used only when required by the application's + visual design. To request fading edges with API level + {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH} and above, + use the <code>requiresFadingEdge</code> attribute instead.} --> <attr name="fadingEdge"> <!-- No edge is faded. --> <flag name="none" value="0x00000000" /> @@ -1813,6 +1819,15 @@ <!-- Fades vertical edges only. --> <flag name="vertical" value="0x00002000" /> </attr> + <!-- Defines which edges should be faded on scrolling. --> + <attr name="requiresFadingEdge"> + <!-- No edge is faded. --> + <flag name="none" value="0x00000000" /> + <!-- Fades horizontal edges only. --> + <flag name="horizontal" value="0x00001000" /> + <!-- Fades vertical edges only. --> + <flag name="vertical" value="0x00002000" /> + </attr> <!-- Defines the length of the fading edges. --> <attr name="fadingEdgeLength" format="dimension" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 50dee12..9327a0b 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1806,6 +1806,8 @@ <public type="attr" name="listPreferredItemPaddingLeft" /> <public type="attr" name="listPreferredItemPaddingRight" /> + <public type="attr" name="requiresFadingEdge" /> + <public type="style" name="TextAppearance.SuggestionHighlight" /> <public type="style" name="Theme.Holo.Light.DarkActionBar" /> |