diff options
author | Michael Kolb <kolby@google.com> | 2011-02-16 16:12:13 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-02-16 16:12:13 -0800 |
commit | 745f3704dccfb228d358bbe25bba90ffa88eeb97 (patch) | |
tree | 0d104b4c9aa3a7697477b146aae90d5d938972b8 /src/com/android | |
parent | 7a59120d6e25f9f6ae9a5f7e0cb177a9f4775d54 (diff) | |
parent | eb7001c66f49babd2f52ebeedcf55421ffc2597d (diff) | |
download | packages_apps_Browser-745f3704dccfb228d358bbe25bba90ffa88eeb97.zip packages_apps_Browser-745f3704dccfb228d358bbe25bba90ffa88eeb97.tar.gz packages_apps_Browser-745f3704dccfb228d358bbe25bba90ffa88eeb97.tar.bz2 |
Merge "change tab focus highlight"
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/browser/TabBar.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/browser/TabBar.java b/src/com/android/browser/TabBar.java index 990d68f..4fb3ad4 100644 --- a/src/com/android/browser/TabBar.java +++ b/src/com/android/browser/TabBar.java @@ -133,6 +133,7 @@ public class TabBar extends LinearLayout mInactiveShaderPaint.setAntiAlias(true); mFocusPaint.setStyle(Paint.Style.STROKE); + mFocusPaint.setStrokeWidth(res.getDimension(R.dimen.tab_focus_stroke)); mFocusPaint.setAntiAlias(true); mFocusPaint.setColor(res.getColor(R.color.tabFocusHighlight)); } @@ -317,6 +318,7 @@ public class TabBar extends LinearLayout boolean mSelected; boolean mInLoad; Path mPath; + Path mFocusPath; int[] mWindowPos; /** @@ -326,6 +328,7 @@ public class TabBar extends LinearLayout super(context); setWillNotDraw(false); mPath = new Path(); + mFocusPath = new Path(); mWindowPos = new int[2]; mTab = tab; setGravity(Gravity.CENTER_VERTICAL); @@ -446,6 +449,7 @@ public class TabBar extends LinearLayout protected void onLayout(boolean changed, int l, int t, int r, int b) { super.onLayout(changed, l, t, r, b); setTabPath(mPath, 0, 0, r - l, b - t); + setFocusPath(mFocusPath, 0, 0, r - l, b - t); } @Override @@ -486,7 +490,7 @@ public class TabBar extends LinearLayout (mSelected ? mActiveShader : mInactiveShader).setLocalMatrix(matrix); canvas.drawPath(clipPath, paint); if (isFocused()) { - canvas.drawPath(clipPath, mFocusPaint); + canvas.drawPath(mFocusPath, mFocusPaint); } } @@ -499,6 +503,14 @@ public class TabBar extends LinearLayout path.close(); } + private void setFocusPath(Path path, int l, int t, int r, int b) { + path.reset(); + path.moveTo(l, b); + path.lineTo(l, t); + path.lineTo(r - mTabSliceWidth, t); + path.lineTo(r, b); + } + } static Drawable createFaviconBackground(Context context) { |