summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/TitleBarBase.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-04-07 14:09:28 -0700
committerMichael Kolb <kolby@google.com>2011-04-07 14:10:45 -0700
commiteb0498226a10816b992c63af3a2da98c0efe8c35 (patch)
treee4e64858465c0b08a18d55100dc7c4a41735e51f /src/com/android/browser/TitleBarBase.java
parenta7ff9f6a0e666a45bbbb64f72d0838024b6f05fe (diff)
downloadpackages_apps_Browser-eb0498226a10816b992c63af3a2da98c0efe8c35.zip
packages_apps_Browser-eb0498226a10816b992c63af3a2da98c0efe8c35.tar.gz
packages_apps_Browser-eb0498226a10816b992c63af3a2da98c0efe8c35.tar.bz2
fix titlebar position when focused
Change-Id: Ia84990a68652bd4679be2f72446aa166f7729c7c
Diffstat (limited to 'src/com/android/browser/TitleBarBase.java')
-rw-r--r--src/com/android/browser/TitleBarBase.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/browser/TitleBarBase.java b/src/com/android/browser/TitleBarBase.java
index 93610e2..14ca554 100644
--- a/src/com/android/browser/TitleBarBase.java
+++ b/src/com/android/browser/TitleBarBase.java
@@ -152,6 +152,24 @@ public class TitleBarBase extends RelativeLayout
mSkipTitleBarAnimations = skip;
}
+ void setTitleGravity(int gravity) {
+ int newTop = 0;
+ if (gravity != Gravity.NO_GRAVITY) {
+ View parent = (View) getParent();
+ if (parent != null) {
+ if (gravity == Gravity.TOP) {
+ newTop = parent.getScrollY();
+ }
+ }
+ }
+ AbsoluteLayout.LayoutParams lp = (AbsoluteLayout.LayoutParams)
+ getLayoutParams();
+ if (lp != null) {
+ lp.y = newTop;
+ setLayoutParams(lp);
+ }
+ }
+
void show() {
if (mUseQuickControls) {
mParent.addView(this);