summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/drawable/ic_btn_bookmark_browsertab.pngbin0 -> 687 bytes
-rw-r--r--res/drawable/tab_browser_selected.9.pngbin0 -> 392 bytes
-rw-r--r--res/drawable/tab_browser_unselected.9.pngbin0 -> 388 bytes
-rw-r--r--res/layout/title_bar.xml27
-rw-r--r--src/com/android/browser/TitleBar.java60
-rw-r--r--src/com/android/browser/TitleBarSet.java2
6 files changed, 49 insertions, 40 deletions
diff --git a/res/drawable/ic_btn_bookmark_browsertab.png b/res/drawable/ic_btn_bookmark_browsertab.png
new file mode 100644
index 0000000..1c52124
--- /dev/null
+++ b/res/drawable/ic_btn_bookmark_browsertab.png
Binary files differ
diff --git a/res/drawable/tab_browser_selected.9.png b/res/drawable/tab_browser_selected.9.png
new file mode 100644
index 0000000..40ad080
--- /dev/null
+++ b/res/drawable/tab_browser_selected.9.png
Binary files differ
diff --git a/res/drawable/tab_browser_unselected.9.png b/res/drawable/tab_browser_unselected.9.png
new file mode 100644
index 0000000..9b5ec0e
--- /dev/null
+++ b/res/drawable/tab_browser_unselected.9.png
Binary files differ
diff --git a/res/layout/title_bar.xml b/res/layout/title_bar.xml
index 7245a9b..be5f51c 100644
--- a/res/layout/title_bar.xml
+++ b/res/layout/title_bar.xml
@@ -16,15 +16,14 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/search_plate"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="12dip"
android:paddingRight="12dip"
android:paddingTop="0dip"
- android:paddingBottom="16dip"
- android:background="@*android:drawable/search_plate_global" >
+ android:paddingBottom="0dip"
+ android:background="@drawable/tab_browser_selected" >
<ProgressBar android:id="@+id/progress_horizontal"
style="?android:attr/progressBarStyleHorizontal"
@@ -34,7 +33,6 @@
/>
<LinearLayout
- android:id="@+id/search_edit_frame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dip"
@@ -42,8 +40,8 @@
<TextView
android:id="@+id/title"
- android:background="@*android:drawable/textfield_search"
- android:layout_height="40dip"
+ android:background="@*android:drawable/textfield_default"
+ android:layout_height="wrap_content"
android:layout_width="0dip"
android:layout_weight="1.0"
android:paddingLeft="8dip"
@@ -51,21 +49,20 @@
android:singleLine="true"
android:ellipsize="end"
/>
- <ProgressBar android:id="@+id/progress_circular"
- style="?android:attr/progressBarStyleSmallTitle"
- android:layout_width="40dip"
- android:layout_height="40dip"
+ <ImageView android:id="@+id/lock"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_marginLeft="3dip"
- android:max="100"
+ android:layout_gravity="center_vertical"
+ android:visibility="gone"
/>
<ImageView
android:id="@+id/rt_btn"
- android:layout_width="40dip"
- android:layout_height="40dip"
+ android:layout_width="42dip"
+ android:layout_height="42dip"
android:layout_marginLeft="8dip"
- android:scaleType="fitXY"
android:background="@*android:drawable/btn_search_dialog_voice"
- android:src="@drawable/ic_menu_bookmark"
+ android:src="@drawable/ic_btn_bookmark_browsertab"
/>
</LinearLayout>
</LinearLayout>
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java
index f03e2da..c118936 100644
--- a/src/com/android/browser/TitleBar.java
+++ b/src/com/android/browser/TitleBar.java
@@ -18,6 +18,7 @@ package com.android.browser;
import android.content.Context;
import android.graphics.Rect;
+import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
@@ -36,10 +37,10 @@ public class TitleBar extends LinearLayout {
private TextView mTitle;
private Drawable mCloseDrawable;
private ImageView mRtButton;
- private ProgressBar mCircularProgress;
+ private Drawable mCircularProgress;
private ProgressBar mHorizontalProgress;
private Drawable mFavicon;
- private Drawable mLockIcon;
+ private ImageView mLockIcon;
private Drawable mStopDrawable;
private Drawable mBookmarkDrawable;
private boolean mInLoad;
@@ -55,6 +56,8 @@ public class TitleBar extends LinearLayout {
mTitle = (TextView) findViewById(R.id.title);
mTitle.setCompoundDrawablePadding(5);
+ mLockIcon = (ImageView) findViewById(R.id.lock);
+
mRtButton = (ImageView) findViewById(R.id.rt_btn);
mRtButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
@@ -67,7 +70,9 @@ public class TitleBar extends LinearLayout {
}
}
});
- mCircularProgress = (ProgressBar) findViewById(R.id.progress_circular);
+ mCircularProgress = (Drawable) context.getResources().getDrawable(
+ com.android.internal.R.drawable.search_spinner);
+ mCircularProgress.setBounds(0,0,20,20);
mHorizontalProgress = (ProgressBar) findViewById(
R.id.progress_horizontal);
mWebView = webview;
@@ -95,7 +100,8 @@ public class TitleBar extends LinearLayout {
if (d != null) {
d.setBounds(0, 0, 20, 20);
}
- mTitle.setCompoundDrawables(d, null, mLockIcon, null);
+ Drawable progress = mInLoad ? mCircularProgress : null;
+ mTitle.setCompoundDrawables(d, null, progress, null);
mFavicon = d;
}
@@ -103,40 +109,45 @@ public class TitleBar extends LinearLayout {
* Set the Drawable for the lock icon, or null to hide it.
*/
/* package */ void setLock(Drawable d) {
- if (d != null) {
- d.setBounds(0, 0, 20, 20);
+ if (null == d) {
+ mLockIcon.setVisibility(View.GONE);
+ } else {
+ mLockIcon.setImageDrawable(d);
+ mLockIcon.setVisibility(View.VISIBLE);
}
- mTitle.setCompoundDrawables(mFavicon, null, d, null);
- mLockIcon = d;
}
/**
* Update the progress, from 0 to 100.
*/
/* package */ void setProgress(int newProgress) {
- if (newProgress == mCircularProgress.getMax()) {
- mCircularProgress.setVisibility(View.GONE);
- mHorizontalProgress.setVisibility(View.GONE);
+ if (newProgress == mHorizontalProgress.getMax()) {
+ mTitle.setCompoundDrawables(mFavicon, null, null, null);
+ ((Animatable) mCircularProgress).stop();
+ mHorizontalProgress.setVisibility(View.INVISIBLE);
if (mBookmarkDrawable != null) {
mRtButton.setImageDrawable(mBookmarkDrawable);
}
mInLoad = false;
} else {
- mCircularProgress.setProgress(newProgress);
mHorizontalProgress.setProgress(newProgress);
- mCircularProgress.setVisibility(View.VISIBLE);
- mHorizontalProgress.setVisibility(View.VISIBLE);
- if (mBookmarkDrawable == null) {
- mBookmarkDrawable = mRtButton.getDrawable();
- }
- if (mStopDrawable == null) {
- mRtButton.setImageResource(
- com.android.internal.R.drawable.ic_menu_stop);
- mStopDrawable = mRtButton.getDrawable();
- } else {
- mRtButton.setImageDrawable(mStopDrawable);
+ if (!mInLoad) {
+ mTitle.setCompoundDrawables(mFavicon, null, mCircularProgress,
+ null);
+ ((Animatable) mCircularProgress).start();
+ mHorizontalProgress.setVisibility(View.VISIBLE);
+ if (mBookmarkDrawable == null) {
+ mBookmarkDrawable = mRtButton.getDrawable();
+ }
+ if (mStopDrawable == null) {
+ mRtButton.setImageResource(
+ com.android.internal.R.drawable.ic_menu_stop);
+ mStopDrawable = mRtButton.getDrawable();
+ } else {
+ mRtButton.setImageDrawable(mStopDrawable);
+ }
+ mInLoad = true;
}
- mInLoad = true;
}
}
@@ -155,7 +166,6 @@ public class TitleBar extends LinearLayout {
mTitle.setText(R.string.tab_picker_title);
setFavicon(null);
setLock(null);
- mCircularProgress.setVisibility(View.GONE);
mHorizontalProgress.setVisibility(View.GONE);
}
}
diff --git a/src/com/android/browser/TitleBarSet.java b/src/com/android/browser/TitleBarSet.java
index 873f40b..c71cfa7 100644
--- a/src/com/android/browser/TitleBarSet.java
+++ b/src/com/android/browser/TitleBarSet.java
@@ -58,6 +58,8 @@ public class TitleBarSet extends Gallery
setCallbackOnUnselectedItemClick(true);
setSpacing(0);
setOnItemSelectedListener(this);
+ setBackgroundResource(R.drawable.tab_browser_unselected);
+ setPadding(0,0,0,0);
}
/**