本文整理了Java中android.view.SurfaceView.onMeasure()
方法的一些代码示例,展示了SurfaceView.onMeasure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SurfaceView.onMeasure()
方法的具体详情如下:
包路径:android.view.SurfaceView
类名称:SurfaceView
方法名:onMeasure
暂无
代码示例来源:origin: jiajunhui/PlayerBase
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mRenderMeasure.doMeasure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(mRenderMeasure.getMeasureWidth(),mRenderMeasure.getMeasureHeight());
}
代码示例来源:origin: brianwernick/ExoMedia
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (!measureBasedOnAspectRatio) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
notifyOnSizeChangeListener(getMeasuredWidth(), getMeasuredHeight());
return;
代码示例来源:origin: mrmaffen/vlc-android-sdk
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: small-dream/VideoRecord
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: pedroSG94/vlc-example-streamplayer
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: ymcao/YaPlayer
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: cmusatyalab/gabriel
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// TODO Auto-generated method stub
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
代码示例来源:origin: wobiancao/RtspServerAndVlcPlay
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: WangShuo1143368701/VideoView
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: SwiftyWang/FingerColoring-Android
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
代码示例来源:origin: SingleShu/VideoRecord
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
float ratio = 1f * size.height / size.width;
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = (int) (width / ratio);
int wms = MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY);
int hms = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(wms, hms);
}
}
代码示例来源:origin: laserwave/reversi
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
widthMeasureSpec = View.MeasureSpec.makeMeasureSpec((int) bgLength, View.MeasureSpec.EXACTLY);
heightMeasureSpec = View.MeasureSpec.makeMeasureSpec((int) bgLength, View.MeasureSpec.EXACTLY);
setMeasuredDimension(widthMeasureSpec, heightMeasureSpec);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
代码示例来源:origin: Json-Dan/ImageEditor
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
viewWidth = getWidth();
viewHeight = getHeight();
}
代码示例来源:origin: dalong982242260/SmallVideoRecording
@SuppressLint("NewApi")
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (isUserSize) {
doMeasure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(mMeasuredWidth, mMeasuredHeight);
setCameraDistance(0.5f);
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: JackWHLiu/jackknife
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = 0;
int height = 0;
try {
InputStream inputStream = getContext().getAssets().open(path);
mMovie = Movie.decodeStream(inputStream);
width = mMovie.width();
height = mMovie.height();
mHandler.post(r);
} catch(IOException e) {
e.printStackTrace();
}
setMeasuredDimension((int)(width*zoom),(int)(height*zoom));
}
代码示例来源:origin: wangchengmeng/LotteryTurntable
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
//直接控制Span为正方形
int width = Math.min(getMeasuredWidth(), getMeasuredHeight());
mPadding = getPaddingLeft();
//直径
mRadius = width - mPadding * 2;
//设置中心点
mCenter = width / 2;
//设置成正方形
setMeasuredDimension(width, width);
}
代码示例来源:origin: joselyncui/RedPackets
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
this.mWidth = getMeasuredWidth();
this.mHeight = getMeasuredHeight();
mSpriteManager = SpriteManager.getInstance();
mSpriteManager.init(mContext,mWidth,mHeight);
}
代码示例来源:origin: joselyncui/RedPackets
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mHeight = getMeasuredHeight();
mWidth = getMeasuredWidth();
spriteManager = SpriteManager.getInstance();
spriteManager.init(context,mWidth,mHeight);
}
代码示例来源:origin: DeviceConnect/DeviceConnect-Android
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mVARM.getAspectRatio() > 0 && mAspectRatioMode == ASPECT_RATIO_PREVIEW) {
mVARM.measure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(mVARM.getMeasuredWidth(), mVARM.getMeasuredHeight());
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
代码示例来源:origin: hypeapps/Endoscope
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mVARM.getAspectRatio() > 0 && mAspectRatioMode == ASPECT_RATIO_PREVIEW) {
mVARM.measure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(mVARM.getMeasuredWidth(), mVARM.getMeasuredHeight());
} else {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}
内容来源于网络,如有侵权,请联系作者删除!