AppDimensDynamic

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

EN Class for building dynamic dimensions that allow base Dp customization via screen qualifiers (.screen()). The final value is scaled by the screen. Compatible with the View System (XML layouts).

PT Classe para construir dimensões dinâmicas que permitem customização do DP base via qualificadores de tela (.screen()). O valor final é escalado pela tela. Compatível com View System (XML layouts).

Constructors

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

Functions

Link copied to clipboard

EN Performs the final dynamic dimension 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): AppDimensDynamic

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

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

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

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

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

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 dynamically adjusted Dp value (in Dp, not converted to PX).

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

EN Returns the dynamically adjusted Dp value (in Dp, not converted to PX) as an Int.

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

EN Builds the dynamically 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 dynamically 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 dynamically adjusted Dp value and converts it to Pixels (Float).

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

EN Builds the dynamically adjusted Dp value and converts it to Pixels (Int). Useful for setters that only accept Int.

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

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

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

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

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

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