summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TitleBar.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-07-12 16:42:08 -0700
committerJohn Reck <jreck@google.com>2011-07-13 10:26:27 -0700
commitef654f1dd80f55609060005342fc4f2cde62990c (patch)
tree99bac9d568efd8972a703e26b2a35c6fb047d882 /src/com/android/browser/TitleBar.java
parent9ef259af433edc5aeb11b5d5d94dc9acc697c61e (diff)
downloadandroid_packages_apps_Gello-ef654f1dd80f55609060005342fc4f2cde62990c.tar.gz
android_packages_apps_Gello-ef654f1dd80f55609060005342fc4f2cde62990c.tar.bz2
android_packages_apps_Gello-ef654f1dd80f55609060005342fc4f2cde62990c.zip
Snapshot title bar
Bug: 4982126 Change-Id: I67931d39e3a3ce535b38197ebeee1651241d1a60
Diffstat (limited to 'src/com/android/browser/TitleBar.java')
-rw-r--r--src/com/android/browser/TitleBar.java26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java
index 4e931242..9848a395 100644
--- a/src/com/android/browser/TitleBar.java
+++ b/src/com/android/browser/TitleBar.java
@@ -51,6 +51,7 @@ public class TitleBar extends RelativeLayout {
private AutologinBar mAutoLogin;
private NavigationBarBase mNavBar;
private boolean mUseQuickControls;
+ private SnapshotBar mSnapshotBar;
//state
private boolean mShowing;
@@ -75,6 +76,8 @@ public class TitleBar extends RelativeLayout {
mAutoLogin.setTitleBar(this);
mNavBar = (NavigationBarBase) findViewById(R.id.taburlbar);
mNavBar.setTitleBar(this);
+ mSnapshotBar = (SnapshotBar) findViewById(R.id.snapshotbar);
+ mSnapshotBar.setTitleBar(this);
}
public BaseUi getUi() {
@@ -91,7 +94,7 @@ public class TitleBar extends RelativeLayout {
}
void setShowProgressOnly(boolean progress) {
- if (progress && !inAutoLogin()) {
+ if (progress && !wantsToBeVisible()) {
mNavBar.setVisibility(View.GONE);
} else {
mNavBar.setVisibility(View.VISIBLE);
@@ -208,7 +211,7 @@ public class TitleBar extends RelativeLayout {
mInLoad = false;
mNavBar.onProgressStopped();
// check if needs to be hidden
- if (!isEditingUrl() && !inAutoLogin()) {
+ if (!isEditingUrl() && !wantsToBeVisible()) {
hide();
if (mUseQuickControls) {
setShowProgressOnly(false);
@@ -286,7 +289,13 @@ public class TitleBar extends RelativeLayout {
}
}
- public boolean inAutoLogin() {
+ public boolean wantsToBeVisible() {
+ return inAutoLogin()
+ || (mSnapshotBar.getVisibility() == View.VISIBLE
+ && mSnapshotBar.isAnimating());
+ }
+
+ private boolean inAutoLogin() {
return mAutoLogin.getVisibility() == View.VISIBLE;
}
@@ -338,4 +347,15 @@ public class TitleBar extends RelativeLayout {
return super.focusSearch(focused, dir);
}
+ public void onTabDataChanged(Tab tab) {
+ mSnapshotBar.onTabDataChanged(tab);
+ if (tab.isSnapshot()) {
+ mSnapshotBar.setVisibility(VISIBLE);
+ mNavBar.setVisibility(GONE);
+ } else {
+ mSnapshotBar.setVisibility(GONE);
+ mNavBar.setVisibility(VISIBLE);
+ }
+ }
+
}