summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-09-23 15:54:22 -0700
committerMichael Kolb <kolby@google.com>2011-09-23 15:54:22 -0700
commit7a321d68bab6653752bb7a9dece7945eb6294140 (patch)
tree1078949d6364cb851886a71cde72aa703622484a
parenta6a386887c992de9dfc27a455355643cc389956f (diff)
downloadpackages_apps_Browser-7a321d68bab6653752bb7a9dece7945eb6294140.zip
packages_apps_Browser-7a321d68bab6653752bb7a9dece7945eb6294140.tar.gz
packages_apps_Browser-7a321d68bab6653752bb7a9dece7945eb6294140.tar.bz2
Fix tab switcher in animation
Bug: 5367069 Change-Id: I029b7b1c31dfb8071d9816c1bb319f61e8362974
-rw-r--r--res/layout/nav_tab_view.xml2
-rw-r--r--res/values/dimensions.xml1
-rw-r--r--src/com/android/browser/PhoneUi.java3
3 files changed, 4 insertions, 2 deletions
diff --git a/res/layout/nav_tab_view.xml b/res/layout/nav_tab_view.xml
index 82541a4..d1205f0 100644
--- a/res/layout/nav_tab_view.xml
+++ b/res/layout/nav_tab_view.xml
@@ -26,7 +26,7 @@
android:id="@+id/titlebar"
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="32dip"
+ android:layout_height="@dimen/nav_tab_titleheight"
android:layout_gravity="center_horizontal"
android:paddingLeft="8dip" >
<TextView
diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml
index 5652451..8844f6b 100644
--- a/res/values/dimensions.xml
+++ b/res/values/dimensions.xml
@@ -69,6 +69,7 @@
<dimen name="tab_thumbnail_height">160dip</dimen>
<dimen name="nav_tab_width">240dip</dimen>
<dimen name="nav_tab_height">160dip</dimen>
+ <dimen name="nav_tab_titleheight">32dip</dimen>
<dimen name="nav_tab_text_normal">18sp</dimen>
<dimen name="nav_tab_text_small">14sp</dimen>
<dimen name="suggest_item_padding">8dp</dimen>
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index 4772ff1..25a7d4a 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -297,8 +297,9 @@ public class PhoneUi extends BaseUi {
int fromBottom = mContentView.getHeight();
int width = mActivity.getResources().getDimensionPixelSize(R.dimen.nav_tab_width);
int height = mActivity.getResources().getDimensionPixelSize(R.dimen.nav_tab_height);
+ int ntth = mActivity.getResources().getDimensionPixelSize(R.dimen.nav_tab_titleheight);
int toLeft = (mContentView.getWidth() - width) / 2;
- int toTop = ((fromBottom - (fromTop + height)) / 2 + fromTop);
+ int toTop = ((fromBottom - (ntth + height)) / 2 + ntth);
int toRight = toLeft + width;
int toBottom = toTop + height;
float scaleFactor = width / (float) mContentView.getWidth();