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");
}
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();
}
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;
}
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);
}
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;
}
Aggregations