summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-12-02 15:37:15 -0800
committerMichael Kolb <kolby@google.com>2011-12-02 16:12:02 -0800
commitc07b678522b46e77a2817e9749fe6d32b28af700 (patch)
tree9ef0304e15578849faa9e1e3dd85f87bed0f9499 /core
parent613ed4c69a53e6ffb1f104c7d45a0c6dd41c8eb0 (diff)
downloadframeworks_base-c07b678522b46e77a2817e9749fe6d32b28af700.zip
frameworks_base-c07b678522b46e77a2817e9749fe6d32b28af700.tar.gz
frameworks_base-c07b678522b46e77a2817e9749fe6d32b28af700.tar.bz2
set System UI visibility based on MediaController state
Bug: 5494143 still doesn't remove the buttons in dimmed state, but at least dims them correctly Change-Id: Idcfc10616d31f6ccf8cd84b706a17d048bf505a1
Diffstat (limited to 'core')
-rw-r--r--core/java/android/webkit/HTML5VideoFullScreen.java37
1 files changed, 30 insertions, 7 deletions
diff --git a/core/java/android/webkit/HTML5VideoFullScreen.java b/core/java/android/webkit/HTML5VideoFullScreen.java
index cb555ea..e1eff58 100644
--- a/core/java/android/webkit/HTML5VideoFullScreen.java
+++ b/core/java/android/webkit/HTML5VideoFullScreen.java
@@ -4,15 +4,12 @@ package android.webkit;
import android.content.Context;
import android.media.MediaPlayer;
import android.media.Metadata;
-import android.util.Log;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
-import android.webkit.HTML5VideoView;
-import android.webkit.HTML5VideoViewProxy;
import android.widget.FrameLayout;
import android.widget.MediaController;
import android.widget.MediaController.MediaPlayerControl;
@@ -150,7 +147,7 @@ public class HTML5VideoFullScreen extends HTML5VideoView
private void prepareForFullScreen() {
// So in full screen, we reset the MediaPlayer
mPlayer.reset();
- MediaController mc = new MediaController(mProxy.getContext());
+ MediaController mc = new FullScreenMediaController(mProxy.getContext(), mLayout);
mc.setSystemUiVisibility(mLayout.getSystemUiVisibility());
setMediaController(mc);
mPlayer.setScreenOnWhilePlaying(true);
@@ -261,9 +258,6 @@ public class HTML5VideoFullScreen extends HTML5VideoView
mLayout.addView(getSurfaceView(), layoutParams);
mLayout.setVisibility(View.VISIBLE);
- mLayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
- | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
-
WebChromeClient client = webView.getWebChromeClient();
if (client != null) {
client.onShowCustomView(mLayout, mCallback);
@@ -340,4 +334,33 @@ public class HTML5VideoFullScreen extends HTML5VideoView
}
return;
}
+
+ static class FullScreenMediaController extends MediaController {
+
+ View mVideoView;
+
+ public FullScreenMediaController(Context context, View video) {
+ super(context);
+ mVideoView = video;
+ }
+
+ @Override
+ public void show() {
+ super.show();
+ if (mVideoView != null) {
+ mVideoView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
+ }
+ }
+
+ @Override
+ public void hide() {
+ if (mVideoView != null) {
+ mVideoView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
+ }
+ super.hide();
+ }
+
+ }
+
}