[!NOTE] Product Alignment:
io.github.bodenberg:appdimens-dynamic:3.1.5Primary Module:libraryAssociated Documents: PDR (Design) | Mathematics | API Conventions
AppDimens Dynamic is a mathematical scaling engine designed for Android (com.appdimens.dynamic). Its purpose is to map generic UI dimensions (developed against a 300dp or equivalent reference) to physical hardware parameters—scaling elegantly across phones, tablets, and unpredictable foldables.
It encapsulates 14 discrete mathematical scaling strategies (curves), alongside an autonomous Resize/Constraint subsystem that calculates the maximum bounded element size at runtime via binary search.
Static dp measurements fall apart as device variety increases. A 300dp horizontal card fits perfectly on a classic phone but becomes aggressively small on high-density tablets or wide-screen foldables.
compose.*) and legacy XML/Views (code.*).60FPS and 120FPS rendering algorithms.Configuration, Display aspect ratios, Multi-Window flags, and Context DPI.mindmap
root((AppDimens Dynamic))
Mathematical Engine
Linear & Scaled Defaults
Logarithmic Deterioration
Exponential / Power Curves
Diagonal Vector Paths
Resize Subsystem
Binary Constraint Search
Max Area Fits Predicate
Zero-GC Floating Arrays
Consumer Platforms
Jetpack Compose Wrappers
Android Virtual Views (XML)
Pure Kotlin Math Core
Thread Safe Cache Layer
ScreenFactors Bypass
Multi-Window Detection
Atomic Array Sharding
compose.percent cannot import compose.power.android.content.res.Configuration.*DpExtensions) must explicitly feature symmetric code equivalents for legacy migration.[!TIP] The
Scaleddefault curve remains optimal for generic UI development, specifically supporting aspect-ratio injection (sdpa,sdpi) for anti-distortion tuning.
| Strategy Class | Mathematical Goal | Expected Consumer Use Case |
|---|---|---|
| Scaled (Default) | Linear geometry translation from basic 300dp scale. |
Baseline paddings, Standard containers. |
| Logarithmic | Fast early growth curve with heavy downstream damping. | Text geometries on massive tablets. |
| Fluid | Breakpoint-based linear interpolation ([320..768]). | Responsive Web-like UI adjustments. |
| Percent / Space | Absolute device fractional limits (( % \times sw )). | Fixed grid splits, Nav bars. |
| Interpolated | User-defined N-point vector curves. | Brand-specific interactive scaling. |
FloatArray. No auto-boxing allowed.ResizeBound.resolveToPx using strict require(density > 0) contracts.PERCENT, SCALED), getOrPut reduces to a constant time single-multiply operation.AtomicLongArray / AtomicIntegerArray implementing a deterministic last-write-wins methodology preventing bottlenecking on ARM64.minSdk = 24, Java 17 requirements, enforcing direct Proguard shipping via consumer-rules.pro.diagnosticsEnabled) to eliminate tracing overhead in production applications.< 15ns median time.