本文整理汇总了Java中android.view.SurfaceHolder.setKeepScreenOn方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceHolder.setKeepScreenOn方法的具体用法?Java SurfaceHolder.setKeepScreenOn怎么用?Java SurfaceHolder.setKeepScreenOn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.SurfaceHolder
的用法示例。
在下文中一共展示了SurfaceHolder.setKeepScreenOn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initView
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
protected void initView() {
mSurfaceview = (SurfaceView) findViewById(R.id.surfaceview);
mRlTakeVedio = (RelativeLayout) findViewById(R.id.rl_take_vedio);
mIvCancel = (ImageView) findViewById(R.id.iv_cancel);
mTrpbController = (TimeRoundProgressBar) findViewById(R.id.trpb_controller);
mRlConfrmVedio = (RelativeLayout) findViewById(R.id.rl_confrm_vedio);
mIvDelete = (ImageView) findViewById(R.id.iv_delete);
mIvConfirm = (ImageView) findViewById(R.id.iv_confirm);
mDialog = ERecorderActivityImpl.getCreateVedioDialog(getActivity());
mTrpbController.setMax(mRecordTime);
SurfaceHolder holder = mSurfaceview.getHolder();// 取得holder
holder.setFormat(PixelFormat.TRANSPARENT);
holder.setKeepScreenOn(true);
holder.addCallback(this); // holder加入回调接口
}
示例2: updateSurfaceScreenOn
import android.view.SurfaceHolder; //导入方法依赖的package包/类
private void updateSurfaceScreenOn() {
if (this.mSurfaceHolder != null) {
SurfaceHolder surfaceHolder = this.mSurfaceHolder;
boolean z = this.mScreenOnWhilePlaying && this.mStayAwake;
surfaceHolder.setKeepScreenOn(z);
}
}
示例3: surfaceCreated
import android.view.SurfaceHolder; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
holder.setKeepScreenOn(true);
mPreviewSurface = holder.getSurface();
startPreview(holder);
}