AppDimensFixed

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

EN Class for building "fixed" dimensions that are automatically adjusted based on the device's smallestScreenWidthDp and screen aspect ratio. Compatible with the View System (XML).

PT Classe para construir dimensões "fixas" que são ajustadas automaticamente com base no menor smallestScreenWidthDp do dispositivo e na proporção da tela. Compatível com View System (XML).

Constructors

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

Functions

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

EN Enables or disables the aspect ratio adjustment.

Link copied to clipboard

EN Performs the final dimension adjustment calculation.

Link copied to clipboard

EN Ignores adjustments when the app is in multi-window mode.

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

EN Sets a custom dimension value for a specific UI mode.

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

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

EN Sets a custom dimension value for a specific screen qualifier.

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

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

Link copied to clipboard
fun toDp(resources: Resources): Float

EN Returns the adjusted Dp value (in Dp, not converted to PX).

Link copied to clipboard
fun toEm(resources: Resources): Float

EN Builds the adjusted Dp value and converts it to Scalable Pixels (SP) in Pixels (Float), ignoring the system's font scale ('em' unit).

Link copied to clipboard
fun toEmInt(resources: Resources): Int

EN Builds the adjusted Dp value and converts it to Scalable Pixels (SP) in Pixels (Int), ignoring the system's font scale ('em' unit).

Link copied to clipboard
fun toPx(resources: Resources): Float

EN Builds the adjusted Dp value and converts it to Pixels (Float).

Link copied to clipboard
fun toSp(resources: Resources): Float

EN Builds the adjusted Dp value and converts it to Scalable Pixels (SP) in Pixels (Float).

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

EN Sets the screen dimension type (LOWEST or HIGHEST) to be used as the base for adjustments.