ScaleType

class ScaleType
kotlin.Any
   ↳ kotlin.Enum<androidx.camera.view.PreviewView.ScaleType>
   ↳ androidx.camera.view.PreviewView.ScaleType

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

Summary

Enum values

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

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the end of the view, which is the bottom right corner in a left-to-right (LTR) layout, or the bottom left corner in a right-to-left (RTL) layout.

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the start of the view, which is the top left corner in a left-to-right (LTR) layout, or the top right corner in a right-to-left (RTL) layout.

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

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the end of the view, which is the bottom right corner in a left-to-right (LTR) layout, or the bottom left corner in a right-to-left (RTL) layout.

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the start of the view, which is the top left corner in a left-to-right (LTR) layout, or the top right corner in a right-to-left (RTL) layout.

Enum values

FILL_CENTER

enum val FILL_CENTER : PreviewView.ScaleType

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and center it in 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

enum val FILL_END : PreviewView.ScaleType

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the end of the view, which is the bottom right corner in a left-to-right (LTR) layout, or the bottom left corner in a right-to-left (RTL) layout.

This may cause the preview to be cropped if the camera preview aspect ratio does not match that of its container PreviewView.

FILL_START

enum val FILL_START : PreviewView.ScaleType

Scale the preview, maintaining the source aspect ratio, so it fills the entire PreviewView, and align it to the start of the view, which is the top left corner in a left-to-right (LTR) layout, or the top right corner in a right-to-left (RTL) layout.

This may cause the preview to be cropped if the camera preview aspect ratio does not match that of its container PreviewView.

FIT_CENTER

enum val FIT_CENTER : PreviewView.ScaleType

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

enum val FIT_END : PreviewView.ScaleType

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the end of the view, which is the bottom right corner in a left-to-right (LTR) layout, or the bottom left corner in a right-to-left (RTL) layout.

Both dimensions of the preview will be equal or less than the corresponding dimensions of its container PreviewView.

FIT_START

enum val FIT_START : PreviewView.ScaleType

Scale the preview, maintaining the source aspect ratio, so it is entirely contained within the PreviewView, and align it to the start of the view, which is the top left corner in a left-to-right (LTR) layout, or the top right corner in a right-to-left (RTL) layout.

Both dimensions of the preview will be equal or less than the corresponding dimensions of its container PreviewView.