The second Android 11 Developer Preview is now available, test it out and share your feedback.

PreviewView.ScaleType

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

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


Options for scaling the preview vis-à-vis its container PreviewView.

Summary

Enum values

PreviewView.ScaleType  FILL_CENTER

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and center it inside the view. 

PreviewView.ScaleType  FILL_END

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the bottom right corner of the view. 

PreviewView.ScaleType  FILL_START

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the top left corner of the view. 

PreviewView.ScaleType  FIT_CENTER

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and center it inside the view. 

PreviewView.ScaleType  FIT_END

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the bottom right corner of the view. 

PreviewView.ScaleType  FIT_START

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the top left corner of the view. 

Public methods

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

Inherited methods

Enum values

FILL_CENTER

public static final PreviewView.ScaleType FILL_CENTER

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and center it inside the view. This may cause the preview to be cropped if the camera preview aspect ratio does not match that of its container PreviewView.

FILL_END

public static final PreviewView.ScaleType FILL_END

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the bottom right corner of the view. This may cause the preview to be cropped if the camera preview aspect ratio does not match that of its container PreviewView.

FILL_START

public static final PreviewView.ScaleType FILL_START

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the top left corner of the view. This may cause the preview to be cropped if the camera preview aspect ratio does not match that of its container PreviewView.

FIT_CENTER

public static final PreviewView.ScaleType FIT_CENTER

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and center it inside the view. Both dimensions of the preview will be equal or less than the corresponding dimensions of its container PreviewView.

FIT_END

public static final PreviewView.ScaleType FIT_END

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the bottom right corner of the view. Both dimensions of the preview will be equal or less than the corresponding dimensions of its container PreviewView.

FIT_START

public static final PreviewView.ScaleType FIT_START

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the top left corner of the view. Both dimensions of the preview will be equal or less than the corresponding dimensions of its container PreviewView.

Public methods

valueOf

public static PreviewView.ScaleType valueOf (String name)

Parameters
name String

Returns
PreviewView.ScaleType

values

public static final ScaleType[] values ()

Returns
ScaleType[]