Flex mode

Figure : Google duo in flex mode

When your phone is partially folded, it will go into Flex Mode. Apps will reorient to fit the screen, letting you send messages or watch videos without holding the phone. For example, you can set the phone somewhere flat, like on a table, and use the bottom half of the screen to navigate. Unfold the phone to use the apps in a full screen mode, and partially fold it again to return to Flex Mode.

For making it easier to bring Flex mode to more third-party service, Samsung and Google worked closely together to redesign the app from the operating system level. Integrating Flex mode to Android Support Library was one of the examples, supporting apps and users to take full advantage of differentiating experience on foldable devices.

New Jetpack WindowManager Library in Android

In version 1.0.0, the library provides information about two physical properties of foldable devices — display features and device state.

Display features

Each display feature area can be characterized by its bounding rectangle in the window coordinate space and its type.

public class DisplayFeature {
    private Rect mRect;
    private @Type int mType;
    ...
}

Below is the bounding rectangle value of the folded position on Samsung foldables.

Galaxy Z Flip Galaxy Z Fold2
Portrait Rect (0, 1318 - 1080, 1318)

Rect (884, 0 - 884, 2208)

Landscape Rect (1227, 0 - 1227, 1080)

Rect (0, 884 - 2120, 884)

Until now, Samsung foldables are in the form of TYPE_FOLD.

Device states

The figure below shows each state of foldables. For Flex mode, the app should be redesigned proper layout when POSTURE_HALF_OPENED state.

How do I use it?

Find out more on: Support New Form Factors with the new Jetpack WindowManager Library