You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: "Adaptive layouts using MediaQuery in Jetpack Compose"
2
+
description: "A sample demonstrating how to use the MediaQuery API in Jetpack Compose to build context-aware, adaptive apps that react to hardware features, peripherals, and physical screen posture."
Build responsive and adaptive UIs with Compose's experimental `mediaQuery` API.
4
+
5
+
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.
6
+
7
+
## Features demonstrated
8
+
-**Fold posture detection:** Adapts layout when a foldable device is folded into `Tabletop` posture.
9
+
-**Hardware sensor awareness:** Detects available cameras/microphones.
10
+
-**Peripheral detection:** Displays warnings if no physical keyboard is connected.
11
+
-**Pointer precision adaptive targets:** Scales clickable tap targets for coarse touch inputs.
12
+
-**Adaptive Viewing distance:** Automatically enlarges typography for medium/far viewing ranges.
13
+
14
+
## Get started
15
+
To explore this sample:
16
+
1. Clone this repository.
17
+
2. Navigate to the `MediaQuery` directory.
18
+
3. Open the project in your preferred IDE or build it using the command line.
19
+
20
+
## License
21
+
This project is licensed under the Apache License, Version 2.0.
22
+
23
+
See the [LICENSE](../LICENSE.md) file for details.
0 commit comments