SurfaceView setZOrderOnTop - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SurfaceView setZOrderOnTop method.

This code example shows how to use the following methods:setZOrderOnTop, setMediaController, setOnCompletionListener
	 
	public VideoView getVideoView()
	{ 
		if (_videoView == null)
		{ 
			_videoView = new VideoView(getActivity());
			_videoView.setZOrderOnTop(true);
			_videoView.setMediaController(new MediaController(getActivity()));
			_videoView.setOnCompletionListener(this);
		} 
		 
		return _videoView;
	} 
	 
	public void onCompletion(MediaPlayer mp)
	{ 
		dispatchStatusEventAsync("PLAYBACK_DID_FINISH", "OK"); 
	} 
} 
6
CodeRank
This code example shows how to use the following methods:setEGLConfigChooser, setEGLContextClientVersion, setRenderMode, setRenderer, getHolder
        super.onCreate(savedInstanceState);
 
        objLoader = new ObjLoader(this, "simple2");
        objLoader.load();
 
        surfaceView = new GLSurfaceView(this);
        surfaceView.setEGLContextClientVersion(2);
 
        //设置背景透明 
        surfaceView.setEGLConfigChooser(8, 8, 8, 8, 0, 0);
        surfaceView.setZOrderOnTop(true);
        surfaceView.getHolder().setFormat(PixelFormat.TRANSPARENT);
 
        surfaceView.setRenderer(this);
        surfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
 
        setContentView(surfaceView);
    } 
 
    @Override 
6
CodeRank
This code example shows how to use the following methods:setEGLConfigChooser, setEGLContextClientVersion, setRenderer, getHolder, setZOrderOnTop
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
         
        glView = new GLSurfaceView(this);
        // Create an OpenGL ES 2.0 context. 
        glView.setEGLContextClientVersion(2);
        //rgba_8888 
        glView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
        // Set the Renderer for drawing on the GLSurfaceView 
        glView.setRenderer(new MyGLRenderer());
         
        setContentView(glView);
         
        //set translucent view 
        glView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
        // put glView on the top of window 
        glView.setZOrderOnTop(true);
 

6
CodeRank
This code example shows how to use the following methods:setEGLConfigChooser, getHolder, setZOrderOnTop
    	if(transparent) {
            mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
            mSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
            mSurfaceView.setZOrderOnTop(true);
    	} else { 
            mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
            mSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
            mSurfaceView.setZOrderOnTop(false);
    	} 
    } 
     
    protected void setRenderer(RajawaliRenderer renderer) {
    	mRajRenderer = renderer;
    	mSurfaceView.setRenderer(renderer);
    } 
     
    @Override 
	public void onResume() { 
    	super.onResume(); 
    	mSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
5
CodeRank
This code example shows how to use the following methods:setEGLConfigChooser, getHolder, setZOrderOnTop
    	if(transparent) {
            mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
            mSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
            mSurfaceView.setZOrderOnTop(true);
    	} else { 
            mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
            mSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
            mSurfaceView.setZOrderOnTop(false);
    	} 
    } 
     
    protected void setRenderer(RajawaliRenderer renderer) {
    	mRajRenderer = renderer;
    	mSurfaceView.setRenderer(renderer);
    } 
     
    @Override 
    protected void onResume() { 
    	super.onResume(); 
    	mSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
5
CodeRank
This code example shows how to use the following methods:setEGLConfigChooser, getHolder, setZOrderOnTop
    	if(transparent) {
            mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
            mSurfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
            mSurfaceView.setZOrderOnTop(true);
    	} else { 
            mSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 16, 0);
            mSurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
            mSurfaceView.setZOrderOnTop(false);
    	} 
    } 
     
    protected void setRenderer(RajawaliRenderer renderer) {
    	mSurfaceView.setRenderer(renderer);
    } 
     
    @Override 
	public void onResume() { 
    	super.onResume(); 
    	mSurfaceView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
    	mSurfaceView.onResume();
5
CodeRank
This code example shows how to use the following methods:getHolder, setZOrderOnTop
		            PixelFormat.OPAQUE); 
		if(w!=-1 && h!=-1) {
			params.width=w;
			params.height=h;
		} 
		surfaceView = new SurfaceView(this);
		surfaceView.getHolder().addCallback(this);
		surfaceView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
		surfaceView.setZOrderOnTop(true);
		DisplayMetrics dm = new DisplayMetrics();
		wm.getDefaultDisplay().getMetrics(dm);
		wm.addView(surfaceView, params);
	} 
	 
	public void setNotifaction(boolean show) {
		NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
		if(show) {
			NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
			        .setSmallIcon(android.R.drawable.ic_media_play)
			        .setContentTitle("krcam") 
5
CodeRank

Related SurfaceView setZOrderOnTop Questions & Answers:

setZOrderOnTop Method Overview
Control whether the surface view's surface is placed on top of its window.
See Code Examples for other Android SurfaceView Methods: