WhollySoftware
Back to blogMobile

Designing for Foldables and Multi-Window Android Devices

Wholly Software TeamJuly 1, 20256 min read
Designing for Foldables and Multi-Window Android Devices

A retail client demoed our app on a Samsung Galaxy Fold at a trade show and the layout fell apart mid-fold — a fixed two-pane layout designed for tablets rendered as an unusably cramped single column on the folded inner screen, then jumped awkwardly when unfolded. The app had been built assuming 'screen size' was a fixed property checked once at launch, which foldables and multi-window mode both violate constantly.

We rebuilt the layout logic around Jetpack's WindowSizeClass APIs, which bucket the available space into compact, medium, and expanded width and height classes and, critically, recompute on every configuration change — a fold, unfold, or entering split-screen multi-window mode. Layouts now branch on window size class rather than device type or raw screen size, so the same code correctly adapts whether the size change came from a fold, a user resizing a split-screen window, or an external display connection.

The trickiest part wasn't the layout branching itself but state preservation across the transition. A fold/unfold event triggers an activity recreation by default unless configChanges is handled explicitly, and we found several screens losing scroll position and, in one case, form input, during a fold transition. We used rememberSaveable consistently for UI-relevant state and moved to handling the foldingFeature configuration change without full activity recreation where the screen supported it, using Jetpack WindowManager's FoldingFeature API to react to the fold state directly.

We also added the hinge itself as a layout input, not just a size change. Using FoldingFeature's bounds and orientation, we route no interactive content (buttons, text fields) directly under the hinge for devices with a physical seam, and for book-style unfolded layouts we split content into two panes divided at the hinge rather than an arbitrary midpoint, which reads as intentional rather than accidental to users on those devices.

Testing this properly required actual hardware — the Android Studio foldable emulators are useful for basic layout checks but don't reproduce every hinge behavior accurately, particularly hinge angle sensor events on newer flip-style devices. We now keep a small hardware lab of a Fold, a Flip, and a couple of common tablets for any client project targeting large-screen or foldable support, since emulator-only testing missed real issues on two separate projects before we made that a standard practice.

AndroidFoldablesResponsive DesignJetpack Compose
Designing for Foldables and Multi-Window Android Devices — Wholly Software