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

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

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

Retrieving reified generic arguments

Kotlin has a great feature that will allow you to preserve generic type T for further work, not only type resolution. So how much we can utilize it? This simple code does not take any “normal” argument, but it takes one generic argument – the T. Usually, we can just pass the T around to … Read more

PHP wish-list

A random list of missing language features in PHP. I do mostly Kotlin nowadays, so this is quite inspired by that language. I think these features could be (somehow) “easily” added into PHP. No new keyword It removes unnecessary keywords and allows to easily chain method calls. This cool feature also allows a nice trick … Read more

Variance Elsewhere

The last post was mainly about the variance explanation and it was using Kotlin. But what about other languages? Let’s explore together. TL;DR Language Generics dec. out dec. in use out use in type erasure break out rules Variance available on Kotlin ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ classes, interfaces Java ✔️ ❌ ❌ … Read more

Variance

A lot was written about variance and its application in generics. This is another trial to explain variance and its practical usage. Let’s explore this using Kotlin. This article expects basic knowledge about generics. Variance is a powerful way to allow your code to do more. It is most obvious when you consider generics with … Read more