summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/CombinedBookmarkHistoryActivity.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-08-28 11:44:12 -0400
committerLeon Scroggins <scroggo@google.com>2009-08-28 13:13:14 -0400
commitdca4b5c2f6e4129d2da047d9b2f9b3433936a941 (patch)
tree0bf60488a951e2ac2c23ec9db869aa43c53c2488 /src/com/android/browser/CombinedBookmarkHistoryActivity.java
parent098834d9379f961e9e8d89aa67412f6e72aef755 (diff)
downloadpackages_apps_Browser-dca4b5c2f6e4129d2da047d9b2f9b3433936a941.zip
packages_apps_Browser-dca4b5c2f6e4129d2da047d9b2f9b3433936a941.tar.gz
packages_apps_Browser-dca4b5c2f6e4129d2da047d9b2f9b3433936a941.tar.bz2
Improve the appearance of the minitabs on the landing page.
Use the default look, but modified to be shorter in height. Change-Id: Ib0b8a6ab4ce0a809504d92a2b40ac39224264626
Diffstat (limited to 'src/com/android/browser/CombinedBookmarkHistoryActivity.java')
-rw-r--r--src/com/android/browser/CombinedBookmarkHistoryActivity.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/com/android/browser/CombinedBookmarkHistoryActivity.java b/src/com/android/browser/CombinedBookmarkHistoryActivity.java
index efe6292..bed926e 100644
--- a/src/com/android/browser/CombinedBookmarkHistoryActivity.java
+++ b/src/com/android/browser/CombinedBookmarkHistoryActivity.java
@@ -36,6 +36,7 @@ import android.webkit.WebIconDatabase.IconListener;
import android.widget.LinearLayout;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
+import android.widget.TabWidget;
import android.widget.TextView;
import java.util.HashMap;
@@ -163,7 +164,6 @@ public class CombinedBookmarkHistoryActivity extends TabActivity
getTabHost().setOnTabChangedListener(this);
Bundle extras = getIntent().getExtras();
- Resources resources = getResources();
getIconListenerSet(getContentResolver());
@@ -187,15 +187,28 @@ public class CombinedBookmarkHistoryActivity extends TabActivity
if (defaultTab != null) {
getTabHost().setCurrentTab(2);
}
+ // For each of our tabs, reduce its height by setting the icon
+ // view to gone, and setting a height.
+ TabWidget widget = getTabWidget();
+ int count = widget.getTabCount();
+ for (int i = 0; i < count; i++) {
+ View header = widget.getChildTabViewAt(i);
+ if (null == header) break;
+ View icon = header.findViewById(android.R.id.icon);
+ if (null == icon) break;
+ icon.setVisibility(View.GONE);
+ LinearLayout.LayoutParams lp
+ = (LinearLayout.LayoutParams) header.getLayoutParams();
+ lp.height = 30;
+ }
+ widget.requestLayout();
}
private void createTab(Intent intent, int labelResId, String tab) {
- LayoutInflater factory = LayoutInflater.from(this);
- View tabHeader = factory.inflate(R.layout.tab_header, null);
- TextView textView = (TextView) tabHeader.findViewById(R.id.tab_label);
- textView.setText(labelResId);
+ Resources resources = getResources();
TabHost tabHost = getTabHost();
- tabHost.addTab(tabHost.newTabSpec(tab).setIndicator(tabHeader).setContent(intent));
+ tabHost.addTab(tabHost.newTabSpec(tab).setIndicator(
+ resources.getText(labelResId)).setContent(intent));
}
// Copied from DialTacts Activity
/** {@inheritDoc} */