jetc.dev Newsletter Issue #137
This week, we learn about swipe-to-refresh and pagination, as well as testing and IME action buttons. Plus, we see an iOS-style search-button-field combo widget, as well as an interesting riff on a horizontal pager.
And, we watch a video about text, not to be confused with reading some text about video.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
How Do I Dismiss a Dialog From the IME Action Button?
We can use
keyboardActions on a
TextField() to configure
the look and behavior of the IME action button. See how we can combine that with
MutableState to allow the action button to dismiss a
Dialog() in this week’s
highlighted Stack Overflow question.
How Do I Make an Unfocusable Field?
It is easy with Compose UI to get into an “XY problem”.
A question about making a
TextField() that cannot accept the focus might
not represent the problem, which is trying to have a button-like UI that visually resembles a
text field. Learn why focus is important (especially in Compose UI!) and how to try
to solve this problem in this week’s highlighted Kotlinlang
Posts, videos, and other new information related to Jetpack Compose!
Video: Compose Basics Q&A
Google’s Chris Arriola, TJ Dahunsi, Alejandra Stamato, and Jolanda Verhoef all joined a live chat with developer-submitted questions on all sorts of Compose topics, such as immutability, performance, migrating to Compose, and more!
Video: How Text Works in Jetpack Compose
The Code with the Italians team had Google’s Halil Ozercan and Zach Klippenstein in for their most recent livestream, focusing on text rendering in Compose UI. They cover the general rendering process, how to support multiple fonts, auto-sizing your text, and more!
Video: Guide to Testing Jetpack Compose
Dmytro Shuba delivered a Londroid presentation on testing your composables, from the basics of setting up a test to how to test a mix of views and composables as you migrate to a Compose-centric UI.
Medium: Jetpack Compose Swipe To Refresh
Igor Stevanovic examines Accompanist’s support for
SwipeRefresh(), for implementing
the popular swipe-to-refresh UI pattern. Igor also discusses using Accompanist’s
placeholder libraries for showing placeholders while data is being loaded (e.g., from
a Web service call).
Medium: Jetpack Compose Pagination
Igor Stevanovic also wrote about using Paging 3 in Compose UI, in this case to
LazyColumn() page-at-a-time as the user scrolls through its contents.
Other Interesting Links
- Video: Compose Basics Community Tip
- Medium: State hoisting vs Defer reads
- Medium: Advanced work with the Snackbar in the Jetpack Compose
- Medium: Unit Testing Compose State Change
- Medium: Creating Reusable TopBar in Jetpack Compose and Slot Pattern
- Medium: Creating Fullscreen Loading dialog using Jetpack Compose
- Android Jetpack Compose API Tutorial
- Medium: Android Jetpack Compose: Modern UI toolkit with Kotlin (Basic)
- Medium: Navigating Android’s UI Landscape
100% pure code!
GitHub: commandiron / ExpandableHorizontalPagerCompose
Emir Demirli created an
ExpandableHorizontalPager() composable. It is basd on
a standard Accompanist pager, but with different composables for the centered
and other pages. Plus, when you tap the centered item, it expands to fill the available
space, such as zooming to fill the entire screen.
GitHub: commandiron / swipe-search-compose
Emir Demirli also created a
SwipeSearch() composable. This is a search button
that, when tapped, expands into a search field, synchronized with the IME
GitHub: pseudoankit / RatingBarCompose
Ankit Kumar created a simple
RatingBar() composable, with configurable bar
icons and colors.
GitHub: tfaki / Jump
Talha Fakıoğlu brings us a
Jump() composable for a basic bounce animation
that we can apply to arbitrary composable content.
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!