AppDimensAdjustmentFactors

EN A singleton object that provides functions for calculating and resolving adjustment factors and screen qualifiers. Compatible with the traditional Android View System (XML).

PT Objeto singleton que fornece funções para o cálculo e resolução de fatores de ajuste e qualificadores de tela. Compatível com o sistema tradicional de Views XML do Android.

Properties

Link copied to clipboard
const val BASE_DP_FACTOR: Float = 1.0f

EN Base Dp scaling factor. Default is 1.0f (no adjustment). PT Fator base de escala Dp. O valor padrão é 1.0f (sem ajuste).

Link copied to clipboard
const val BASE_INCREMENT: Float = 0.1f

EN Default increment factor (used in calculations WITHOUT Aspect Ratio). PT Fator de incremento padrão (usado no cálculo SEM Aspect Ratio).

Link copied to clipboard
const val BASE_WIDTH_DP: Float = 300.0f

EN Base reference Dp width for adjustment calculation (e.g., 300dp). PT Largura DP de referência base para o cálculo de ajuste (ex: 300dp).

Link copied to clipboard
const val CIRCUMFERENCE_FACTOR: <Error class: unknown class>

EN Factor for circumference calculation (

$2\pi$

). Uses kotlin.math.PI. PT Fator para cálculo de circunferência (

$2\pi$

). Usando kotlin.math.PI.

Link copied to clipboard
const val DEFAULT_SENSITIVITY_K: Float = 0.08f

EN DEFAULT sensitivity coefficient: Adjusts how aggressive the scaling is on extreme screens. PT Coeficiente de sensibilidade PADRÃO: Ajusta o quão agressivo é o escalonamento em telas extremas.

Link copied to clipboard
const val INCREMENT_DP_STEP: Float = 30.0f

EN Dp increment step size for calculating the adjustment (e.g., every 30dp). PT Tamanho do passo de incremento em Dp para calcular o ajuste (ex: a cada 30dp).

Link copied to clipboard
const val REFERENCE_AR: Float = 1.78f

EN Reference aspect ratio (e.g., 16:9), where the adjustment is neutral. PT Proporção de tela de referência (Ex: 16:9), onde o ajuste é neutro.

Functions

Link copied to clipboard

EN Calculates the Basic Adjustment Factors.

Link copied to clipboard
fun getReferenceAspectRatio(screenWidthDp: Float, screenHeightDp: Float): Float

EN Helper function to get the aspect ratio from the configuration.

Link copied to clipboard
fun resolveIntersectionCondition(entry: DpQualifierEntry, smallestWidthDp: Float, currentScreenWidthDp: Float, currentScreenHeightDp: Float): Boolean

EN Helper function that checks if a DpQualifierEntry meets the current screen dimensions. PT Função auxiliar que verifica se um DpQualifierEntry atende às dimensões atuais da tela.

Link copied to clipboard
fun resolveQualifierDp(customDpMap: Map<DpQualifierEntry, Float>, smallestWidthDp: Float, currentScreenWidthDp: Float, currentScreenHeightDp: Float, initialBaseDp: Float): Float

EN Helper function that isolates the logic for searching and selecting the custom Dp value through Qualifiers (SW, H, W).