Deep dive into size configuration changes
summary
States Android 14 behavior: screenWidthDp, screenHeightDp and smallestScreenWidthDp represent the window area not the physical screen, and insets and display cutouts change those values at runtime. Pixel 7 Pro example: 1440×3120 at density 560 yields 411.4286dp rounded to 411, causing a one‑pixel round‑trip error. Size-only changes only recreate activities when resource buckets change (API 24+); APIs 30–33 introduce callback inconsistencies fixed in API 34. Recommended tools are WindowMetricsCalculator, window size classes, and using view.onConfigurationChanged (or Compose’s LocalConfiguration.current) with an activity UI context.
AI-written summary · about
chapters (14)
- 0:00Introduction and setup
- 1:30What are configuration changes
- 3:34Static size configuration basics
- 6:05Understanding insets and dimensions
- 9:43Dynamic insets and foldables
- 11:30Orientation and multi-window quirks
- 14:47Rounding and density calculations
- 19:34Solutions for accurate window sizing
- 21:40Dynamic size configuration changes
- 24:34Significant vs insignificant changes
- 26:20Handling configuration callbacks
- 28:28Reliable view-based callbacks
- 30:37API 34 and future behavior
- 31:24Best practices and summary
related talks
30mDeep Dive Into Size Configuration Changes
41mDeep dive into size configuration changes
33mOptimize your app for large screens
28mBuilding Robust Screens That Handle Window Size Changes
24mOptimize your app for large screens
40mOptimize your app for large screens
38mOptimize your app for large screens
26mThe Importance of Measure
