View profile Newsletter - Issue #55 Newsletter - Issue #55
By Mark Murphy, CommonsWare • Issue #55 • View online
This week, as we gear up for a possible beta02 release, we look at scrolling lists: how to disable the scrolling and how to have stateful rows. We also hear from Google’s Leland Richardson, spend time with architecture, spend even more time with clocks, and peek at a reusable pull-to-refresh composable. Plus, I beg you to start thinking about what else you can fix in your UI as you migrate to Compose… such as thinking about other form factors.

One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
How to Disable and Enable Scrolling?
Composable Commentary
Posts, videos, and other new information related to Jetpack Compose!
Video: Jetpack Compose Beta AMA
How To Understand Composables & Recomposition
Architecture in Jetpack Compose — MVP, MVVM, & MVI
Getting ready for Declarative UIs — Part 2
Compose (UI) beyond the UI (Part III): No AAC-ViewModel and a sample app | by Jordi Saumell
Video: Step it up: Compose for Desktop
Mavericks, Meet Jetpack Compose
Resource Roundup
100% pure code!
GitHub - poculeka / PullToRefresh
GitHub - jeziellago / compose-markdown
GitHub - STAR-ZERO / ComposeFlowLayout
Gist: vitorprado / RatingBar.kt
…And One More Thing
Now that Compose and Compose UI are in their first beta, teams may start to think about beginning to use these technologies in their apps. If your team is among them, you should consider taking this opportunity to also clean up other shaky practices in your current UI implementation.
For example, you might want to stop thinking of screen sizes.
Some Android developers are fixated on finding screen dimensions, then trying to use them. For example, in Compose UI, you can find the screen height using LocalConfiguration.current.screenHeightDp.
However, this is not really a good idea… because your app may not be using the full screen.
Most Android devices nowadays support split-screen mode. Many users will not be using that mode, but some will. In split-screen mode, your app’s window is not going to take up the full screen, but rather only part of it.
Chrome OS devices, and specialty “desktop-style environments” like Samsung DeX, use Android’s free-form multiwindow support. In this case, your app’s window also is not going to take up the full screen, but rather only part of it. Many users will not be using this sort of device or environment, but some will.
With “foldables”, the screen size can change, and users may be more prone to use split-screen mode. We might soon get “rollable” phones. Who knows what other form factors will follow those? After all, who would have predicted the LG Wing?
(personally, I half expect the next segment to be “crumple-ables”)
You might look at all of those and conclude that none of them are very popular. That may well be true. However, combined, the number of users using one of those environments might be interesting.
More importantly, manufacturers keep trying, presumably with some encouragement and support from Google. Eventually, something is going to become a hit, either on its own merits or because Apple decides that it is cool.
In other words, the era of “one screen = one app” most likely is coming to a close.
So, rather than think in terms of “how big is the screen?”, think instead in terms of “how much space do I have?”. We saw this a few weeks ago in the “How Big Are We?” post in the “One Off the Slack” series. You can use things like BoxWithConstraints or onSizeChanged() to be able to adapt your UI to match the available space, and let the system worry how much space that is.
Adopting Compose UI will require a significant overhaul of your UI code, as you adopt Compose UI progressively through your app. While you are making those changes, think through what other assumptions your code is making, and see if you can avoid making those assumptions, to better future-proof your UI. After all, you never know when someday your app needs to run on a phone that the user can just crumple up and shove in their pocket.
Did you enjoy this issue?
Mark Murphy, CommonsWare

Jetpack Compose news and notes.

If you don't want these updates anymore, please unsubscribe here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Powered by Revue