AppDimensFixed

class AppDimensFixed(initialBaseDp: Dp, ignoreMultiViewAdjustment: Boolean = false)

EN A builder class for creating "fixed" dimensions that are automatically adjusted based on the device's smallestScreenWidthDp and screen aspect ratio.

PT Uma classe construtora para criar dimensões "fixas" que são ajustadas automaticamente com base no smallestScreenWidthDp do dispositivo e na proporção da tela.

Constructors

Link copied to clipboard
constructor(initialBaseDp: Dp, ignoreMultiViewAdjustment: Boolean = false)

Properties

Link copied to clipboard
val dp: Dp

EN Builds the adjusted Dp from the calculation.

Link copied to clipboard

EN Builds the adjusted TextUnit (Sp) from the calculation (NO FONT SCALE).

Link copied to clipboard

EN Builds the adjusted Pixel value (Float) from the calculation.

Link copied to clipboard

EN Builds the adjusted TextUnit (Sp) from the calculation.

Functions

Link copied to clipboard
fun aspectRatio(enable: Boolean = true, sensitivityK: Float? = null): AppDimensFixed

EN Enables or disables aspect ratio adjustment and sets a custom sensitivity.

Link copied to clipboard

EN Ignores multi-view adjustment if set to true.

Link copied to clipboard
fun screen(type: UiModeType, customValue: Dp): AppDimensFixed

EN Sets a custom dimension for a specific UI mode.

fun screen(type: UiModeType, customValue: TextUnit): AppDimensFixed

EN Overload for screen that accepts a TextUnit value.

fun screen(type: UiModeType, customValue: Float): AppDimensFixed

EN Overload for screen that accepts a Float value.

fun screen(type: UiModeType, customValue: Int): AppDimensFixed

EN Overload for screen that accepts an Int value.

fun screen(type: DpQualifier, value: Int, customValue: Dp): AppDimensFixed

EN Sets a custom dimension for a specific screen qualifier.

fun screen(type: DpQualifier, value: Int, customValue: TextUnit): AppDimensFixed

EN Overload for screen that accepts a TextUnit value for a DpQualifier.

fun screen(type: DpQualifier, value: Int, customValue: Float): AppDimensFixed

EN Overload for screen that accepts a Float value for a DpQualifier.

fun screen(type: DpQualifier, value: Int, customValue: Int): AppDimensFixed

EN Overload for screen that accepts an Int value for a DpQualifier.

fun screen(uiModeType: UiModeType, qualifierType: DpQualifier, qualifierValue: Int, customValue: Dp): AppDimensFixed

EN Sets a custom dimension for a specific intersection of UI mode and screen qualifier.

fun screen(uiModeType: UiModeType, qualifierType: DpQualifier, qualifierValue: Int, customValue: TextUnit): AppDimensFixed

EN Overload for screen intersection that accepts a TextUnit value.

fun screen(uiModeType: UiModeType, qualifierType: DpQualifier, qualifierValue: Int, customValue: Float): AppDimensFixed

EN Overload for screen intersection that accepts a Float value.

fun screen(uiModeType: UiModeType, qualifierType: DpQualifier, qualifierValue: Int, customValue: Int): AppDimensFixed

EN Overload for screen intersection that accepts an Int value.

Link copied to clipboard
fun type(type: ScreenType): AppDimensFixed

EN Sets the screen dimension type to be used as a reference (HIGHEST or LOWEST).