public final class

DeviceParametersBuilders.DeviceParameters.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder

Overview

Builder for DeviceParametersBuilders.DeviceParameters

Summary

Constructors
publicBuilder()

Creates an instance of DeviceParametersBuilders.DeviceParameters.Builder.

Methods
public DeviceParametersBuilders.DeviceParametersbuild()

Builds an instance from accumulated values.

public DeviceParametersBuilders.DeviceParameters.BuildersetCapabilities(DeviceParametersBuilders.Capabilities capabilities)

Sets renderer supported DeviceParametersBuilders.Capabilities.

public DeviceParametersBuilders.DeviceParameters.BuildersetDevicePlatform(int devicePlatform)

Sets the platform of the device.

public DeviceParametersBuilders.DeviceParameters.BuildersetFontScale(float fontScale)

Sets current user preference for the scaling factor for fonts displayed on the display.

public DeviceParametersBuilders.DeviceParameters.BuildersetRendererSchemaVersion(VersionBuilders.VersionInfo rendererSchemaVersion)

Sets the maximum schema version supported by the current renderer.

public DeviceParametersBuilders.DeviceParameters.BuildersetScreenDensity(float screenDensity)

Sets density of the display.

public DeviceParametersBuilders.DeviceParameters.BuildersetScreenHeightDp(int screenHeightDp)

Sets height of the device's screen in DP.

public DeviceParametersBuilders.DeviceParameters.BuildersetScreenShape(int screenShape)

Sets the shape of the device's screen.

public DeviceParametersBuilders.DeviceParameters.BuildersetScreenWidthDp(int screenWidthDp)

Sets width of the device's screen in DP.

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

Constructors

public Builder()

Creates an instance of DeviceParametersBuilders.DeviceParameters.Builder.

Methods

public DeviceParametersBuilders.DeviceParameters.Builder setScreenWidthDp(int screenWidthDp)

Sets width of the device's screen in DP.

public DeviceParametersBuilders.DeviceParameters.Builder setScreenHeightDp(int screenHeightDp)

Sets height of the device's screen in DP.

public DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(float screenDensity)

Sets density of the display. This value is the scaling factor to get from DP to Pixels (px = dp * density).

public DeviceParametersBuilders.DeviceParameters.Builder setFontScale(float fontScale)

Sets current user preference for the scaling factor for fonts displayed on the display. This value is used to get from SP to DP (dp = sp * font_scale).

public DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int devicePlatform)

Sets the platform of the device.

public DeviceParametersBuilders.DeviceParameters.Builder setScreenShape(int screenShape)

Sets the shape of the device's screen.

public DeviceParametersBuilders.DeviceParameters.Builder setRendererSchemaVersion(VersionBuilders.VersionInfo rendererSchemaVersion)

Sets the maximum schema version supported by the current renderer. When building a layout that uses features not available on schema version 1.0 , this can be used to conditionally choose which feature to use.

Sets renderer supported DeviceParametersBuilders.Capabilities.

Builds an instance from accumulated values.