One of the projects I was working on recently, which was among the first activity recording apps, had a very complex screen with a lot of user interaction and data (referred to as Workout Summary Screen from now on). Naturally, as you’d expect, it had legacy code and tech, which was a blocker for extending it with new features. A decision was made to rewrite this screen so that it can be easily extended with new features and also get rid of weird bugs.
In this article, I’ll go through how I rewrote it, the technology and architecture I picked for the task and why. …
Epoxy, an Android library developed by Airbnb, is a widely known and used library for building complex screens in a RecyclerView.
It has built-in support for async diffing (using DiffUtil) and promotes immutability while enforcing best practices when working with RecyclerView.
In this article, I’m going to show you how you could build a list with expandable items, a.k.a. accordion, using Epoxy — assuming you’re already familiar with the library.
We’re going to build a list of video game titles grouped into genres.
Epoxy provides various ways to generate the Epoxy models. The code in this article is written in Kotlin and since I’m fond of Data Binding, I will use Epoxy with Data Binding model generation from XML layouts. Each layout is prefixed with
viewholder_ and I have the following configuration in
Updated Dagger integration to recommend using Dagger Hilt: Dependency Injection, which greatly simplifies dependency injection in ViewModels.
Updated to Lifecycle ViewModel SavedState version 2.2.0.
Check out my sample Github repository for a complete working example of everything I discuss here.
Saved State module for ViewModel is a new library from Google that builds on top of ViewModel architecture component. It let's you restore the UI state after a process stop.
In this article, I'm going to walk you through the basic usage of this library and continue deeper into a more advanced use case of integrating it with Dagger: