DeviceParametersBuilders.DeviceParameters.Builder

public final class DeviceParametersBuilders.DeviceParameters.Builder


Builder for DeviceParameters

Summary

Public constructors

Public methods

@NonNull DeviceParametersBuilders.DeviceParameters

Builds an instance from accumulated values.

@NonNull DeviceParametersBuilders.DeviceParameters.Builder

Sets the platform of the device.

@NonNull DeviceParametersBuilders.DeviceParameters.Builder
setScreenDensity(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) @NonNull float screenDensity
)

Sets density of the display.

@NonNull DeviceParametersBuilders.DeviceParameters.Builder
setScreenHeightDp(@Dimension(unit = "") @NonNull int screenHeightDp)

Sets height of the device's screen in DP.

@NonNull DeviceParametersBuilders.DeviceParameters.Builder

Sets the shape of the device's screen.

@NonNull DeviceParametersBuilders.DeviceParameters.Builder
setScreenWidthDp(@Dimension(unit = "") @NonNull int screenWidthDp)

Sets width of the device's screen in DP.

Public constructors

Builder

public Builder()

Public methods

build

@NonNull
public DeviceParametersBuilders.DeviceParameters build()

Builds an instance from accumulated values.

setDevicePlatform

@NonNull
public DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(
    @DeviceParametersBuilders.DevicePlatform @NonNull int devicePlatform
)

Sets the platform of the device.

setScreenDensity

@NonNull
public DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) @NonNull float screenDensity
)

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

setScreenHeightDp

@NonNull
public DeviceParametersBuilders.DeviceParameters.Builder setScreenHeightDp(@Dimension(unit = "") @NonNull int screenHeightDp)

Sets height of the device's screen in DP.

setScreenShape

@NonNull
public DeviceParametersBuilders.DeviceParameters.Builder setScreenShape(
    @DeviceParametersBuilders.ScreenShape @NonNull int screenShape
)

Sets the shape of the device's screen.

setScreenWidthDp

@NonNull
public DeviceParametersBuilders.DeviceParameters.Builder setScreenWidthDp(@Dimension(unit = "") @NonNull int screenWidthDp)

Sets width of the device's screen in DP.