How to Handle Disabled State for Multicolour Icons in Android (Jetpack Compose Guide)
Handling the disabled state in UI is straightforward — until you deal with multicolour icons.
In modern Android development, especially when working with Jetpack Compose and scalable design systems, icons can be either single-colour or multicolour. While single-colour icons are easy to manage, multicolour ones introduce complexity — particularly when representing states like disabled.
In this article, we’ll walk through how we solved this problem at inDrive and how you can apply the same approach in your Android apps.
The Problem: Disabled State for Icons
At inDrive, we categorize icons into two groups:
- Single-colour icons — use one color
- Multicolour icons — use multiple colors
Icons can be either vector (VectorDrawable) or raster (Bitmap) images.
For single-colour icons, handling states is simple: we apply a tint.
ColorFilter.tint(tintColor)
For example, a disabled icon just gets a muted tint.
But this approach breaks completely for multicolour...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE