diff options
author | Michael Kolb <kolby@google.com> | 2011-05-17 14:52:41 -0700 |
---|---|---|
committer | Michael Kolb <kolby@google.com> | 2011-05-17 14:52:49 -0700 |
commit | 678afc88c00b339950b41e5be9a3e165d580f7bf (patch) | |
tree | a849cda60309d0bb3f7b3962276254f27a899d85 /src/com/android/browser/TabScrollView.java | |
parent | 275932ff17bcb44712ef07a1e143c3f3b0d8df8a (diff) | |
download | android_packages_apps_Gello-678afc88c00b339950b41e5be9a3e165d580f7bf.tar.gz android_packages_apps_Gello-678afc88c00b339950b41e5be9a3e165d580f7bf.tar.bz2 android_packages_apps_Gello-678afc88c00b339950b41e5be9a3e165d580f7bf.zip |
adjust tab width for screen size
Bug: 4427112
make tabs smaller for portrait 7 inch screen
Change-Id: I0e02e68b1bae1fe7e81f1a3a49911707de40903b
Diffstat (limited to 'src/com/android/browser/TabScrollView.java')
-rw-r--r-- | src/com/android/browser/TabScrollView.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/browser/TabScrollView.java b/src/com/android/browser/TabScrollView.java index d0648b70..f43d6d68 100644 --- a/src/com/android/browser/TabScrollView.java +++ b/src/com/android/browser/TabScrollView.java @@ -16,6 +16,8 @@ package com.android.browser; +import com.android.browser.TabBar.TabView; + import android.animation.ObjectAnimator; import android.content.Context; import android.util.AttributeSet; @@ -85,6 +87,16 @@ public class TabScrollView extends HorizontalScrollView { ensureChildVisible(getSelectedTab()); } + // in case of a configuration change, adjust tab width + protected void updateLayout() { + final int count = mContentView.getChildCount(); + for (int i = 0; i < count; i++) { + final TabView tv = (TabView) mContentView.getChildAt(i); + tv.updateLayoutParams(); + } + ensureChildVisible(getSelectedTab()); + } + void setSelectedTab(int position) { View v = getSelectedTab(); if (v != null) { |