summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TitleBarXLarge.java
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-12-03 15:31:56 -0500
committerLeon Scroggins <scroggo@google.com>2010-12-06 12:00:04 -0500
commit4cd97793901e8f5681cf642d0b2684697964a37a (patch)
tree6693ad6ec9e8da58050cc32ee45191538eef5b69 /src/com/android/browser/TitleBarXLarge.java
parentd957a52dfb61ef3056e6225301ebbba622352d1a (diff)
downloadpackages_apps_browser-4cd97793901e8f5681cf642d0b2684697964a37a.zip
packages_apps_browser-4cd97793901e8f5681cf642d0b2684697964a37a.tar.gz
packages_apps_browser-4cd97793901e8f5681cf642d0b2684697964a37a.tar.bz2
Show a highlighted star for bookmarked pages.
Bug:3222677 Change-Id: Ifeb6e7a922c0defb1e4a88ded0c188b97e0a4a56
Diffstat (limited to 'src/com/android/browser/TitleBarXLarge.java')
-rw-r--r--src/com/android/browser/TitleBarXLarge.java31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java
index 0aa09db..cd3b230 100644
--- a/src/com/android/browser/TitleBarXLarge.java
+++ b/src/com/android/browser/TitleBarXLarge.java
@@ -26,9 +26,11 @@ import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
+import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
@@ -48,7 +50,7 @@ public class TitleBarXLarge extends TitleBarBase
private View mContainer;
private View mBackButton;
private View mForwardButton;
- private View mStar;
+ private CheckBox mStar;
private View mSearchButton;
private View mFocusContainer;
private View mUnfocusContainer;
@@ -82,7 +84,7 @@ public class TitleBarXLarge extends TitleBarBase
// back/forward. Probably should be done inside onPageStarted.
mBackButton = findViewById(R.id.back);
mForwardButton = findViewById(R.id.forward);
- mStar = findViewById(R.id.star);
+ mStar = (CheckBox) findViewById(R.id.star);
mStopButton = (ImageView) findViewById(R.id.stop);
mSearchButton = findViewById(R.id.search);
mLockIcon = (ImageView) findViewById(R.id.lock);
@@ -106,6 +108,10 @@ public class TitleBarXLarge extends TitleBarBase
mUnfocusContainer.setOnClickListener(this);
}
+ public void setCurrentUrlIsBookmark(boolean isBookmark) {
+ mStar.setChecked(isBookmark);
+ }
+
@Override
public void onClick(View v) {
if (mUnfocusContainer == v) {
@@ -237,4 +243,25 @@ public class TitleBarXLarge extends TitleBarBase
mUrlUnfocused.setText(title);
}
+ /**
+ * Custom CheckBox which does not toggle when pressed. Used by mStar.
+ */
+ public static class CustomCheck extends CheckBox {
+ public CustomCheck(Context context) {
+ super(context);
+ }
+
+ public CustomCheck(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public CustomCheck(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ public void toggle() {
+ // Do nothing
+ }
+ }
}