congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SurfaceView.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
android.view.SurfaceView
constructor

Best Java code snippets using android.view.SurfaceView.<init> (Showing top 20 results out of 360)

origin: stackoverflow.com

 SurfaceView view = new SurfaceView(this);
c.setPreviewDisplay(view.getHolder());
c.startPreview();
c.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);
origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}
origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}
origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}
origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}
origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  this.context = context;
  startRequested = false;
  surfaceAvailable = false;
  surfaceView = new SurfaceView(context);
  surfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(surfaceView);
}
origin: googlesamples/android-vision

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}
origin: guardianproject/haven

SurfaceView surfaceView = new SurfaceView(context);
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(
    1, 1,
origin: robolectric/robolectric

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_ACTION_BAR);
  setContentView(new SurfaceView(this));
 }
}
origin: googlesamples/android-vision

/**
 * Opens the camera and starts sending preview frames to the underlying detector.  The preview
 * frames are not displayed.
 *
 * @throws IOException if the camera's preview texture or display could not be initialized
 */
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start() throws IOException {
  synchronized (cameraLock) {
    if (camera != null) {
      return this;
    }
    camera = createCamera();
    // SurfaceTexture was introduced in Honeycomb (11), so if we are running and
    // old version of Android. fall back to use SurfaceView.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      dummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME);
      camera.setPreviewTexture(dummySurfaceTexture);
    } else {
      dummySurfaceView = new SurfaceView(context);
      camera.setPreviewDisplay(dummySurfaceView.getHolder());
    }
    camera.startPreview();
    processingThread = new Thread(frameProcessor);
    frameProcessor.setActive(true);
    processingThread.start();
  }
  return this;
}
origin: googlesamples/android-vision

/**
 * Opens the camera and starts sending preview frames to the underlying detector.  The preview
 * frames are not displayed.
 *
 * @throws IOException if the camera's preview texture or display could not be initialized
 */
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start() throws IOException {
  synchronized (mCameraLock) {
    if (mCamera != null) {
      return this;
    }
    mCamera = createCamera();
    // SurfaceTexture was introduced in Honeycomb (11), so if we are running and
    // old version of Android. fall back to use SurfaceView.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mDummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME);
      mCamera.setPreviewTexture(mDummySurfaceTexture);
    } else {
      mDummySurfaceView = new SurfaceView(mContext);
      mCamera.setPreviewDisplay(mDummySurfaceView.getHolder());
    }
    mCamera.startPreview();
    mProcessingThread = new Thread(mFrameProcessor);
    mFrameProcessor.setActive(true);
    mProcessingThread.start();
  }
  return this;
}
origin: daniulive/SmarterStreaming

bgSurfaceView = new SurfaceView(this);
origin: googlesamples/android-vision

/**
 * Opens the camera and starts sending preview frames to the underlying detector.  The preview
 * frames are not displayed.
 *
 * @throws IOException if the camera's preview texture or display could not be initialized
 */
@RequiresPermission(Manifest.permission.CAMERA)
public CameraSource start() throws IOException {
  synchronized (mCameraLock) {
    if (mCamera != null) {
      return this;
    }
    mCamera = createCamera();
    // SurfaceTexture was introduced in Honeycomb (11), so if we are running and
    // old version of Android. fall back to use SurfaceView.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
      mDummySurfaceTexture = new SurfaceTexture(DUMMY_TEXTURE_NAME);
      mCamera.setPreviewTexture(mDummySurfaceTexture);
    } else {
      mDummySurfaceView = new SurfaceView(mContext);
      mCamera.setPreviewDisplay(mDummySurfaceView.getHolder());
    }
    mCamera.startPreview();
    mProcessingThread = new Thread(mFrameProcessor);
    mFrameProcessor.setActive(true);
    mProcessingThread.start();
  }
  return this;
}
origin: journeyapps/zxing-android-embedded

private void setupSurfaceView() {
  if(useTextureView) {
    textureView = new TextureView(getContext());
    textureView.setSurfaceTextureListener(surfaceTextureListener());
    addView(textureView);
  } else {
    surfaceView = new SurfaceView(getContext());
    surfaceView.getHolder().addCallback(surfaceCallback);
    addView(surfaceView);
  }
}
origin: stackoverflow.com

addContentView(mGLSurfaceView, new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
 mSurfaceView = new SurfaceView(this);
  addContentView(mSurfaceView, new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
 mSurfaceHolder = mSurfaceView.getHolder();
origin: google/ExoPlayer

 break;
default:
 surfaceView = new SurfaceView(context);
 break;
origin: stackoverflow.com

surfaceView = new SurfaceView(this);
LayoutParams layoutParams = new WindowManager.LayoutParams(
  1, 1,
origin: stackoverflow.com

SurfaceView surface = new SurfaceView(this);
 Camera camera = Camera.open();
 try {
origin: stackoverflow.com

super.onCreate(savedInstanceState);
SurfaceView view = new SurfaceView(this);
setContentView(view);
view.getHolder().addCallback(this);
origin: TrustWallet/trust-wallet-android-source

public CameraSourcePreview(Context context, AttributeSet attrs) {
  super(context, attrs);
  mContext = context;
  mStartRequested = false;
  mSurfaceAvailable = false;
  mSurfaceView = new SurfaceView(context);
  mSurfaceView.getHolder().addCallback(new SurfaceCallback());
  addView(mSurfaceView);
}
android.viewSurfaceView<init>

Popular methods of SurfaceView

  • getHolder
  • onMeasure
  • onInitializeAccessibilityEvent
  • onInitializeAccessibilityNodeInfo
  • setLayoutParams
  • onKeyDown
  • setOnTouchListener
  • onDetachedFromWindow
  • setVisibility
  • getLayoutParams
  • onAttachedToWindow
  • onTouchEvent
  • onAttachedToWindow,
  • onTouchEvent,
  • onSizeChanged,
  • setOnClickListener,
  • getHeight,
  • getWidth,
  • setKeepScreenOn,
  • onLayout,
  • setZOrderOnTop

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JList (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now