summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenise Cheng <dcheng@codeaurora.org>2012-01-06 17:16:30 -0500
committerSteve Kondik <steve@cyngn.com>2015-11-07 13:57:35 -0800
commit82be3fe1d462c5f784b4bdea9c90f7c8a5fe2c27 (patch)
treeda59f35e666398e10224826b66f0eb906dec3dc5
parent08f360967d0bf28398f80b473d83f057338bbdb8 (diff)
downloadpackages_apps_Browser-82be3fe1d462c5f784b4bdea9c90f7c8a5fe2c27.zip
packages_apps_Browser-82be3fe1d462c5f784b4bdea9c90f7c8a5fe2c27.tar.gz
packages_apps_Browser-82be3fe1d462c5f784b4bdea9c90f7c8a5fe2c27.tar.bz2
Support video transition animation
Change-Id: Idd03f5bb57d6f78ec8b8e407eba01904f392f554
-rw-r--r--src/com/android/browser/BaseUi.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index c098045..b9f61e3 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
+ * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,7 +76,9 @@ public abstract class BaseUi implements UI {
Gravity.CENTER);
private static final int MSG_HIDE_TITLEBAR = 1;
+ private static final int MSG_HIDE_CUSTOM_VIEW = 2;
public static final int HIDE_TITLEBAR_DELAY = 1500; // in ms
+ public static final int HIDE_CUSTOM_VIEW_DELAY = 750; // in ms
Activity mActivity;
UiController mUiController;
@@ -539,22 +542,31 @@ public abstract class BaseUi implements UI {
mActivity.setRequestedOrientation(requestedOrientation);
}
- @Override
- public void onHideCustomView() {
- ((BrowserWebView) getWebView()).setVisibility(View.VISIBLE);
- if (mCustomView == null)
- return;
+ private void hideCustomViewAfterDuration() {
+ Message msg = Message.obtain(mHandler, MSG_HIDE_CUSTOM_VIEW);
+ mHandler.sendMessageDelayed(msg, HIDE_CUSTOM_VIEW_DELAY);
+ }
+
+ private void hideCustomView() {
setFullscreen(false);
FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
decor.removeView(mFullscreenContainer);
mFullscreenContainer = null;
mCustomView = null;
- mCustomViewCallback.onCustomViewHidden();
// Show the content view.
mActivity.setRequestedOrientation(mOriginalOrientation);
}
@Override
+ public void onHideCustomView() {
+ ((BrowserWebView) getWebView()).setVisibility(View.VISIBLE);
+ if (mCustomView == null)
+ return;
+ mCustomViewCallback.onCustomViewHidden();
+ hideCustomViewAfterDuration();
+ }
+
+ @Override
public boolean isCustomViewShowing() {
return mCustomView != null;
}
@@ -826,6 +838,8 @@ public abstract class BaseUi implements UI {
public void handleMessage(Message msg) {
if (msg.what == MSG_HIDE_TITLEBAR) {
suggestHideTitleBar();
+ } else if (msg.what == MSG_HIDE_CUSTOM_VIEW) {
+ hideCustomView();
}
BaseUi.this.handleMessage(msg);
}