Large screens and window size classes

Views, layouts and RecyclerView Mid-level Kotlin 2.0+ API 24+ Reviewed By Best Latest Apps

Pick the fix

An app checks isTablet from screen size to show a two-pane layout, but in split-screen on a tablet the panes are squashed. Fix?

Options
Hint 1 of 1

Is a tablet always a wide window?

Choose an answer, then open Show answer below to check it.

Show answer

Answer: A Use the window size class and show two panes only for expanded width

Correct. The window, not the device, decides the layout.

Why not the others?
  • B Lock the app to full screen. Users choose split-screen; you can't prevent it on large screens.
  • C Use the device's physical size in inches. That still ignores the window size.
  • D Disable split-screen in the manifest. Recent Android versions ignore that on large screens.

30-second answer

Design for the available window, not the device. Window size classes (compact, medium, expanded) from currentWindowAdaptiveInfo() drive layout choices such as a bottom bar on phones and a navigation rail or list-detail on wider windows. Handle resizing without losing state, support both orientations, and don't lock to portrait: Android 16 ignores orientation and resizability restrictions on large screens.

Practise saying it · 35 s. No recording, just a timer

Explain adaptive layouts.

Say your answer out loud, then check which of these points you covered:

  • Design for the window
  • Window size classes
  • Adaptive scaffolds
  • Handle resizing
  • Don't lock orientation

Deep dive

Material 3 adaptive provides NavigationSuiteScaffold and ListDetailPaneScaffold.

Foldables report posture and hinge position through Jetpack WindowManager.

Test with the resizable emulator and in split-screen.

Keyboard, mouse and stylus input matter on large screens.

Common mistakes

  • Branching on 'isTablet' instead of window size.
  • Locking portrait to avoid layout work.
  • Losing state when the window resizes.

Senior take & follow-ups

Say 'window, not device' and name the size classes.

Follow-up questions

Think of your answer first, then open the hint.

  1. Why not detect tablets?

    Show hint

    A tablet in split-screen can be a compact window.

  2. What changed in Android 16?

    Show hint

    On large screens, apps targeting it can't restrict orientation or resizability.

Compare on iOS: GeometryReader vs ViewThatFits and Layout SwiftUI uses size classes the same way.

Suggest a fix if something here is wrong or out of date.