appdimens-dynamic

//AppDimens SDP, HDP, WDP: Scalable Width and Height Dimensions/com.appdimens.dynamic.compose.fluid/FluidSp

FluidSp

class FluidSp(val initialBaseValue: Number, val defaultFontScale: Boolean = true, val sortedCustomEntries: List<CustomSpEntry> = emptyList(), val ignoreMultiWindows: Boolean = false, val applyAspectRatio: Boolean = false, val customSensitivityK: Float? = null)

EN A Stable Compose class that allows defining custom Sp text dimensions based on screen qualifiers (UiModeType, Width, Height, Smallest Width).

The TextUnit is resolved at composition and uses the base value or a custom value, applying dynamic scaling via the existing XML DP resources.

PT Classe Stable do Compose que permite definir dimensões de texto Sp customizadas baseadas em qualificadores de tela (UiModeType, Largura, Altura, Smallest Width).

O TextUnit é resolvido na composição e usa o valor base ou um valor customizado, aplicando o escalonamento dinâmico via os recursos XML de DP existentes.

private constructor(initialBaseValue: Number, defaultFontScale: Boolean = true, sortedCustomEntries: List<CustomSpEntry> = emptyList(), ignoreMultiWindows: Boolean = false, applyAspectRatio: Boolean = false, customSensitivityK: Float? = null)

private val applyAspectRatio: Boolean

private val customSensitivityK: Float?

private val defaultFontScale: Boolean

val fhem: ERROR CLASS: Symbol not found for TextUnit

EN The final TextUnit (Sp) value resolved using Screen Height (WITHOUT FONT SCALE). PT O valor final TextUnit (Sp) resolvido usando Altura da Tela (SEM ESCALA DE FONTE).

val fhemPx: Float

EN The final Pixel (Float) value resolved using Screen Height (WITHOUT FONT SCALE). PT O valor final em Pixels (Float) resolvido usando Altura da Tela (SEM ESCALA DE FONTE).

val fhsp: ERROR CLASS: Symbol not found for TextUnit

EN The final TextUnit (Sp) value resolved using Screen Height (WITH font scale). PT O valor final TextUnit (Sp) resolvido usando Altura da Tela (COM escala de fonte).

val fhspPx: Float

EN The final Pixel (Float) value resolved using Screen Height (WITH font scale). PT O valor final em Pixels (Float) resolvido usando Altura da Tela (COM escala de fonte).

val fsem: ERROR CLASS: Symbol not found for TextUnit

EN The final TextUnit (Sp) value resolved using Smallest Width (WITHOUT FONT SCALE). PT O valor final TextUnit (Sp) resolvido usando Smallest Width (SEM ESCALA DE FONTE).

val fsemPx: Float

EN The final Pixel (Float) value resolved using Smallest Width (WITHOUT FONT SCALE). PT O valor final em Pixels (Float) resolvido usando Smallest Width (SEM ESCALA DE FONTE).

val fssp: ERROR CLASS: Symbol not found for TextUnit

EN The final TextUnit (Sp) value resolved using Smallest Width (WITH font scale). PT O valor final TextUnit (Sp) resolvido usando Smallest Width (COM escala de fonte).

val fsspPx: Float

EN The final Pixel (Float) value resolved using Smallest Width (WITH font scale). PT O valor final em Pixels (Float) resolvido usando Smallest Width (COM escala de fonte).

val fwem: ERROR CLASS: Symbol not found for TextUnit

EN The final TextUnit (Sp) value resolved using Screen Width (WITHOUT FONT SCALE). PT O valor final TextUnit (Sp) resolvido usando Largura da Tela (SEM ESCALA DE FONTE).

val fwemPx: Float

EN The final Pixel (Float) value resolved using Screen Width (WITHOUT FONT SCALE). PT O valor final em Pixels (Float) resolvido usando Largura da Tela (SEM ESCALA DE FONTE).

val fwsp: ERROR CLASS: Symbol not found for TextUnit

EN The final TextUnit (Sp) value resolved using Screen Width (WITH font scale). PT O valor final TextUnit (Sp) resolvido usando Largura da Tela (COM escala de fonte).

val fwspPx: Float

EN The final Pixel (Float) value resolved using Screen Width (WITH font scale). PT O valor final em Pixels (Float) resolvido usando Largura da Tela (COM escala de fonte).

private val ignoreMultiWindows: Boolean

private val initialBaseValue: Number

private val sortedCustomEntries: List<CustomSpEntry>

fun aspectRatio(enable: Boolean = true, sensitivityK: Float? = null): FluidSp

EN Allow applying aspect ratio based constraint scaling. PT Permite aplicar o redimensionamento baseado na proporção da tela.

fun ignoreMultiWindows(ignore: Boolean = true): FluidSp

EN Allow ignoring the constraint scaling based on multi-window resizing properties. PT Permite ignorar o dimensionamento para os layouts de múltiplas janelas (divisão de tela).

private fun reorderEntries(newEntry: CustomSpEntry): List<CustomSpEntry>

EN Adds a new entry and re-sorts the list by priority, then by qualifier value (descending).

private fun resolve(qualifier: DpQualifier): ERROR CLASS: Symbol not found for TextUnit

EN Resolves the matching CustomSpEntry and returns scaled TextUnit (Sp) for qualifier. PT Resolve a CustomSpEntry correspondente e retorna TextUnit (Sp) escalonado para qualifier.

private fun resolveNoFontScale(qualifier: DpQualifier): ERROR CLASS: Symbol not found for TextUnit

EN Like resolve but forces fontScale = false (fixed Sp, same idea as fsem / fwem accessors). PT Como resolve, mas força fontScale = false (Sp fixo, mesmo propósito dos acessores fsem / fwem).

private fun resolveNoFontScalePx(qualifier: DpQualifier): Float

EN Like resolvePx with fontScale = false. PT Como resolvePx com fontScale = false.

private fun resolvePx(qualifier: DpQualifier): Float

EN Same as resolve but returns density-scaled pixels (toDynamicFluidPx). PT Igual a resolve, mas retorna pixels já escalados pela densidade (toDynamicFluidPx).

fun screen(orientation: Orientation = Orientation.DEFAULT, customValue: Number, finalQualifierResolver: DpQualifier? = null, inverter: Inverter = Inverter.DEFAULT, fontScale: Boolean = defaultFontScale): FluidSp

EN Priority 4: Orientation only. PT Prioridade 4: Apenas Orientação.

EN Priority 2: UiModeType qualifier (e.g., TELEVISION, WATCH). PT Prioridade 2: Qualificador de UiModeType (e.g., TELEVISION, WATCH).

EN Priority 3: Dp qualifier (sw, h, w) without UiModeType restriction. PT Prioridade 3: Qualificador de Dp (sw, h, w) sem restrição de UiModeType.

EN Priority 1: Most specific qualifier - Combines UiModeType AND Dp Qualifier (sw, h, w). PT Prioridade 1: Qualificador mais específico - Combina UiModeType E Qualificador de Dp (sw, h, w).

Constructors

Name Summary
FluidSp  

Properties

Name Summary
applyAspectRatio  
customSensitivityK  
defaultFontScale  
fhem  
fhemPx  
fhsp  
fhspPx  
fsem  
fsemPx  
fssp  
fsspPx  
fwem  
fwemPx  
fwsp  
fwspPx  
ignoreMultiWindows  
initialBaseValue  
sortedCustomEntries  

Functions

Name Summary
aspectRatio  
ignoreMultiWindows  
reorderEntries  
resolve  
resolveNoFontScale  
resolveNoFontScalePx  
resolvePx  
screen