dragonhas.blogg.se

Android studio theme per activity
Android studio theme per activity








android studio theme per activity android studio theme per activity

In the theme file which would be res/values/styles.xml or the suitable one depending upon the version you are targetting, define the same attributes pointing to theĪppropriate drawables. Here it is how:ĭeclare custom attributes in res/values/attrs.xml file for each of the ImageView or ActionBar icon to be changed based on theme: In the end, I found out it was fairly easy, without using any code. I looked at some of the questions in StackOverflow, but none answered satisfactorily. Since my application supported both light and dark theme, I wanted to switch the group indicators, action bar icons to light and dark versions as well. I was using an ExpandableListView and using the ImageView asĪ group indicator rather than out of the box group indicator. Recently, I had a requirement to change the ImageView picture to be changed based on the theme.










Android studio theme per activity