Library: io.github.bodenberg:appdimens-dynamic:3.1.5
DOC_REF (maintainers): bump every
3.1.5URL in this skill and inlibrary-map.md/reference.mdtogether with the coordinate above on future releases.
Authoritative GitHub docs (ref 3.1.5):
AppDimensProvider, DimenCache.invalidateOnConfigChangecode paritycompose.resize / code.resizePackage map and strategy → doc index: library-map.md
library/src/main/java/com/appdimens/dynamic/ on GitHub at 3.1.5, or use IDE “Download Sources” / “Navigate to Declaration” on the Maven artifact. For API detail, see DOCUMENTATION/index.md and per-package pages under DOCUMENTATION/KDOC/. Do not rely on memory.Hard rule: never surface ignoreMultiWindows, *i, or *ia suffixes to users.
Ask questions one at a time. Wait for the answer before moving to the next step. Skip any already answered in the conversation.
Which surface is in scope?
| Choice | Package family | Key note |
|---|---|---|
| Jetpack Compose | com.appdimens.dynamic.compose.* |
16.sdp, scaledDp { }; needs AppDimensProvider for facilitators |
| Kotlin (Views) | com.appdimens.dynamic.code.* |
DimenSdp.sdp(context, 16); outputs px for layout |
| Java (Views) | same code.* entry points |
see ExampleActivity.java |
Record: drives imports, AppDimensProvider need, and whether resize runs in compose.resize or code.resize.
→ Wait for answer, then ask 0.2.
DpQualifier)Which axis should DpQualifier-aware APIs use? (Affects .sdpQualifier, .sdpScreen, scaled .sspRotate vs strategy-prefixed Sp rotates such as .asspRotate, and their code mirrors.)
SMALL_WIDTH (default) — smallest-width (swDP) baseline; correct for most phone/tablet layouts.WIDTH / HEIGHT (or per-call-site mix) — when design requires width-dp or height-dp branching. Read COMPOSE-API-CONVENTIONS.md and DpQualifier KDoc before proposing thresholds.Record before suggesting any .screen, .qualifier, rotate, or power-curve APIs.
→ Wait for answer, then ask 0.3.
Disambiguate first — these are separate workflows:
sdp, percent, fluid, …) → Phase 1.autoResize*, ResizeBound) → Phase 3.Ask which applies:
If automatic strategy mode: confirm each major screen or module after proposing, before bulk edits.
→ Wait for answer, then ask 0.4.
Full migration (app-wide) or partial? For partial scope, list concrete paths or identifiers (files, packages, screens, composables, XML layouts, specific dimensions) before editing.
→ Wait for answer, then ask 0.5.
For each major screen or module, ask for plain-language criteria (e.g., “no clipped titles on foldable inner display”, “comfortable padding on 10-inch tablet”). Tie every recommendation explicitly to these.
→ Once answered, proceed to the relevant phase(s).
Run only when Phase 0.3 includes strategy selection. Skip for resize-only tasks with unchanged surrounding curves.
compose.scaled / code.scaled — recommend this first. Linear scaling around a 300 dp reference on the chosen axis.
| Variant | Typical use |
|---|---|
.sdp |
General spacing, padding, corner radii |
.hdp |
Vertical rhythm, row heights |
.wdp |
Width-driven columns |
.ssp |
Text; use hsp/wsp for axis variants |
.sdpa / .hdpa |
Very wide or tall screens where plain scaled is too aggressive or too conservative |
In manual mode: present this default and ask which UI areas use it. Accept “everything scaled except …” rules.
In automatic mode: propose per screen, confirm before bulk edits.
Use only when requirements or QA justify leaving scaled. Before recommending any strategy below, read its matching doc in DOCUMENTATION/ — see library-map.md § “Strategy → doc”. Pull trade-offs from that doc, not from memory.
| Strategy | Role | Typically when | Not ideal when |
|---|---|---|---|
| Percent | Literal fraction of a screen axis | Sizes must track sw/w/h directly (hero = 90% w) | Only need “design at 300 dp” feel — use scaled |
| Power | Sublinear growth, softer on large screens | Large phones/tablets feel “too big” with linear | Need predictable linear mapping everywhere |
| Fluid | Band behavior between reference widths | Strong control inside a width band | One simple curve app-wide without band tuning |
| Auto | Breakpoint-style blend (linear + log past threshold) | Clear “phone vs tablet” knee in the curve | Need mathematically smooth everywhere |
| Diagonal | Curve on a diagonal screen metric | Ultrawide / non-standard aspect emphasis | Simple portrait phone layouts |
| Fill | Cover-like growth vs reference (“bold”) | Visual dominance on large canvas | Risk oversized touch targets without QA |
| Fit | Contain-like growth vs reference (conservative) | Prefer smaller on large screens | Need aggressive use of space on tablets |
| Interpolated | Piecewise curve between configured points | Hand-tuned points from design spec | No intermediate data — high maintenance |
| Logarithmic | Log-shaped curve, dampens growth | Strong dampening needed | Need linear proportional feel |
| Perimeter | Perimeter-style metric in formula | Designs keyed to “frame” perception | No such requirement |
| Density | Classic density-style scaling | Matching legacy dp-to-physical expectations | Want screen-shape-aware curves |
| Physical units | mm / cm / in helpers | Real-world sizing (rulers, print-like UI) | Most Material layout — use scaled instead |
| Resize | (not a global curve) Largest discrete step in [min,max] fitting constraints | Auto-fit text or boxes inside known max | Whole-screen proportional layout |
Apply regardless of strategy or UI stack:
compose.<strategy> and code.<strategy> do not cross-import. One strategy per calculation path.AppDimensProvider — required for Compose facilitators like .sdpMode, .sdpScreen, .sspScreen (see README).configChanges in manifest), consider DimenCache.invalidateOnConfigChange.code hot paths — prefer Int/Float receivers for sdp/hdp/wdp to avoid boxing.Dp/TextUnit alternates in *Plain chains to avoid double-scaling (README + COMPOSE-API-CONVENTIONS).Run when the user touches autoResize* APIs, ResizeBound, ResizeRangePx, or DimenResize.
Ask in order, waiting for each answer before continuing:
BoxWithConstraints (max width/height in dp). Views/code: how is max px/dp obtained?ResizeBound.FixedDp / FixedSp / Percent (sw/w/h axis). For percent-in-container resize, clarify AutoResizePercentBasis (min/max side, width, height) and use autoResizeTextSpPercent (Compose) or fittingTextSpPercentPx (code). Remind: resolveToPx requires density > 0; invalid inputs are clamped (library KDoc).Reference: DOCUMENTATION/resize.md
DpQualifier baseline, task type (strategy / resize / both), scope, acceptance criteria.DOCUMENTATION/*.md opened and trade-offs cited.ignoreMultiWindows / *i / *ia not surfaced to user.For every decision state: chosen strategy, package family (compose.* or code.*), axis (sdp vs hdp vs wdp), whether resize vs global scaling, and which acceptance criterion it satisfies. Prefer small, reviewable diffs aligned with existing project patterns.