I'm developing an Android library that extends android.view.View
. The library must adapt the theme choosen by developer whether it is DarkTheme
or LightTheme
. For example in LightTheme
, the TextView
color is black, on the contrary in DarkTheme
the TextView
color is white.
The problem is how to detect the theme choosen by developer? Is it dark or light? Is there any function like AppTheme instanceof DarkTheme
?
Thanks in advance