package com.sikkha.skline.myview;
import android.content.Context;
import android.util.AttributeSet;
import android.view.WindowManager;
import android.widget.VideoView;
import java.util.Objects;
/**
* ================================================
*
* @author:Vip 版 本:V4.1.4
* 创建日期:2018/6/29
* 描 述:解决华为pad上不充满屏幕问题
* 修订历史:
* ================================================
*/
public class FullScreenVideoView extends VideoView {
public FullScreenVideoView(Context context) {
super(context);
}
public FullScreenVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public FullScreenVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
int width = Objects.requireNonNull(wm).getDefaultDisplay().getWidth();
int height = wm.getDefaultDisplay().getHeight();
setMeasuredDimension(width, height);
}
}
自定义FullScreenVideoView
最新推荐文章于 2024-01-31 15:38:07 发布
