2

Having to support night and day mode for API < 21 is a bit exhausting. Android API >= 21 has allowed the use of android:tint like the following:

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/ic_status"
    android:tint="@color/white" />

The previous made changing the tint color of the icon depending on the night mode very easy. However, it is not supported on API < 21. Which means I need two versions of every single item in my app (with different screen sizes). Is there any easier way??

This answer suggested creating a new style. But the events colorControlNormal and colorControlActivated are not what I'm looking for.

This one suggested using AppCompatImageView but I made my layouts with AppCompatButton and specified the drawableTop

Community
  • 1
  • 1
Motassem Jalal
  • 1,254
  • 1
  • 22
  • 46

0 Answers0