jetc.dev Newsletter Issue #157
This week, we look at code organization, custom layouts, and text entry in Wear Compose. We also peek at a preference UI and a custom switch implementation.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Unfortunately, the Linen archive of Kotlinlang Slack is somewhat broken
as I prepare this newsletter, so I will not have a highlighted
Slack post 😞. Also, if you use Kotlinlang Slack, note that they created
#compose-android channel, so
#compose can be limited to general
Compose and Compose UI questions.
Why Do We Lose Weight?
Weight on a
Row() needs to be applied to the direct children of the row…
even if those children are not the actual UI elements that you might think
need the weight. See how
AnimatedVisibility() can break your weight
expectations in this week’s highlighted Stack Overflow question.
Posts, videos, and other new information related to Jetpack Compose!
Video: Compose Layouts and Modifiers: Live Q&A - MAD Skills
Google’s Chris Arriola, Andrei Shikov, Simona Stojanovic, and Jolanda Verhoef spent about 45 minutes taking Compose UI questions, ranging from when it makes sense to create a custom layout to the state of experimental Compose features.
Organize your Views: Jetpack Compose edition
Marco Gomiero walks through one possible way of organizing your Navigation for Compose code,
including how to have a simpler
NavHost() and how to structure the screens that
you navigate to.
Custom Compose Layouts
Beatrice Kinya explores
SubcomposeLayout(), how it ties into the composition/layout/drawing
triad of phases, and when you might consider using it.
Medium: Infinite Scroll with Paginated API calls in Jetpack Compose
Medium user MathRoda examines how to detect when the user has scrolled to the bottom
LazyColumn(), so you can load the next page of data from a paginated server
Medium: Overlapping profile pictures with Jetpack Compose Modifier
A common UI pattern for social screens is having overlapping user avatars,
often with a circular crop. Baptiste Carlier explores how to implement that
sort of overlap effect, creating some custom modifiers (like
along the way.
Medium: Typing on a Tiny Screen
Entering text on a watch sucks. Entering text on a Compose UI app on a watch is
EditText() does not appear to be available yet there. Katie
Barnett shows how to handle this the hard way, using
Jetpack Compose: Switch
Alex Zhukovich takes a deep dive into the
Switch() composable, including
what differs between Compose Material and Compose Material3 and how to test
composables that contain switches.
Medium: Jetpack Compose: Remember vs RememberSaveable
Morteza Taghdisi reviews the differences between ordinary
rememberSaveable(), including the benefits and limitations of the latter.
Other Interesting Links
- How to handle deeplinks using Jetpack Compose navigation
- Video: Developing Wear OS Apps with Jetpack Compose
- Medium: Compose Camp 2: Mastering Images in Jetpack Compose with Coil-Compose and Landscapist
- Medium: How to implement pagination in Realtime Database using Jetpack Compose?
- Medium: Custom Dynamic Form using Jetpack Compose: Making Form Creation Easy!
- Medium: Grammatical Inflection API-Android14
- Medium: Navigation in Jetpack Compose
- Medium: Multiple conditional modifier in jetpack compose
- Medium: Android Jetpack Compose Silly Mistakes
- How to Implement OutlinedButton in Jetpack Compose?
- Medium: Minimalism and State Management.
- Jetpack Compose — Auto Image Slider with Dots Indicator
- Medium: How write full stacks Apps with Kotlin (Springboot backend, Jetpack Compose Mobile)
100% pure code!
GitHub: markusressel / KutePreferences
Markus Ressel brings us a library for rendering a preference UI using Compose Material3m
KutePreferencesScreen() composable and associated
GitHub: razaghimahdi / ImageSwitch
GitHub user razaghimahdi shows us an
ImageSwitch() composable that uses an
image for the track portion of a switch.
Gist: bagus2x / ExoPlayerState.kt
Tubagus Saifulloh shows some Compose snippets for pausing ExoPlayer playback
when the activity is paused, then resuming playback when the activity is resumed,
Or, you can subscribe to the Atom feed or follow Mark Murphy in the Fediverse.
- 2023-03-14: Compose RC! Wear Compose alpha! Grayscale composables! Updating our Compose dependencies! MVVM! Bottom sheets! And... another Figma-to-composable plugin?!?
- 2023-02-28: Updates to the Compose family of artifacts! Layout()! UiAutomator! Pull-to-refresh! @email@example.com on adding animation sizzle! ExoPlayer! PIN entry! And... @firstname.lastname@example.org is on TV?!?
- 2023-02-21: Modifiers! Drawing! Errors! Paging (and testing paging)! QR codes! KMM templates! And a correction from @email@example.com!