From the course: Android Compose with Kotlin
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Introduction to adaptive layouts - Kotlin Tutorial
From the course: Android Compose with Kotlin
Introduction to adaptive layouts
- [Instructor] Gone are the days of portrait versus landscape. Android devices have evolved to cover many different form factors, display sizes, and configurations. As developers, we need to account for this variety when we're developing our applications. For Android view-based apps, this is often accomplished via resource qualifiers, like you see here. There's one layout file for smallest width being 600 DP or less, and another for 600 DP or wider. Simple, well, not quite. As more devices, more form factors came on the scene, the amount of complexity increased exponentially. Additional window sizes and breakpoints all had to be taken into consideration, often creating a maintenance nightmare. And that's when the Android team introduced window size classes. These greatly simplified what developers needed to know about a user's device configuration and the ultimate implementation. The composed window size class implementation is simple, and the recommended approach for adaptive…