Custom Paging for LazyColumn

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

Exposing ktlint report as GitHub PR annotations

GitHub is awesome! One of the great features is PR annotations – your tool may simply not only check your code, but also post an annotation that is shown in the diff. ktlint is awesome! No more bikesheedding about coding style. Simply run ktlint, ideally let ktlint format your code and don’t let reviewers to … Read more

Windows’ window usability protip

Having opened multiple windows of the same app usually gorups them together as one button on the taskbar. Clicking it opens a preview of them and you may choose what window you would like to open. But there is a better option. The alternative UX is to open the last opened window on the first … Read more