本文整理匯總了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);
}