Build responsive and adaptive UIs with Compose's experimental mediaQuery API.
The sample demonstrates real-time layout adaptation utilizing the experimental mediaQuery API in Jetpack Compose. Adapts layout elements based on screen size, device fold posture, precision of pointer devices, physical viewing distance, and active hardware sensors.
- Fold posture detection: Adapts layout when a foldable device is folded into
Tabletopposture. - Hardware sensor awareness: Detects available cameras/microphones.
- Peripheral detection: Displays warnings if no physical keyboard is connected.
- Pointer precision adaptive targets: Scales clickable tap targets for coarse touch inputs.
- Adaptive Viewing distance: Automatically enlarges typography for medium/far viewing ranges.
To explore this sample:
- Clone this repository.
- Navigate to the
MediaQuerydirectory. - Open the project in your preferred IDE or build it using the command line.
This project is licensed under the Apache License, Version 2.0.
See the LICENSE file for details.