summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/NavTabView.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-05-29 12:18:52 -0700
committerMichael Kolb <kolby@google.com>2011-05-31 17:17:10 -0700
commitdb343c57c970bb2e3b8f269fc4cbe90546357257 (patch)
tree5072ad940e0d225128b201e3b0382c48ad59a7e0 /src/com/android/browser/NavTabView.java
parentaed9c54d8e67bb683a5a415b3775525a3ac00508 (diff)
downloadpackages_apps_Browser-db343c57c970bb2e3b8f269fc4cbe90546357257.tar.gz
packages_apps_Browser-db343c57c970bb2e3b8f269fc4cbe90546357257.tar.bz2
packages_apps_Browser-db343c57c970bb2e3b8f269fc4cbe90546357257.zip
calculate scroller padding
Change-Id: I727c425e096220ae1230e3fbe0f1edb4b3fea8ed
Diffstat (limited to 'src/com/android/browser/NavTabView.java')
-rw-r--r--src/com/android/browser/NavTabView.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/browser/NavTabView.java b/src/com/android/browser/NavTabView.java
index 14453dcb4..ec42c94e2 100644
--- a/src/com/android/browser/NavTabView.java
+++ b/src/com/android/browser/NavTabView.java
@@ -17,8 +17,10 @@
package com.android.browser;
import android.content.Context;
+import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -42,6 +44,9 @@ public class NavTabView extends LinearLayout {
OnClickListener mClickListener;
boolean mHighlighted;
Drawable mTitleBg;
+ Drawable mUrlBg;
+ float mMediumTextSize;
+ float mSmallTextSize;
public NavTabView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
@@ -59,6 +64,9 @@ public class NavTabView extends LinearLayout {
}
private void init() {
+ final Resources res = mContext.getResources();
+ mMediumTextSize = res.getDimension(R.dimen.nav_tab_text_normal);
+ mSmallTextSize = res.getDimension(R.dimen.nav_tab_text_small);
LayoutInflater.from(mContext).inflate(R.layout.nav_tab_view,
this);
mContainer = (FrameLayout) findViewById(R.id.tab_view);
@@ -68,9 +76,10 @@ public class NavTabView extends LinearLayout {
mTitle = (TextView) findViewById(R.id.title);
mFavicon = (ImageView) findViewById(R.id.favicon);
mTitleBar = findViewById(R.id.titlebar);
- mTitleBg = mContext.getResources().getDrawable(R.drawable.bg_urlbar);
+ mTitleBg = res.getDrawable(R.drawable.bg_urlbar);
+ mUrlBg = res.getDrawable(
+ com.android.internal.R.drawable.edit_text_holo_dark);
setState(false);
- // refresh titlebar
}
protected boolean isRefresh(View v) {
@@ -108,6 +117,8 @@ public class NavTabView extends LinearLayout {
? View.VISIBLE : View.GONE);
mTitleBar.setBackgroundDrawable(mTitleBg);
mClose.setVisibility(View.VISIBLE);
+ mTitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMediumTextSize);
+ mTitle.setBackgroundDrawable(mUrlBg);
} else {
setAlpha(0.8f);
mForward.setVisibility(View.GONE);
@@ -115,6 +126,8 @@ public class NavTabView extends LinearLayout {
mFavicon.setVisibility(View.INVISIBLE);
mClose.setVisibility(View.GONE);
mTitleBar.setBackgroundDrawable(null);
+ mTitle.setTextSize(TypedValue.COMPLEX_UNIT_PX, mSmallTextSize);
+ mTitle.setBackgroundDrawable(null);
}
setTitle();
}