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
> **Note:** AR=1.78 (16:9) is the reference, so AR adjustment is neutral (0%). Elongated screens (AR>1.78) get slight size increases (+0.5% to +1.1%), while wider screens (AR<1.78) get slight decreases.
**Scenario:** App in split-screen mode creates unusual aspect ratios
170
+
171
+
```kotlin
172
+
// Android - Handling split screen
173
+
@Composable
174
+
funSplitScreenAware() {
175
+
val windowSize = currentWindowAdaptiveInfo().windowSizeClass
176
+
177
+
// In split screen: width=360dp, height=400dp, AR=1.11 (very wide)
178
+
// AR adjustment: ×0.985 (-1.5% to compensate for unusual proportion)
179
+
180
+
Card(
181
+
modifier =Modifier
182
+
.width(300.percentageDp.dp) // No AR adjustment
183
+
.padding(16.balanced().dp) // With AR adjustment
184
+
) {
185
+
Text(
186
+
"AR-Aware Content",
187
+
fontSize =16.balanced().sp
188
+
)
189
+
}
190
+
}
191
+
```
192
+
193
+
#### Example 5: Disabling AR for Specific Cases
194
+
195
+
**FLUID strategy with manual AR control:**
196
+
197
+
```kotlin
198
+
// Android
199
+
val textSize = fluidSp(
200
+
minValue =14f,
201
+
maxValue =20f,
202
+
applyAspectRatio =false// Disable AR for this specific element
203
+
)
204
+
205
+
// iOS
206
+
let size =AppDimens.shared.fluid(
207
+
min:14,
208
+
max:20,
209
+
applyAspectRatio:false
210
+
)
211
+
212
+
// Flutter
213
+
final size =AppDimens.fluid(
214
+
14,
215
+
maxValue:20,
216
+
applyAspectRatio:false
217
+
).calculate(context)
218
+
```
219
+
220
+
#### Example 6: Real-World Impact
221
+
222
+
**Social Media Feed Card:**
223
+
224
+
```kotlin
225
+
// Without AR awareness
226
+
Card(
227
+
modifier =Modifier
228
+
.fillMaxWidth()
229
+
.height(200.defaultDp) // Same height on all phones
230
+
) {
231
+
// On elongated phone: card looks "short" and "squashed"
232
+
}
233
+
234
+
// With AR awareness
235
+
Card(
236
+
modifier =Modifier
237
+
.fillMaxWidth()
238
+
.height(200.defaultDp) // Slightly taller on elongated phones
239
+
) {
240
+
// On elongated phone (AR=2.22): ~202dp height (+1%)
241
+
// Maintains visual proportion
242
+
}
243
+
```
244
+
245
+
**Key Takeaway:** AR compensation ensures visual consistency across the growing variety of screen shapes in modern devices (foldables, elongated phones, tablets, split-screen, multi-window).
0 commit comments