public enum

PreviewView.ImplementationMode

extends java.lang.Enum<PreviewView.ImplementationMode>

 java.lang.Object

↳java.lang.Enum<PreviewView.ImplementationMode>

↳androidx.camera.view.PreviewView.ImplementationMode

Overview

The implementation mode of a PreviewView.

User preference on how the PreviewView should render the preview. PreviewView displays the preview with either a or a TextureView. A is generally better than a TextureView when it comes to certain key metrics, including power and latency. On the other hand, TextureView is better supported by a wider range of devices. The option is used by PreviewView to decide what is the best internal implementation given the device capabilities and user configurations.

Summary

Enum Constants
COMPATIBLEUse a TextureView for the preview.
PERFORMANCEUse a for the preview when possible.
Methods
public static PreviewView.ImplementationModevalueOf(java.lang.String name)

public static PreviewView.ImplementationModevalues()

from java.lang.Enum<E>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
from java.lang.ObjectgetClass, notify, notifyAll, wait, wait, wait

Enum Constants

PERFORMANCE

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

PreviewView falls back to TextureView when the API level is 24 or lower, the camera hardware support level is CameraCharacteristics, or Preview.getTargetRotation() is different from PreviewView's display rotation.

Do not use this mode if is set to a value different than the display's rotation, because does not support arbitrary rotations. Do not use this mode if the PreviewView needs to be animated. animation is not supported on API level 24 or lower. Also, for the preview's streaming state provided in PreviewView.getPreviewStreamState(), the PreviewView.StreamState.STREAMING state might happen prematurely if this mode is used.

See also: , Display, CameraCharacteristics, PreviewView.StreamState.STREAMING

COMPATIBLE

Use a TextureView for the preview.

Methods

public static PreviewView.ImplementationMode values()

public static PreviewView.ImplementationMode valueOf(java.lang.String name)