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

ImplementationMode

class ImplementationMode
kotlin.Any
   ↳ kotlin.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 android.view.SurfaceView or a android.view.TextureView. A android.view.SurfaceView is generally better than a android.view.TextureView when it comes to certain key metrics, including power and latency, which is why PreviewView tries to use a android.view.SurfaceView by default, but will fall back to use a android.view.TextureView when it's explicitly set by calling setPreferredImplementationMode(ImplementationMode) with ImplementationMode#TEXTURE_VIEW, or when the device does not support using a android.view.SurfaceView well (for example on LEGACY devices and devices running on API 24 or less).

Summary

Enum values

Use a android.view.SurfaceView for the preview.

Use a android.view.TextureView for the preview

Enum values

SURFACE_VIEW

enum val SURFACE_VIEW : PreviewView.ImplementationMode

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

TEXTURE_VIEW

enum val TEXTURE_VIEW : PreviewView.ImplementationMode

Use a android.view.TextureView for the preview