提交 a8879b21 编写于 作者: Y Yrom Wang

修复被虚拟按键挡住的问题,及虚拟按键随控制条显隐

上级 a8740af5
......@@ -24,6 +24,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Rect;
import android.media.AudioManager;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
......@@ -263,6 +264,9 @@ public class MediaController extends FrameLayout {
*/
public void show(int timeout) {
if (!mShowing && mAnchor != null && mAnchor.getWindowToken() != null) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
mAnchor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
if (mPauseButton != null)
mPauseButton.requestFocus();
disableUnsupportedButtons();
......@@ -278,8 +282,8 @@ public class MediaController extends FrameLayout {
+ mAnchor.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
mWindow.showAtLocation(mAnchor, Gravity.NO_GRAVITY,
anchorRect.left, anchorRect.bottom);
mWindow.showAtLocation(mAnchor, Gravity.BOTTOM,
anchorRect.left, 0);
}
mShowing = true;
if (mShownListener != null)
......@@ -304,6 +308,9 @@ public class MediaController extends FrameLayout {
return;
if (mShowing) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
mAnchor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}
try {
mHandler.removeMessages(SHOW_PROGRESS);
if (mFromXml)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册