public final class

ViewfinderSurfaceRequest.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder

Overview

Builder for ViewfinderSurfaceRequest.

Summary

Constructors
publicBuilder(Size resolution)

Constructor for ViewfinderSurfaceRequest.Builder.

Methods
public ViewfinderSurfaceRequestbuild()

Builds the ViewfinderSurfaceRequest.

public ViewfinderSurfaceRequest.BuildersetImplementationMode(CameraViewfinder.ImplementationMode implementationMode)

Sets the CameraViewfinder.ImplementationMode.

public ViewfinderSurfaceRequest.BuildersetLensFacing(int lensFacing)

Sets the lens facing.

public ViewfinderSurfaceRequest.BuildersetSensorOrientation(int sensorOrientation)

Sets the sensor orientation.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Size resolution)

Constructor for ViewfinderSurfaceRequest.Builder.

Creates a builder with viewfinder resolution.

Parameters:

resolution: viewfinder resolution.

Methods

public ViewfinderSurfaceRequest.Builder setImplementationMode(CameraViewfinder.ImplementationMode implementationMode)

Sets the CameraViewfinder.ImplementationMode.

Possible values:

If not set or setting to null, the CameraViewfinder.ImplementationMode set via app :implementationMode in layout xml will be used for CameraViewfinder. If not set in the layout xml, the default value CameraViewfinder.ImplementationMode.PERFORMANCE will be used in CameraViewfinder.

Parameters:

implementationMode: The CameraViewfinder.ImplementationMode.

Returns:

This builder.

public ViewfinderSurfaceRequest.Builder setLensFacing(int lensFacing)

Sets the lens facing.

Possible values:

The value can be retrieved from CameraCharacteristics by key CameraCharacteristics. If not set, will be used by default.

Parameters:

lensFacing: The lens facing.

Returns:

This builder.

public ViewfinderSurfaceRequest.Builder setSensorOrientation(int sensorOrientation)

Sets the sensor orientation.

Range of valid values:
0, 90, 180, 270

The value can be retrieved from CameraCharacteristics by key CameraCharacteristics. If it is not set, 0 will be used by default.

Parameters:

sensorOrientation: The camera sensor orientation.

Returns:

this builder.

Builds the ViewfinderSurfaceRequest.

Returns:

the instance of ViewfinderSurfaceRequest.