~/talk

Why is my app letterboxed?!

Talkat Droidcon London 2023 · 2023-10-26..10-27· [android]
slides:none on file

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

  1. 0:00Introduction to letterboxing
  2. 1:29What causes letterboxing
  3. 3:36Flickering loops explained
  4. 5:49Why compatibility mode exists
  5. 7:55Handling state loss
  6. 10:27Locking orientation selectively
  7. 14:05Window size classes overview
  8. 20:27Implementing the solution
  9. 23:59Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.