Best code examples for Android SurfaceView class (android.view.SurfaceView)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SurfaceView class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android SurfaceView examples from Open Source projects
This code example shows how to use the following methods: getHolder, setLayoutParams
61:	mSurfaceView = new SurfaceView(this); 
62:	mSurfaceView.setLayoutParams(surfaceParams); 
-
77:	mSurfaceHolder = mSurfaceView.getHolder(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getHolder, setFocusable, setFocusableInTouchMode, setOnTouchListener
173:	mPreview = new SurfaceView(this); 
-
182:	mPreview.setFocusable(true); 
183:	mPreview.setFocusableInTouchMode(true); 
184:	mPreview.setOnTouchListener(this); 
-
187:	mHolder = mPreview.getHolder(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getHolder
48:	mHolder = mSurfaceView.getHolder(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getHolder
174:	mSurfaceView = new SurfaceView(context); 
-
177:	mHolder = mSurfaceView.getHolder(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
36:	mGLSurfaceView = new GLSurfaceView(this); 
-
40:	mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
-
43:	mGLSurfaceView.setRenderer(new CubeRenderer(true)); 
-
45:	mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getHolder
33:	mFiltered.getHolder().setFormat(ImageFormat.YV12); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setLayoutParams
39:	mPreviewView = new SurfaceView(getContext()); 
-
43:	mPreviewView.setLayoutParams(previewParams); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
25:	glView = new GLSurfaceView(this); 
26:	glView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
27:	glView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
28:	glView.setRenderer(this); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getHolder
51:	mSurfaceView = new SurfaceView(context); 
-
56:	mHolder = mSurfaceView.getHolder(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
40:	mSurfaceView = new SurfaceView(context, attributeSet); 
-
44:	mHolder = mSurfaceView.getHolder(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
43:	final SurfaceView view = new SurfaceView(context); 
-
50:	view.getHolder().setFormat(PixelFormat.RGBA_8888); 
51:	view.getHolder().addCallback(new Callback() { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: post, removeCallbacks
99:	mSurfaceView.removeCallbacks(mAction); 
100:	mSurfaceView.post(mAction); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
36:	mGLSurfaceView = new GLSurfaceView(this); 
-
40:	mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
-
43:	mGLSurfaceView.setRenderer(new CubeRenderer(true)); 
-
45:	mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setZOrderOnTop, setMediaController, setOnCompletionListener
78:	_videoView = new VideoView(getActivity()); 
79:	_videoView.setZOrderOnTop(true); 
80:	_videoView.setMediaController(new MediaController(getActivity())); 
81:	_videoView.setOnCompletionListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder, setVisibility, setLayoutParams
154:	surfaceView.setVisibility(View.VISIBLE); 
-
235:	surfaceView = new SurfaceView(currentActivity); 
236:	surfaceView.getHolder().addCallback(new SurfaceViewCallback()); 
237:	surfaceView.setVisibility(View.GONE); 
-
240:	surfaceView.setLayoutParams(params); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
48:	SurfaceView localRender = new SurfaceView(context); 
49:	g_localRenderer = localRender.getHolder(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
52:	mGLSurfaceView = new GLSurfaceView(this); 
-
57:	mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
-
60:	mGLSurfaceView.setRenderer(mRenderer); 
-
63:	mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight, getLayoutParams, getWidth
129:	.getLayoutParams(); 
-
136:	int surfaceViewHeight = surfaceView.getHeight(); 
137:	int surfaceViewWidth = surfaceView.getWidth(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getLayoutParams, setLayoutParams
83:	RelativeLayout.LayoutParams params = (LayoutParams) mSurfaceView.getLayoutParams(); 
-
86:	mSurfaceView.setLayoutParams(params); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
48:	SurfaceView localRender = new SurfaceView(context); 
49:	g_localRenderer = localRender.getHolder(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
36:	mGLSurfaceView = new GLSurfaceView(this); 
-
40:	mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
-
43:	mGLSurfaceView.setRenderer(new CubeRenderer(true)); 
-
45:	mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
70:	mCameraView.getHolder().getSurface()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder, getContext, getHeight, getWidth
29:	mContext = mSurfaceView.getContext(); 
30:	mSurfaceHolder = mSurfaceView.getHolder(); 
-
32:	mSurfaceRect.set(new Rect(0, 0, mSurfaceView.getWidth(), mSurfaceView 
33:	.getHeight())); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setEGLContextClientVersion, setRenderMode, setRenderer, getHolder
56:	surfaceView = new GLSurfaceView(this); 
57:	surfaceView.setEGLContextClientVersion(2); 
-
60:	surfaceView.setEGLConfigChooser(8, 8, 8, 8, 0, 0); 
61:	surfaceView.setZOrderOnTop(true); 
62:	surfaceView.getHolder().setFormat(PixelFormat.TRANSPARENT); 
-
64:	surfaceView.setRenderer(this); 
65:	surfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setEGLContextClientVersion, setRenderer, getHolder, setZOrderMediaOverlay
26:	mGLView.setEGLContextClientVersion(2); 
27:	mGLView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
28:	mGLView.setRenderer(new OpenGLRenderer(mainInterface)); 
29:	mGLView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
30:	mGLView.setZOrderMediaOverlay(true); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
24:	mSurfaceView = new SurfaceView(context); 
-
27:	mHolder = mSurfaceView.getHolder(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
13:	mGLSurfaceView = new GLSurfaceView(this); 
-
15:	mGLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
-
17:	mGLSurfaceView.setRenderer(new MyRenderer(true)); 
-
19:	mGLSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight, getLayoutParams, getWidth, setLayoutParams
118:	int previewSurfaceWidth = preview.getWidth(); 
119:	int previewSurfaceHeight = preview.getHeight(); 
-
121:	LayoutParams lp = preview.getLayoutParams(); 
-
134:	preview.setLayoutParams(lp); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHolder, setOnTouchListener
252:	mSurfaceView = new SurfaceView(getApplication()); 
253:	SurfaceHolder holder = mSurfaceView.getHolder(); 
-
256:	mSurfaceView.setOnTouchListener(new ViewTouchHandler(mActivity)); 
257:	setContentView(mSurfaceView); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setVisibility, setMediaController, setVideoURI, start
196:	mVideoView.setVideoURI(mVideoUri); 
-
198:	mVideoView.setVisibility(View.VISIBLE); 
199:	mVideoView.setMediaController(new MediaController(this)) ; 
200:	mVideoView.start(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
51:	glView = new GLSurfaceView(this); 
52:	glView.setEGLConfigChooser(8, 8, 8, 8, 0, 0); 
53:	glView.getHolder().setFormat(PixelFormat.RGBA_8888); 
54:	glView.setRenderer(this); 
-
57:	glGraphics = new GLGraphics(glView); 
-
60:	input = new Input(this, glView, 1, 1); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
48:	SurfaceView localRender = new SurfaceView(context); 
49:	g_localRenderer = localRender.getHolder(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHolder
41:	surfaceHolder = view.getHolder(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setEGLContextClientVersion, setRenderer, getHolder, setZOrderOnTop
27:	glView = new GLSurfaceView(this); 
-
29:	glView.setEGLContextClientVersion(2); 
-
31:	glView.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
-
33:	glView.setRenderer(new MyGLRenderer()); 
-
38:	glView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
-
40:	glView.setZOrderOnTop(true); 
-
47:	glView.getParent().bringChildToFront(glView); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getHeight, getLayoutParams, getWidth, setLayoutParams
110:	int previewSurfaceWidth = preview.getWidth(); 
111:	int previewSurfaceHeight = preview.getHeight(); 
-
113:	LayoutParams lp = preview.getLayoutParams(); 
-
132:	preview.setLayoutParams(lp); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHeight, getWidth
145:	int width = video.getWidth(); 
146:	int height = video.getHeight(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHolder, setOnTouchListener
21:	SurfaceView view = new SurfaceView(getApplicationContext()); 
22:	SurfaceHolder holder = view.getHolder(); 
-
31:	view.setOnTouchListener(this); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHeight, getLayoutParams, getWidth, setLayoutParams
158:	int anchuraVisor = swVisor.getWidth(); 
159:	int alturaVisor = swVisor.getHeight(); 
-
165:	LayoutParams lp = swVisor.getLayoutParams(); 
-
180:	swVisor.setLayoutParams(lp); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setEGLConfigChooser, setRenderer, getHolder
243:	glSurface = new GLSurfaceView(this); 
244:	glSurface.setEGLConfigChooser(8, 8, 8, 8, 16, 0); 
245:	glSurface.setRenderer(renderer); 
246:	glSurface.getHolder().setFormat(PixelFormat.TRANSLUCENT); 
247:	glSurface.getHolder().addCallback(this); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setEGLContextClientVersion, setRenderer, setZOrderMediaOverlay
117:	mGLSurfaceView = new GLSurfaceView(this); 
-
124:	mGLSurfaceView.setEGLContextClientVersion(2); 
-
135:	mGLSurfaceView.setRenderer(mRenderer); 
-
144:	mGLSurfaceView.setZOrderMediaOverlay(true); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setRenderer, setZOrderMediaOverlay, setLayoutParams, setOnTouchListener
39:	glSurface = new GLSurfaceView(this); 
-
41:	glSurface.setRenderer(render); 
42:	glSurface.setOnTouchListener(render); 
-
60:	glSurface.setZOrderMediaOverlay(true); 
61:	glSurface.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setEGLContextClientVersion, setRenderer, getHolder
40:	mGlSurfaceView = new GLSurfaceView(mContext); 
41:	mGlSurfaceView.getHolder().addCallback(this); 
-
47:	mGlSurfaceView.setEGLContextClientVersion(2); 
-
66:	mGlSurfaceView.setRenderer(mGRenderer); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHolder
306:	SurfaceView view = new SurfaceView(this); 
307:	SurfaceHolder holder = view.getHolder(); 
-
367:	setContentView(view); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHolder
96:	theSurfaceView = new SurfaceView(theActivity); 
-
108:	_mySurfaceHolder = theSurfaceView.getHolder(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHolder, setFocusable, setOnTouchListener
48:	view.setOnTouchListener(this); 
-
51:	SurfaceHolder holder = view.getHolder(); 
-
56:	view.setFocusable(true); // make sure we get key events 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHolder, setZOrderMediaOverlay, setOnClickListener
59:	mSurfaceView = new SurfaceView(activity); 
60:	mSurfaceHolder = mSurfaceView.getHolder(); 
-
62:	mSurfaceView.setZOrderMediaOverlay(true); 
63:	mSurfaceView.setOnClickListener(this); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getHolder
32:	mSurfaceView = new SurfaceView(context); 
-
37:	mHolder = mSurfaceView.getHolder(); 
Full Snippet Info
5
CodeRank
Related Android SurfaceView Questions & Answers:
See Code Examples for Android SurfaceView Methods: