Alex Zhukovich
alexzh.com
Alex Zhukovich
@alexzh.com
44 followers 51 following 93 posts
Posts Media Videos Starter Packs
3/3 I realized this after spending some time improving my layout for the medium layout and checking it on a single device. We should design layouts based on screen sizes, not device types.

Does your application support foldable devices?
2/3 Here's the problem:
Google's window size classes aren't device categories—they're viewport measurements. The Pixel 9 Pro Fold jumps straight from compact to expanded, never using medium.

On the other side, Samsung's Z Fold 5 uses medium.

Same device category, but different screen sizes.
1/3 Foldable devices always use the medium window size class.

I believed this too. Then I opened my app on a Pixel 9 Pro Fold and was surprised that the "foldable" layout was skipped, and the "tablet" layout appeared on the screen.

#AndroidDev #KMP #MaterialDesign
Did you know that the OutputTransformation API lets you format text fields in Jetpack Compose in real time?

Here's how to improve entering a card number. You can also use it for phone numbers, dates, postcodes, and more.

Do you already use OutputTransformation in your project?
Your preview functions can be used not only for development but also as a tool to releasing apps without pixel imperfections.

Want to dive deeper into visual testing? Subscribe to my newsletter. Plus, you’ll be the first to know when my book on visual testing is released!

alexzh.com/

#AndroidDev
Mobile development with Alex
A blog about Android development & testing, Best Practices, Tips and Tricks
alexzh.com
You now need only to make minor adjustments to implement visual tests.

Start strategically:
• Convert your design system and/or common components first
• Add preview functions for the most critical screens
• Gradually expand coverage to less critical screens
But if you are already using Jetpack Compose, you can use ComposablePreviewScanner or the Compose Preview Screenshot Testing framework to transform your preview functions into visual tests.

You likely already created a preview function, which was the hard part.
“We don’t have time for visual testing.” That’s what many Android developers say.

Many developers think that creating visual tests is hard, as they require separate test cases, learning new frameworks and approaches, and dealing with flaky CI pipelines.
I’ll be speaking at @droidcon.it in Turin about Android UI testing.

Here’s what I’ll cover:
• Getting started with natural language UI tests
• A technical comparison between Journeys, Espresso, UiAutomator, and Compose UI Test

Spoiler: There’s no one-size-fits-all solution.
👤🟢 Welcome back @alexzh.com to Droidcon Italy 2025!
Mobile Engineer, Educator & Author 🇮🇹🎤

🔎 “The Complete Android UI Testing Landscape: From Journey to Traditional Approaches”
it.droidcon.com/2025/agenda/

👉🏻 Curious who else is speaking at hashtag#DroidconItaly25? it.droidcon.com/2025/speakers/
The ButtonGroup component from Material 3 Expressive replaces the SegmentedButtons component. It supports more shapes and includes overflow buttons for additional components that can't fit on the screen.

#JetpackCompose
Compose Multiplatform 1.9.0 is here! It now supports parameters for preview functions, including:

• name
• group
• locale
• widthDp
• heightDp
• showBackground
• backgroundColor

More details: github.com/JetBrains/c...
3. Number formatting varies between countries.

Let's compare:

• US: 12,345,678.9
• FR: 12 345 678,9

Use "NumberFormat.getNumberInstance(locale)." for number formatting.

Which of these has caused issues in your apps?
2. Date formats are often a reason for user confusion.

Is "01/02/2025" January 2nd or February 1st? Actually, it depends on the locale.

• US: MM/DD/YYYY
• UK: DD/MM/YYYY

Use "DateTimeFormatter" to format dates based on locale.

Apply a similar approach to time formatting.
1. Currency formatting differs by country:

• US: $1,234.56
• DE: 1.234,56 €

Use "NumberFormat.getCurrencyInstance(locale)" for proper currency symbol positioning.
Building global software isn't just about translation - it's about understanding cultural context.

Here are 3 critical locale pitfalls to solve before shipping globally:

1. Currency formatting
2. Date interpretation
3. Number separators

Details 🔽
Need to build list and detail screens in your Jetpack Compose project that adapt to different device types?

Check out the ListDetailPaneScaffold component from the Material3 adaptive-layout dependency.
Did you know you can control the tooltip's position relative to its anchor starting from "material3:1.5.0-alpha01"?

Tooltips support the following positions:
• Above
• Below
• Start
• End
Here is one more reason why you need visual tests which will verify your components and screens against system configuration options, like font scale.

Remember: Not everyone uses the default font size.
Did you know that Material 3 Expressive introduces many additional shapes that you can use in Jetpack Compose?
Want to see how your UI adapts to different wallpapers?

You can preview dynamic colors directly in Android Studio using the "wallpaper" parameter for preview annotation.

Does your app support dynamic colors?
Compose Multiplatform 1.8.2 is now available. With this update, you can use preview parameters for Compose Multiplatform previews.

⚠️ Currently, the multiple previews are rendered in IntelliJ IDEA 2025.1.2 (stable version) and not rendered in Android Studio.
Add this dependency to use the component:
implementation("androidx.compose.material3:material3-android:1.4.0-alpha15")
Are you looking for a simple way to give access to important actions and keep the UI clean? Then, try HorizontalFloatingToolbar. It was recently released as part of Material 3 Expressive components.

⚠️ Currently in alpha

#AndroidDev #MaterialDesign #JetpackCompose