diff options
author | Pankaj Garg <pgarg@codeaurora.org> | 2014-11-26 14:52:22 -0800 |
---|---|---|
committer | WebTech Code Review <code-review@localhost> | 2014-12-02 08:02:41 -0800 |
commit | f3f1b012c103d904f793b53552199280976f618b (patch) | |
tree | 62fd0e4abf29a9406181793842709d221abd505d /src/com/android/browser/TabBar.java | |
parent | dcf9d6b8992e7748c0319c42cfb6ddbadd3c4063 (diff) | |
download | android_packages_apps_Gello-f3f1b012c103d904f793b53552199280976f618b.tar.gz android_packages_apps_Gello-f3f1b012c103d904f793b53552199280976f618b.tar.bz2 android_packages_apps_Gello-f3f1b012c103d904f793b53552199280976f618b.zip |
Fixed tab bar view of SWE on tablets
Corrected the action bar theming and drawables for
browser tabs.
Change-Id: I7d3814c665e3dbbfb6d2b62684b17b308c8558a8
Diffstat (limited to 'src/com/android/browser/TabBar.java')
-rw-r--r-- | src/com/android/browser/TabBar.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java index c8a48156..8aa69956 100644 --- a/src/com/android/browser/TabBar.java +++ b/src/com/android/browser/TabBar.java @@ -25,10 +25,12 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Bitmap; +import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; +import android.graphics.Shader; import android.graphics.drawable.Drawable; import android.view.Gravity; import android.view.LayoutInflater; @@ -76,8 +78,8 @@ public class TabBar extends LinearLayout implements OnClickListener { private final Matrix mActiveMatrix = new Matrix(); private final Matrix mInactiveMatrix = new Matrix(); - ///private BitmapShader mActiveShader; - ///private BitmapShader mInactiveShader; + private BitmapShader mActiveShader; + private BitmapShader mInactiveShader; private int mTabOverlap; private int mAddTabOverlap; @@ -337,7 +339,7 @@ public class TabBar extends LinearLayout implements OnClickListener { setFocusPath(mFocusPath, 0, 0, r - l, b - t); } - /*@Override + @Override protected void dispatchDraw(Canvas canvas) { if (mCurrentTextureWidth != mUi.getContentWidth() || mCurrentTextureHeight != getHeight()) { @@ -345,10 +347,14 @@ public class TabBar extends LinearLayout implements OnClickListener { mCurrentTextureHeight = getHeight(); if (mCurrentTextureWidth > 0 && mCurrentTextureHeight > 0) { - Bitmap activeTexture = getDrawableAsBitmap(mActiveDrawable, - mCurrentTextureWidth, mCurrentTextureHeight); - Bitmap inactiveTexture = getDrawableAsBitmap(mInactiveDrawable, - mCurrentTextureWidth, mCurrentTextureHeight); + Bitmap activeTexture = Bitmap.createBitmap( + mCurrentTextureWidth, mCurrentTextureHeight, Bitmap.Config.ARGB_8888); + activeTexture.eraseColor(getResources(). + getColor(R.color.NavigationBarBackground)); + Bitmap inactiveTexture = Bitmap.createBitmap( + mCurrentTextureWidth, mCurrentTextureHeight, Bitmap.Config.ARGB_8888); + inactiveTexture.eraseColor(getResources(). + getColor(R.color.TabNavBackgroundColor)); mActiveShader = new BitmapShader(activeTexture, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); @@ -379,7 +385,7 @@ public class TabBar extends LinearLayout implements OnClickListener { if (isFocused()) { canvas.drawPath(mFocusPath, mFocusPaint); } - }*/ + } private void setTabPath(Path path, int l, int t, int r, int b) { path.reset(); |