本文整理汇总了Java中android.view.SurfaceView.getHolder方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceView.getHolder方法的具体用法?Java SurfaceView.getHolder怎么用?Java SurfaceView.getHolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.SurfaceView
的用法示例。
在下文中一共展示了SurfaceView.getHolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onResume
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
Log.d(TAG, "xxxxxxxxxxxxxxxxxxxonResume");
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
playBeep = true;
final AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
playBeep = false;
}
initBeepSound();
vibrate = true;
}
示例2: onPause
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onPause() {
if (handler != null) {
handler.quitSynchronously();
handler = null;
}
inactivityTimer.onPause();
ambientLightManager.stop();
beepManager.close();
cameraManager.closeDriver();
if (!hasSurface) {
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
surfaceHolder.removeCallback(this);
}
super.onPause();
}
示例3: onResume
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
if (hasSurface) {
initCamera(surfaceHolder);
} else {
surfaceHolder.addCallback(this);
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
decodeFormats = null;
characterSet = null;
playBeep = true;
AudioManager audioService = (AudioManager) getSystemService(AUDIO_SERVICE);
if (audioService.getRingerMode() != AudioManager.RINGER_MODE_NORMAL) {
playBeep = false;
}
initBeepSound();
vibrate = true;
}
示例4: onCreate
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
log("onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shoot);
Intent intent = getIntent();
settings = Settings.getFromIntent(intent);
shotCount = 0;
takingPicture = false;
tvCount = (TextView) findViewById(R.id.tvCount);
//tvInfo = (TextView) findViewById(R.id.tvInfo);
reviewSurfaceView = (SurfaceView) findViewById(R.id.surfaceView);
reviewSurfaceView.setZOrderOnTop(false);
cameraSurfaceHolder = reviewSurfaceView.getHolder();
cameraSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
示例5: onCreate
import android.view.SurfaceView; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFormat(PixelFormat.TRANSLUCENT); // 使得窗口支持透明度
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.nim_capture_video_activity);
setTitle(R.string.video_record);
parseIntent();
findViews();
initActionBar();
setViewsListener();
updateRecordUI();
getVideoPreviewSize();
surfaceview = (SurfaceView) this.findViewById(R.id.videoView);
SurfaceHolder holder = surfaceview.getHolder();
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
holder.addCallback(this);
resizeSurfaceView();
}
示例6: Holder
import android.view.SurfaceView; //导入方法依赖的package包/类
Holder(int adapterPosition, View rootView) {
super(adapterPosition, rootView);
FlingRelativeLayout flingRelativeLayout = (FlingRelativeLayout) rootView.findViewById(R.id.fling_root_view);
flingRelativeLayout.setOnClickListener(v -> toggleFullscreen());
flingRelativeLayout.setOnSingleFlingListener(new CloseOnFlingListener(rootView.getContext()) {
@Override
public boolean onVerticalFling(float distanceByY) {
goBack();
return true;
}
});
mSurfaceView = (SurfaceView) rootView.findViewById(R.id.surface_view);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
mAspectRatioLayout = (AlternativeAspectRatioFrameLayout) rootView.findViewById(R.id.aspect_ratio_layout);
mProgressBar = (ProgressBar) rootView.findViewById(R.id.preparing_progress_bar);
}
示例7: initView
import android.view.SurfaceView; //导入方法依赖的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加入回调接口
}
示例8: onPause
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onPause() {
if (handler != null) {
handler.quitSynchronously();
handler = null;
}
inactivityTimer.onPause();
ambientLightManager.stop();
beepManager.close();
cameraManager.closeDriver();
// historyManager = null; // Keep for onActivityResult
if (!hasSurface) {
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
surfaceHolder.removeCallback(this);
}
super.onPause();
}
示例9: onCreate
import android.view.SurfaceView; //导入方法依赖的package包/类
/**
*
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.activity_media_player);
mPreview = (SurfaceView) findViewById(R.id.surface);
mProgressBar = (ProgressBar) findViewById(R.id.progress_bar);
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
extras = getIntent().getExtras();
path = extras.getString("url");
mProgressBar.setVisibility(View.VISIBLE);
}
示例10: surfaceCreated
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
Log.d(TAG, "surfaceCreated holder=" + holder);
// If we already have a Surface, we just need to resume the frame notifications.
SurfaceView sv = (SurfaceView) findViewById(R.id.scheduledSwap_surfaceView);
mRenderThread = new RenderThread(sv.getHolder(), this);
mRenderThread.setName("ScheduledSwap GL render");
mRenderThread.start();
mRenderThread.waitUntilReady();
RenderHandler rh = mRenderThread.getHandler();
if (rh != null) {
rh.sendSetParameters(mUpdatePatternIndex, mFramesAheadIndex);
rh.sendSurfaceCreated();
}
// start the draw events
Choreographer.getInstance().postFrameCallback(this);
}
示例11: onCreate
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_texture_from_camera);
mHandler = new MainHandler(this);
SurfaceView sv = (SurfaceView) findViewById(R.id.cameraOnTexture_surfaceView);
SurfaceHolder sh = sv.getHolder();
sh.addCallback(this);
mZoomBar = (SeekBar) findViewById(R.id.tfcZoom_seekbar);
mSizeBar = (SeekBar) findViewById(R.id.tfcSize_seekbar);
mRotateBar = (SeekBar) findViewById(R.id.tfcRotate_seekbar);
mZoomBar.setProgress(DEFAULT_ZOOM_PERCENT);
mSizeBar.setProgress(DEFAULT_SIZE_PERCENT);
mRotateBar.setProgress(DEFAULT_ROTATE_PERCENT);
mZoomBar.setOnSeekBarChangeListener(this);
mSizeBar.setOnSeekBarChangeListener(this);
mRotateBar.setOnSeekBarChangeListener(this);
updateControls();
}
示例12: onCreate
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_continuous_capture);
SurfaceView sv = (SurfaceView) findViewById(R.id.continuousCapture_surfaceView);
SurfaceHolder sh = sv.getHolder();
sh.addCallback(this);
mHandler = new MainHandler(this);
mHandler.sendEmptyMessageDelayed(MainHandler.MSG_BLINK_TEXT, 1500);
mOutputFile = new File(getFilesDir(), "continuous-capture.mp4");
mSecondsOfVideo = 0.0f;
updateControls();
}
示例13: onPause
import android.view.SurfaceView; //导入方法依赖的package包/类
public void onPause() {
if (handler != null) {
handler.quitSynchronously();
handler = null;
}
if (inactivityTimer != null) {
inactivityTimer.onPause();
}
if (ambientLightManager != null) {
ambientLightManager.stop();
}
if (beepManager != null) {
beepManager.close();
}
if (cameraManager != null) {
cameraManager.closeDriver();
}
if (!hasSurface) {
mSurfaceView = new SurfaceView(mActivity, null);
SurfaceHolder surfaceHolder = mSurfaceView.getHolder();
surfaceHolder.removeCallback(this);
}
}
示例14: onPause
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
protected void onPause() {
if (handler != null) {
handler.quitSynchronously();
handler = null;
}
inactivityTimer.onPause();
ambientLightManager.stop();
beepManager.close();
cameraManager.closeDriver();
//historyManager = null; // Keep for onActivityResult
if (!hasSurface) {
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
SurfaceHolder surfaceHolder = surfaceView.getHolder();
surfaceHolder.removeCallback(this);
}
super.onPause();
}
示例15: InitTouchPoint
import android.view.SurfaceView; //导入方法依赖的package包/类
private void InitTouchPoint() {
trackpadTouchPoint = (SurfaceView) view.findViewById(R.id.trackpad_surfaceView);
trackpadTouchPoint.setZOrderOnTop(true);
holder = trackpadTouchPoint.getHolder();
holder.setFormat(PixelFormat.TRANSPARENT);
paint = new Paint();
paint.setColor(getResources().getColor(R.color.touchpoint));
}