Google is committed to advancing racial equity for Black communities. See how.

PreviewView.ImplementationMode

public static final enum PreviewView.ImplementationMode
extends Enum<PreviewView.ImplementationMode>

java.lang.Object
   ↳ java.lang.Enum<androidx.camera.view.PreviewView.ImplementationMode>
     ↳ androidx.camera.view.PreviewView.ImplementationMode


The implementation mode of a PreviewView.

PreviewView manages the preview Surface by either using a SurfaceView or a TextureView. A SurfaceView is generally better than a TextureView when it comes to certain key metrics, including power and latency, which is why PreviewView tries to use a SurfaceView by default, but will fall back to use a TextureView when it's explicitly set by calling PreviewView.setPreferredImplementationMode(ImplementationMode) with TEXTURE_VIEW, or when the device does not support using a SurfaceView well (for example on LEGACY devices and devices running on API 24 or less).

Summary

Enum values

PreviewView.ImplementationMode  SURFACE_VIEW

Use a SurfaceView for the preview. 

PreviewView.ImplementationMode  TEXTURE_VIEW

Use a TextureView for the preview  

Public methods

static PreviewView.ImplementationMode valueOf(String name)
static final ImplementationMode[] values()

Inherited methods

Enum values

SURFACE_VIEW

public static final PreviewView.ImplementationMode SURFACE_VIEW

Use a SurfaceView for the preview. If the device doesn't support it well, PreviewView will fall back to use a TextureView instead.

TEXTURE_VIEW

public static final PreviewView.ImplementationMode TEXTURE_VIEW

Use a TextureView for the preview

Public methods

valueOf

public static PreviewView.ImplementationMode valueOf (String name)

Parameters
name String

Returns
PreviewView.ImplementationMode

values

public static final ImplementationMode[] values ()

Returns
ImplementationMode[]