public final class

DeviceParametersBuilders.DeviceParameters

extends java.lang.Object

 java.lang.Object

↳androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters

Overview

Parameters describing the device requesting a layout update. This contains physical and logical characteristics about the device (e.g. screen size and density, etc).

Summary

Methods
public static DeviceParametersBuilders.DeviceParametersfromProto(DeviceParametersProto.DeviceParameters proto)

Creates a new wrapper instance from the proto.

public DeviceParametersBuilders.CapabilitiesgetCapabilities()

Gets renderer supported DeviceParametersBuilders.Capabilities.

public intgetDevicePlatform()

Gets the platform of the device.

public floatgetFontScale()

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

public VersionBuilders.VersionInfogetRendererSchemaVersion()

Gets the maximum schema version supported by the current renderer.

public floatgetScreenDensity()

Gets density of the display.

public intgetScreenHeightDp()

Gets height of the device's screen in DP.

public intgetScreenShape()

Gets the shape of the device's screen.

public intgetScreenWidthDp()

Gets width of the device's screen in DP.

public DeviceParametersProto.DeviceParameterstoProto()

Returns the internal proto instance.

public java.lang.StringtoString()

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

Methods

public int getScreenWidthDp()

Gets width of the device's screen in DP.

public int getScreenHeightDp()

Gets height of the device's screen in DP.

public float getScreenDensity()

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

public float getFontScale()

Gets 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 int getDevicePlatform()

Gets the platform of the device.

public int getScreenShape()

Gets the shape of the device's screen.

public VersionBuilders.VersionInfo getRendererSchemaVersion()

Gets 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.

public DeviceParametersBuilders.Capabilities getCapabilities()

Gets renderer supported DeviceParametersBuilders.Capabilities.

Creates a new wrapper instance from the proto.

Returns the internal proto instance.

public java.lang.String toString()