Skip to content

Latest commit

 

History

History

README.md

MediaQuery sample

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.

Features demonstrated

  • Fold posture detection: Adapts layout when a foldable device is folded into Tabletop posture.
  • 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.

Get started

To explore this sample:

  1. Clone this repository.
  2. Navigate to the MediaQuery directory.
  3. Open the project in your preferred IDE or build it using the command line.

License

This project is licensed under the Apache License, Version 2.0.

See the LICENSE file for details.