From 20329570ba9409637298da90b83f25801d7a3d55 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Wed, 23 Sep 2009 17:42:41 -0400 Subject: [PATCH] When hiding the fake title bar, animate or not based on current scroll. Change-Id: Ib3177e68afa30f3a3c7f42aafe0abbf8b58f0412 --- src/com/android/browser/BrowserActivity.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index ff8a589..5f50694 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -1013,8 +1013,18 @@ public class BrowserActivity extends Activity } private void hideFakeTitleBar() { if (mFakeTitleBar == null) return; + WindowManager.LayoutParams params = (WindowManager.LayoutParams) + mFakeTitleBarHolder.getLayoutParams(); + WebView mainView = mTabControl.getCurrentWebView(); + // Although we decided whether or not to animate based on the current + // scroll position, the scroll position may have changed since the + // fake title bar was displayed. Make sure it has the appropriate + // animation/lack thereof before removing. + params.windowAnimations = mainView != null && mainView.getScrollY() == 0 + ? 0 : com.android.internal.R.style.Animation_DropDownDown; WindowManager manager = (WindowManager) getSystemService(Context.WINDOW_SERVICE); + manager.updateViewLayout(mFakeTitleBarHolder, params); mFakeTitleBarHolder.removeView(mFakeTitleBar); manager.removeView(mFakeTitleBarHolder); mFakeTitleBar = null; -- 2.11.0