toDynamicPercentSp
April 11, 2026 ยท View on GitHub
//AppDimens SDP, HDP, WDP: Scalable Width and Height Dimensions/com.appdimens.dynamic.code.percent/toDynamicPercentSp
toDynamicPercentSp
@JvmOverloadsfun Number.toDynamicPercentSp(context: Context, qualifier: DpQualifier, fontScale: Boolean = true, inverter: Inverter = Inverter.DEFAULT, ignoreMultiWindows: Boolean = false, applyAspectRatio: Boolean = false, customSensitivityK: Float? = null): Float
EN Converts an Int (base Sp) to a dynamically scaled Sp value (as Float).
The scaled Sp value as Float.
Bulk / init: see toDynamicPercentSpPx for DimenCache.getBatch and DimenPercentSp.warmupCache.
The Android context to access configuration and density.
The screen qualifier used for scaling (sw, h, w).
Whether to respect the system font scale.
The inverter logic to apply.
Whether to ignore multi-window mode.
If true, applies the aspect-ratio multiplier.
Override for the AR sensitivity constant (null = library default).