AppDimensAdjustmentFactors

EN Singleton object that provides functions for calculating and resolving adjustment factors and screen qualifiers.

PT Objeto singleton que fornece funções para o cálculo e resolução de fatores de ajuste e qualificadores de tela.

Properties

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

EN Base Dp scaling factor. The default value is 1.0f (no adjustment).

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

EN Default increment factor (used in calculation WITHOUT Aspect Ratio).

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

EN Base reference width DP for adjustment calculation (e.g., 300dp).

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

EN Factor for circumference calculation (2π). Using 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.

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

EN Increment step size in Dp to calculate the adjustment (e.g., every 30dp).

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

EN Reference screen aspect ratio (e.g., 16:9), where the adjustment is neutral.

Functions

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

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

Link copied to clipboard
fun rememberAdjustmentFactors(): ScreenAdjustmentFactors

EN Composable function that calculates and remembers Basic Adjustment Factors.

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.

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

EN Helper function that isolates the logic for fetching and selecting the custom Dp value through Qualifiers (SW, H, W). This logic should be called inside a 'remember' block for performance.