Why is my app letterboxed?!
summary
Explains why Android puts apps into letterbox/size-compat mode (fixed orientation lock, fixed aspect ratio, or non-resizable) and how OEMs ignoring requested orientation on large screens causes recreation loops and flickering. Demonstrates a fix: detect compact windows via window size classes and WindowMetricsCalculator, call setRequestedOrientation only for compact, and preserve UI state with Jetpack ViewModel (plus RecyclerView/WebView snippets). Notes onConfigurationChanged handling (or Compose’s localConfiguration) is required for reliable behavior; the approach prevents restarts and flicker.
AI-written summary · about
chapters (9)
- 0:00Introduction to letterboxing
- 1:29What causes letterboxing
- 3:36Flickering loops explained
- 5:49Why compatibility mode exists
- 7:55Handling state loss
- 10:27Locking orientation selectively
- 14:05Window size classes overview
- 20:27Implementing the solution
- 23:59Q&A
related talks
20mDo’s and don’ts: Mindset for optimizing apps for larger screens
20mDo’s and don’ts: Mindset for optimizing apps for larger screens
21mForm Factors #AskAndroid
46mA developer's guide to large screens readiness
40mOptimize your app for large screens
33mOptimize your app for large screens
23mNot Just Rotation: Configuration Changes on Android
21mForm Factors #AskAndroid
