summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan <blackhand1001@gmail.com>2014-02-17 14:41:31 -0500
committerSteve Kondik <steve@cyngn.com>2015-11-07 13:57:29 -0800
commit43872839cd0e6fd636ea244d5c3b56039e2a1be7 (patch)
tree1944f089a8916602a3b0930ab4b9f3ac515d9165 /src
parent637f02be8353ea9991d80790d7bb4dc17f5c692a (diff)
downloadpackages_apps_Browser-43872839cd0e6fd636ea244d5c3b56039e2a1be7.zip
packages_apps_Browser-43872839cd0e6fd636ea244d5c3b56039e2a1be7.tar.gz
packages_apps_Browser-43872839cd0e6fd636ea244d5c3b56039e2a1be7.tar.bz2
Reimplement titlebar autohiding to be compatible with chromium webview.
Patch Set 4: Fix code formatting Change-Id: I4de873f7c089d4f7dede944d05f48d03000f3d99
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/TitleBar.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java
index 83c6626..8112b27 100644
--- a/src/com/android/browser/TitleBar.java
+++ b/src/com/android/browser/TitleBar.java
@@ -56,6 +56,7 @@ public class TitleBar extends RelativeLayout {
//state
private boolean mShowing;
+ private boolean mHideLoad;
private boolean mInLoad;
private boolean mSkipTitleBarAnimations;
private Animator mTitleBarAnimator;
@@ -108,10 +109,13 @@ public class TitleBar extends RelativeLayout {
}
private void setFixedTitleBar() {
+ boolean isFixed = !mUseQuickControls
+ && !mContext.getResources().getBoolean(R.bool.hide_title);
+ isFixed |= mAccessibilityManager.isEnabled();
// If getParent() returns null, we are initializing
ViewGroup parent = (ViewGroup)getParent();
- if (mIsFixedTitleBar && parent != null) return;
- mIsFixedTitleBar = true;
+ if (mIsFixedTitleBar == isFixed && parent != null) return;
+ mIsFixedTitleBar = isFixed;
setSkipTitleBarAnimations(true);
show();
setSkipTitleBarAnimations(false);
@@ -254,13 +258,12 @@ public class TitleBar extends RelativeLayout {
mProgress.setProgress(PageProgressView.MAX_PROGRESS);
mProgress.setVisibility(View.GONE);
mInLoad = false;
+ mHideLoad=false;
mNavBar.onProgressStopped();
// check if needs to be hidden
if (!isEditingUrl() && !wantsToBeVisible()) {
if (mUseQuickControls) {
hide();
- } else {
- mBaseUi.showTitleBarForDuration();
}
}
} else {
@@ -271,12 +274,13 @@ public class TitleBar extends RelativeLayout {
}
mProgress.setProgress(newProgress * PageProgressView.MAX_PROGRESS
/ PROGRESS_MAX);
+ if (!isHideLoad() && !mUseQuickControls) {
+ hide();
+ mHideLoad=true;
+ }
if (mUseQuickControls && !isEditingUrl()) {
setShowProgressOnly(true);
}
- if (!mShowing) {
- show();
- }
}
}
@@ -382,6 +386,10 @@ public class TitleBar extends RelativeLayout {
return mUseQuickControls;
}
+ public boolean isHideLoad() {
+ return mHideLoad;
+ }
+
public boolean isInLoad() {
return mInLoad;
}