diff options
author | Romain Guy <romainguy@google.com> | 2011-01-27 13:29:05 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-27 13:29:05 -0800 |
commit | a0d0c0f1473ebc20b85168ceb78c2ef0389efb84 (patch) | |
tree | bb6ce7e3873302b01c31c673c65e2e32347099ba /src/com/android | |
parent | ade30dba17eff30c8b8e265a8193da40db54f87c (diff) | |
parent | e398956c248808b95aa3d81403c3ba3884670199 (diff) | |
download | packages_apps_Browser-a0d0c0f1473ebc20b85168ceb78c2ef0389efb84.zip packages_apps_Browser-a0d0c0f1473ebc20b85168ceb78c2ef0389efb84.tar.gz packages_apps_Browser-a0d0c0f1473ebc20b85168ceb78c2ef0389efb84.tar.bz2 |
Merge "Correctly invalidate the tabs when scrolling them. Bug #3398549" into honeycomb
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/TabScrollView.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/com/android/browser/TabScrollView.java b/src/com/android/browser/TabScrollView.java index 09dddee..d0648b7 100644 --- a/src/com/android/browser/TabScrollView.java +++ b/src/com/android/browser/TabScrollView.java @@ -28,7 +28,6 @@ import android.widget.LinearLayout; */ public class TabScrollView extends HorizontalScrollView { - private Context mContext; private LinearLayout mContentView; private int mSelected; private int mAnimationDuration; @@ -62,13 +61,12 @@ public class TabScrollView extends HorizontalScrollView { } private void init(Context ctx) { - mContext = ctx; mAnimationDuration = ctx.getResources().getInteger( R.integer.tab_animation_duration); mTabOverlap = (int) ctx.getResources().getDimension(R.dimen.tab_overlap); setHorizontalScrollBarEnabled(false); setOverScrollMode(OVER_SCROLL_NEVER); - mContentView = new TabLayout(mContext); + mContentView = new TabLayout(ctx); mContentView.setOrientation(LinearLayout.HORIZONTAL); mContentView.setLayoutParams( new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT)); @@ -189,6 +187,21 @@ public class TabScrollView extends HorizontalScrollView { return getScrollX(); } + @Override + protected void onScrollChanged(int l, int t, int oldl, int oldt) { + super.onScrollChanged(l, t, oldl, oldt); + + // TabViews base their drawing based on their absolute position within the + // window. When hardware accelerated, we need to recreate their display list + // when they scroll + if (isHardwareAccelerated()) { + int count = mContentView.getChildCount(); + for (int i = 0; i < count; i++) { + mContentView.getChildAt(i).invalidate(); + } + } + } + class TabLayout extends LinearLayout { public TabLayout(Context context) { |