jetc.dev Newsletter Issue #186
This week, we look at empty composables and slow insets. We examine gestures,
migrations to Compose, and
MotionLayout(). We see a slick branded QR code
generator. And, we have to put up with complex math (ugh!).
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Sometimes, you may want to treat a slot parameter differently if it has no content.
One approach is to have the parameter be nullable and pass
null to indicate a no-content
case. Or, you could see if the composable has no height. See how both of these work
in this week’s highlighted Stack Overflow question.
WindowInsets sometimes returns
0 for an inset size, before it returns the real value.
Learn more about why this is and some options for working around it in today’s
#compose Slack thread.
Posts, videos, and other new information related to Jetpack Compose!
Lucian Ghimpu explains how his team migrated their reusable UI elements from classic
Views to composables. Lucian focuses on key lessons, such as using a design system
and the importance of having a consistent Compose-friendly UI architecture.
Maksim Golendukhin examines the process for creating custom
Shape implementations and
applying them to composables. The end result is a triangular button with rounded corners.
Warning: post contains a fair bit trigonometry, so be sure to have had your coffee first! ☕ 😁
Igor Stevanovic needed a bottom sheet, but the built-in options lacked flexibility in
the desired areas. In this post, Igor explains the basics of setting up your own
custom bottom sheet implementation, employing
anchoredDraggable() as the foundation.
The GeeksForGeeks team looks at how we can implement a toggle button that controls
whether a password field is shrouded or not. This involves the
TextField(), where we can supply an
IconButton() for the desired
Ali Yüce wanted a button that, when clicked, contained an animated effect of putting
an item into a shopping cart. To pull off this effect, Ali used
a roster of
ConstraintSet JSON definitions.
Md Zahirul Islam explores the
Layout() composable for fully-customized layouts.
The specific example is creating a custom grid where the children are laid out
in a “snake” format (first row starts on the left, second row starts on the right, etc.).
Mohammed Rashid walks us through many of the configuration options available for the
Text() composable, from simple scenarios (bold, font size, etc.) through more
elaborate ones (gradient colors, drop shadows, text selection, etc.)
Other Interesting Links
- Adding icons to text in Jetpack compose with Kotlin and Android
- Medium: Bringing Compose Multiplatform to Life: Seamlessly Incorporating ktor, koin, and voyagar Integration
- Medium: Creating Dynamic Background Blur with Jetpack Compose in Android
- Medium: Finding a random point on a polygon
- Medium: Improving RoundCornerShape Appearance in Narrow Widths
- Medium: Jetpack Compose: Recomposition
- Medium: Make your System bars colorful
- Medium: Realm With Jetpack Compose
- Medium: Recreating WhatsApp Top Bar in Jetpack Compose: Part Two
- Medium: Theming and Styling in Jetpack Compose: A Detailed Walkthrough
- Slides: Composing an API the right way
- Slides: Modifiers: The secret sauce of Jetpack Compose
- Using SFSymbols in Jetpack Compose
100% pure code!
Özcan Alaşalvar brings us spinner- or wheel-style date and time pickers for Compose. The wheel view itself is available separately.
Other Interesting Links
- Gist: chachako / Toast.kt
- Gist: jisungbin / Modifier.drawHorizontalFadingEdges.kt
- GitHub: NicosNicolaou16 / ImagePickerAndroid
Maps for Compose now has a
3.1.1 patch release.
Resaca, a library that scopes
ViewModel instances to composables,
is up to
3.0.0 with a
new approach for detecting when the hosting activity resumes.
- 2023-11-21: Compose/Material3/Wear Compose updates! remember()! Adaptive layouts! Compose Multiplatform in 2024! @firstname.lastname@example.org on BasicTextField2()! Compose Multiplatform charts! And... is TV Compose in trouble?!?
- 2023-11-14: Compose Compiler! BasicTextField2()! @email@example.com and animations! Optimization! @firstname.lastname@example.org, JetBrains, and Fleet! JetBrains and plotting! And... we collapse?!?
- 2023-11-07: Compose Multiplatform! Chips in fields! Diffing! Custom fonts in Glance app widgets! Heatmaps! PIN input! And @email@example.com is in a bit of a haze?!?