Changing the Theme
  • 19 Dec 2023
  • 1 Minute to read
  • Contributors
  • Dark

Changing the Theme

  • Dark

Article Summary

Some developers may prefer to remove appcompat from the project, which requires they change the theme.

  • If you remove the dependency on the appcompat library, you’ll need to change styles.xml to base your AppTheme on another parent theme.


Theme.AppCompat.Light.DarkActionBar to either @android:style/Theme.Material.Light.DarkActionBar 

The Holo theme can preferable to Material on the device because button focus states are more apparent with Holo. If you do use Material, we recommend defining a custom button style that clearly changes the look of buttons when they have focus.

  • If you changed your app theme to Material, in styles.xml you need to prepend the android namespace in front of the color attributes:

<item name="android:colorPrimary">
<item name="android:colorPrimaryDark">
<item name="android:colorAccent">

  • If you changed your app theme to Holo, in styles.xml you should remove the three <item> sub elements under <style> that refer to colors as these items are not used. In addition, you can delete colors.xml if you choose.

  • Under the mipmap resource directories, you can delete ic_launcher_round.png as round icons are not used on the device. If you choose to delete the round icon, you should remove the roundIcon attribute that got generated in AndroidManifest.xml on the <application> tag.

Was this article helpful?