Nav3: Draggable Sheet

This is a post in a series on how I tackled Nav3 concepts and wired things together. I needed a sheet that can be closed by dragging it down – it surprised me a bit that the implementation isn’t that difficult. It uses the overlay scene concept and a few basic helpers from the Compose … Read more

Nav3: ModalBottomSheet

This is a post in a series on how I tackled Nav3 concepts and wired things together. There is no Nav3 bottom sheet implementation yet, so this is a quick post on how to create a scene/scene strategy, including the latest “enhancement” from the (yet unreleased) 1.1.0-alpha04 version that fixes the missing animation when popping … Read more

Custom Paging for LazyColumn

Image

Having a paginated stream of data can give you a bit of a headache. AndroidX provides its own paging library, which offers a lot of abstraction. However, I ultimately failed three times and started looking into what other options I had. My Issues with AndroidX.Paging All these issues ultimately stem from AndroidX.Paging’s very closed, strict … Read more

Kotlin Flow tips for ViewModel

Many months have passed since I last wrote about Kotlin Flow: Domain Model’s StateFlow Sharing. So, let’s take a look at something related to Flow handling in a ViewModel. StateIn shortcut Usually, you want a StateFlow‘s state to survive a configuration change. AndroidX’s default time limit is 5 seconds — but only if it’s subscribed. … Read more

Does Jetpack Navigation meet Type Safety?

You may have heard that Jetpack Navigation has a new API for type-safe navigation. This new official solution brings navigation with a “destination object” instead of simple manual URL building. Previously, I developed kiwicom/navigation-compose-typed library that did the same and was an inspiration for the official solution. The official solution makes navigation easier than before, … Read more

Type-safe arguments in Jetpack Navigation Compose

This blog post is a repost from code.kiwi.com. Newly, there is a meetup talk about Navigation Compose Typed library. Jetpack Navigation Compose is the Jetpack Navigation library enhanced for usage in Compose. But the actual “enhancement” is a bit limited and different from the View-based navigation. Most importantly, there are no SafeArgs — a type-safe … Read more

Page Objects for E2E Android UI testing

Android end-to-end UI testing is not that difficult, but we have observed that the official API/tooling doesn’t scale much if you have a big app. “Page Object” is a design pattern abstraction over a particular screen: it provides access to read the screen’s data and provides an API to interact with the screen. You may … Read more

Rewriting Android App’s Back-Handling Logic

Our Kiwi.com app is quite old and vast. It is in development for about 7 years; each year we’re adding more features and code, each year the app is being worked on by more developers. We evolved to a custom back-aware logic in our activities and fragments. Basically, back press was handled in the activity … Read more

Domain Model’s StateFlow Sharing

A lot of applications have an app-wide state defined in its domain model. Making it correctly reactive may not be so trivial. Let’s explore. Apps have state all over the source code. ViewModels have their screen’s state. Storage has the app’s state, and sometimes we need to keep an app-wide state in our domain model … Read more