appdimens-dynamic

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

FitSp

class FitSp(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 fthem: 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 fthemPx: 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 fthsp: 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 fthspPx: 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 ftsem: 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 ftsemPx: 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 ftssp: 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 ftsspPx: 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 ftwem: 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 ftwemPx: 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 ftwsp: 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 ftwspPx: 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): FitSp

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

fun ignoreMultiWindows(ignore: Boolean = true): FitSp

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 ftsem / ftwem accessors). PT Como resolve, mas força fontScale = false (Sp fixo, mesmo propósito dos acessores ftsem / ftwem).

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 (toDynamicFitPx). PT Igual a resolve, mas retorna pixels já escalados pela densidade (toDynamicFitPx).

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

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
FitSp  

Properties

Name Summary
applyAspectRatio  
customSensitivityK  
defaultFontScale  
fthem  
fthemPx  
fthsp  
fthspPx  
ftsem  
ftsemPx  
ftssp  
ftsspPx  
ftwem  
ftwemPx  
ftwsp  
ftwspPx  
ignoreMultiWindows  
initialBaseValue  
sortedCustomEntries  

Functions

Name Summary
aspectRatio  
ignoreMultiWindows  
reorderEntries  
resolve  
resolveNoFontScale  
resolveNoFontScalePx  
resolvePx  
screen