Merge "Use a fixed title bar if accessibility is enabled" into jb-mr1-dev
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index c749465..b766fb9 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -171,6 +171,7 @@
if (ct != null) {
setActiveTab(ct);
}
+ mTitleBar.onResume();
}
protected boolean isActivityPaused() {
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java
index f5be5d3..874296a 100644
--- a/src/com/android/browser/TitleBar.java
+++ b/src/com/android/browser/TitleBar.java
@@ -26,6 +26,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
+import android.view.accessibility.AccessibilityManager;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
@@ -47,6 +48,7 @@
private BaseUi mBaseUi;
private FrameLayout mContentView;
private PageProgressView mProgress;
+ private AccessibilityManager mAccessibilityManager;
private AutologinBar mAutoLogin;
private NavigationBarBase mNavBar;
@@ -66,6 +68,7 @@
mUiController = controller;
mBaseUi = ui;
mContentView = contentView;
+ mAccessibilityManager = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
initLayout(context);
setFixedTitleBar();
}
@@ -118,6 +121,7 @@
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 == isFixed && parent != null) return;
@@ -436,4 +440,8 @@
}
}
+ public void onResume() {
+ setFixedTitleBar();
+ }
+
}