Newsletter Issue #137

Published: 2022-10-18

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 keyboardOptions and 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 #compose Slack thread.

Composable Commentary

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 populate a LazyColumn() page-at-a-time as the user scrolls through its contents.

Resource Roundup

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 expand animation.

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.