diff options
author | Leon Scroggins <scroggo@google.com> | 2010-05-26 10:25:01 -0400 |
---|---|---|
committer | Leon Scroggins <scroggo@google.com> | 2010-06-16 12:51:50 -0400 |
commit | 571b3762a5eb9e492283e0a1e437edd209fdc0de (patch) | |
tree | 63d46b30d4587db0b204dc7fb10fde7679e01488 /src/com/android/browser/TitleBar.java | |
parent | 11bd45d76c27dd02646669ca117e9b3ca7afe244 (diff) | |
download | android_packages_apps_Gello-571b3762a5eb9e492283e0a1e437edd209fdc0de.tar.gz android_packages_apps_Gello-571b3762a5eb9e492283e0a1e437edd209fdc0de.tar.bz2 android_packages_apps_Gello-571b3762a5eb9e492283e0a1e437edd209fdc0de.zip |
Initial work on new browser bar
Bug 2712871
Change-Id: Id1c76b05a5f126a4a68369a32dda8975fc1d2e6b
Diffstat (limited to 'src/com/android/browser/TitleBar.java')
-rw-r--r-- | src/com/android/browser/TitleBar.java | 60 |
1 files changed, 4 insertions, 56 deletions
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java index dc4979bd..4e76334f 100644 --- a/src/com/android/browser/TitleBar.java +++ b/src/com/android/browser/TitleBar.java @@ -21,14 +21,8 @@ import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Resources; -import android.graphics.Bitmap; -import android.graphics.Color; -import android.graphics.Rect; import android.graphics.drawable.Animatable; -import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; -import android.graphics.drawable.LayerDrawable; -import android.graphics.drawable.PaintDrawable; import android.os.Handler; import android.os.Message; import android.speech.RecognizerIntent; @@ -45,7 +39,6 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.TextView; @@ -55,21 +48,16 @@ import com.android.common.speech.LoggingEvents; * This class represents a title bar for a particular "tab" or "window" in the * browser. */ -public class TitleBar extends LinearLayout { +public class TitleBar extends TitleBarBase { private TextView mTitle; - private Drawable mCloseDrawable; private ImageView mRtButton; private Drawable mCircularProgress; private ProgressBar mHorizontalProgress; - private ImageView mFavicon; - private ImageView mLockIcon; private ImageView mStopButton; private Drawable mBookmarkDrawable; private Drawable mVoiceDrawable; private boolean mInLoad; private BrowserActivity mBrowserActivity; - private Drawable mGenericFavicon; - private int mIconDimension; private View mTitleBg; private MyHandler mHandler; private Intent mVoiceSearchIntent; @@ -84,7 +72,7 @@ public class TitleBar extends LinearLayout { private static int LONG_PRESS = 1; public TitleBar(BrowserActivity context) { - super(context, null); + super(context); mHandler = new MyHandler(); LayoutInflater factory = LayoutInflater.from(context); factory.inflate(R.layout.title_bar, this); @@ -107,13 +95,11 @@ public class TitleBar extends LinearLayout { TypedValue.COMPLEX_UNIT_DIP, 8f, metrics); mRightMargin = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, 6f, metrics); - mIconDimension = (int) TypedValue.applyDimension( + int iconDimension = (int) TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, 20f, metrics); - mCircularProgress.setBounds(0, 0, mIconDimension, mIconDimension); + mCircularProgress.setBounds(0, 0, iconDimension, iconDimension); mHorizontalProgress = (ProgressBar) findViewById( R.id.progress_horizontal); - mGenericFavicon = context.getResources().getDrawable( - R.drawable.app_web_browser_sm); mVoiceSearchIntent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); mVoiceSearchIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH); @@ -248,25 +234,6 @@ public class TitleBar extends LinearLayout { } /** - * Set a new Bitmap for the Favicon. - */ - /* package */ void setFavicon(Bitmap icon) { - Drawable[] array = new Drawable[3]; - array[0] = new PaintDrawable(Color.BLACK); - PaintDrawable p = new PaintDrawable(Color.WHITE); - array[1] = p; - if (icon == null) { - array[2] = mGenericFavicon; - } else { - array[2] = new BitmapDrawable(icon); - } - LayerDrawable d = new LayerDrawable(array); - d.setLayerInset(1, 1, 1, 1, 1); - d.setLayerInset(2, 2, 2, 2, 2); - mFavicon.setImageDrawable(d); - } - - /** * Change the TitleBar to or from voice mode. If there is no package to * handle voice search, the TitleBar cannot be set to voice mode. */ @@ -302,18 +269,6 @@ public class TitleBar extends LinearLayout { } /** - * Set the Drawable for the lock icon, or null to hide it. - */ - /* package */ void setLock(Drawable d) { - if (null == d) { - mLockIcon.setVisibility(View.GONE); - } else { - mLockIcon.setImageDrawable(d); - mLockIcon.setVisibility(View.VISIBLE); - } - } - - /** * Update the progress, from 0 to 100. */ /* package */ void setProgress(int newProgress) { @@ -374,11 +329,4 @@ public class TitleBar extends LinearLayout { } } } - - /* package */ void setToTabPicker() { - mTitle.setText(R.string.tab_picker_title); - setFavicon(null); - setLock(null); - mHorizontalProgress.setVisibility(View.GONE); - } } |