toDynamicFluidDp
August 9, 2026 · View on GitHub
//AppDimens SDP, HDP, WDP: Scalable Width and Height Dimensions/com.appdimens.dynamic.compose.fluid/toDynamicFluidDp
toDynamicFluidDp
fun Number.toDynamicFluidDp(qualifier: DpQualifier, inverter: Inverter = Inverter.DEFAULT, ignoreMultiWindows: Boolean = false, applyAspectRatio: Boolean = false, customSensitivityK: Float? = null): ERROR CLASS: Symbol not found for Dp
EN Converts a Number (base Dp value) into a dynamically scaled Dp for use in Jetpack Compose.
The scaling logic:
Checks DimenCache first. On a cache hit, returns the precomputed value; otherwise, computes via calculateFluidDpCompose and stores it.
Uses DimenCache. Fluid is not on the always-bypass list — see library/PERFORMANCE.md.
The remember block ensures recalculation only when configuration changes.
⚠️ Cache note: FLUID uses the snapshot cache (not shouldBypassCache). See library/PERFORMANCE.md.
PT Converte um Number (valor Dp base) em um Dp dinamicamente escalado para uso no Jetpack Compose.
A lógica de escalonamento:
Consulta o DimenCache primeiro. No acerto, retorna o Float cacheado; no miss, calcula via calculateFluidDpCompose e armazena.
O bloco remember garante que o valor só seja recalculado quando um parâmetro de configuração realmente muda.
Dynamically scaled Dp value.
Screen dimension qualifier: DpQualifier.SMALL_WIDTH, DpQualifier.HEIGHT, or DpQualifier.WIDTH.
Orientation-based dimension swap rule (default: Inverter.DEFAULT).
If true, returns the base value unscaled when the app is in split-screen.
If true, applies aspect-ratio multiplier for more aggressive scaling.
Override for the AR sensitivity constant (null = library default).