appdimens-dynamic

//AppDimens SDP, HDP, WDP: Scalable Width and Height Dimensions/com.appdimens.dynamic.code.logarithmic/LogarithmicSp

LogarithmicSp

class LogarithmicSp(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 class that allows defining custom Sp text dimensions based on screen qualifiers (UiModeType, Width, Height, Smallest Width).

The value is resolved using a Context and uses the base value or a custom value, applying dynamic scaling.

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

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

private val ignoreMultiWindows: Boolean

private val initialBaseValue: Number

private val sortedCustomEntries: List<CustomSpEntry>

@JvmOverloadsfun aspectRatio(enable: Boolean = true, sensitivityK: Float? = null): LogarithmicSp

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

@JvmOverloadsfun ignoreMultiWindows(ignore: Boolean = true): LogarithmicSp

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).

fun loghem(context: Context): Float

fun loghsp(context: Context): Float

fun logsem(context: Context): Float

EN Resolve final value in pixels (WITHOUT font scale).

fun logsemLoghemLogwemPx(context: Context): Triple<Float, Float, Float>

EN Resolves logsem, loghem, and logwem in one pass (fixed Sp / no font-scale path). PT Resolve logsem, loghem e logwem numa só passagem (Sp fixo / sem escala de fonte).

fun logssp(context: Context): Float

EN Resolve final value in pixels (WITH font scale).

fun logsspLoghspLogwspPx(context: Context): Triple<Float, Float, Float>

EN Resolves logssp, loghsp, and logwsp in one pass (single UiModeType.fromConfiguration read). PT Resolve logssp, loghsp e logwsp numa só passagem.

fun logwem(context: Context): Float

fun logwsp(context: Context): Float

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 resolvePx(context: Context, qualifier: DpQualifier, fontScaleOverride: Boolean? = null): Float

EN Resolves qualifier to px using the first matching CustomSpEntry, optionally overriding font scale. PT Resolve qualifier em px usando a primeira CustomSpEntry correspondente, com override opcional da escala de fonte.

private fun resolvePxInternal(context: Context, qualifier: DpQualifier, configuration: Configuration, currentUiModeType: UiModeType, fontScaleOverride: Boolean?): Float

EN Shared implementation for resolvePx, logsspLoghspLogwspPx, and logsemLoghemLogwemPx. PT Implementação compartilhada para resolvePx, logsspLoghspLogwspPx e logsemLoghemLogwemPx.

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

EN Priority 4: orientation only. PT Prioridade 4: apenas orientação.

EN Priority 2: UiModeType only (e.g. TELEVISION, WATCH). PT Prioridade 2: apenas UiModeType (ex.: TELEVISION, WATCH).

EN Priority 3: Dp qualifier (sw, h, w) without UiModeType restriction. PT Prioridade 3: qualificador 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 Dp (sw, h, w).

Constructors

Name Summary
LogarithmicSp  

Properties

Name Summary
applyAspectRatio  
customSensitivityK  
defaultFontScale  
ignoreMultiWindows  
initialBaseValue  
sortedCustomEntries  

Functions

Name Summary
aspectRatio  
ignoreMultiWindows  
loghem  
loghsp  
logsem  
logsemLoghemLogwemPx  
logssp  
logsspLoghspLogwspPx  
logwem  
logwsp  
reorderEntries  
resolvePx  
resolvePxInternal  
screen