Search in sources :

Example 66 with SurfaceView

use of android.view.SurfaceView in project grafika by google.

the class RecordFBOActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_record_fbo);
    mSelectedRecordMethod = RECMETHOD_FBO;
    updateControls();
    SurfaceView sv = (SurfaceView) findViewById(R.id.fboActivity_surfaceView);
    sv.getHolder().addCallback(this);
    Log.d(TAG, "RecordFBOActivity: onCreate done");
}
Also used : SurfaceView(android.view.SurfaceView)

Example 67 with SurfaceView

use of android.view.SurfaceView in project android-ocr by rmtheis.

the class CaptureActivity method onPause.

@Override
protected void onPause() {
    if (handler != null) {
        handler.quitSynchronously();
    }
    // Stop using the camera, to avoid conflicting with other camera-based apps
    cameraManager.closeDriver();
    if (!hasSurface) {
        SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
        SurfaceHolder surfaceHolder = surfaceView.getHolder();
        surfaceHolder.removeCallback(this);
    }
    super.onPause();
}
Also used : SurfaceHolder(android.view.SurfaceHolder) SurfaceView(android.view.SurfaceView)

Example 68 with SurfaceView

use of android.view.SurfaceView in project android_frameworks_base by ParanoidAndroid.

the class PluginFullScreenHolder method setContentView.

public void setContentView(View contentView) {
    // Create a FrameLayout that will contain the plugin's view
    mLayout = new CustomFrameLayout(mWebView.getContext());
    FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER);
    mLayout.addView(contentView, layoutParams);
    mLayout.setVisibility(View.VISIBLE);
    // by the ViewManager when it is re-attached to the WebView.
    if (contentView instanceof SurfaceView) {
        final SurfaceView sView = (SurfaceView) contentView;
        if (sView.isFixedSize()) {
            sView.getHolder().setSizeFromLayout();
        }
    }
    mContentView = contentView;
}
Also used : FrameLayout(android.widget.FrameLayout) SurfaceView(android.view.SurfaceView)

Example 69 with SurfaceView

use of android.view.SurfaceView in project platform_frameworks_base by android.

the class TvView method resetSurfaceView.

private void resetSurfaceView() {
    if (mSurfaceView != null) {
        mSurfaceView.getHolder().removeCallback(mSurfaceHolderCallback);
        removeView(mSurfaceView);
    }
    mSurface = null;
    mSurfaceView = new SurfaceView(getContext(), mAttrs, mDefStyleAttr) {

        @Override
        protected void updateWindow(boolean force, boolean redrawNeeded) {
            super.updateWindow(force, redrawNeeded);
            relayoutSessionOverlayView();
        }
    };
    // The surface view's content should be treated as secure all the time.
    mSurfaceView.setSecure(true);
    mSurfaceView.getHolder().addCallback(mSurfaceHolderCallback);
    if (mWindowZOrder == ZORDER_MEDIA_OVERLAY) {
        mSurfaceView.setZOrderMediaOverlay(true);
    } else if (mWindowZOrder == ZORDER_ON_TOP) {
        mSurfaceView.setZOrderOnTop(true);
    }
    addView(mSurfaceView);
}
Also used : SurfaceView(android.view.SurfaceView)

Example 70 with SurfaceView

use of android.view.SurfaceView in project platform_frameworks_base by android.

the class EGL14 method eglCreateWindowSurface.

public static EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, Object win, int[] attrib_list, int offset) {
    Surface sur = null;
    if (win instanceof SurfaceView) {
        SurfaceView surfaceView = (SurfaceView) win;
        sur = surfaceView.getHolder().getSurface();
    } else if (win instanceof SurfaceHolder) {
        SurfaceHolder holder = (SurfaceHolder) win;
        sur = holder.getSurface();
    } else if (win instanceof Surface) {
        sur = (Surface) win;
    }
    EGLSurface surface;
    if (sur != null) {
        surface = _eglCreateWindowSurface(dpy, config, sur, attrib_list, offset);
    } else if (win instanceof SurfaceTexture) {
        surface = _eglCreateWindowSurfaceTexture(dpy, config, win, attrib_list, offset);
    } else {
        throw new java.lang.UnsupportedOperationException("eglCreateWindowSurface() can only be called with an instance of " + "Surface, SurfaceView, SurfaceTexture or SurfaceHolder at the moment, " + "this will be fixed later.");
    }
    return surface;
}
Also used : SurfaceHolder(android.view.SurfaceHolder) SurfaceTexture(android.graphics.SurfaceTexture) SurfaceView(android.view.SurfaceView) Surface(android.view.Surface)

Aggregations

SurfaceView (android.view.SurfaceView)93 SurfaceHolder (android.view.SurfaceHolder)45 View (android.view.View)24 SurfaceTexture (android.graphics.SurfaceTexture)16 Surface (android.view.Surface)13 Button (android.widget.Button)12 Intent (android.content.Intent)11 FrameLayout (android.widget.FrameLayout)11 Bitmap (android.graphics.Bitmap)8 TextView (android.widget.TextView)8 FileOutputStream (java.io.FileOutputStream)8 MotionEvent (android.view.MotionEvent)6 ViewGroup (android.view.ViewGroup)6 ImageView (android.widget.ImageView)6 OnClickListener (android.view.View.OnClickListener)5 CameraManager (com.google.zxing.client.android.camera.CameraManager)5 Activity (android.app.Activity)4 PendingIntent (android.app.PendingIntent)4 IntentFilter (android.content.IntentFilter)4 UsbDevice (android.hardware.usb.UsbDevice)4