Faust O'Keiber
Faust O'Keiber

Reputation: 113

Where can I find and modify the material color attributes in Android Studio as defined by the Material Design Guide?

Referring to the following Material design Guide

I want to modify the 12 different colors in my app e.g. Primary Variant, Secondary, etc.

However, in Android studio, when using the Theme Editor, the list of colors available to modify are different than what is specified in the material design guide. This is true no matter which theme I choose.

The 12 color variants as defined by both the Material Design and in the Theme Editor in android studio are as follows:

Material Design:

colorPrimary    
colorPrimaryVariant    
colorSecondary    
colorSecondaryVariant    
colorBackground    
colorError    
colorSurface     
colorOnPrimary  
colorOnSecondary      
colorOnBackground     
colorOnError       
colorOnSurface    

Theme Editor:

colorPrimary    
colorPrimaryDark    
colorAccent    
android:colorBackground     
android:colorForeground     
android:navigationBarColor       
android:statusBarColor    
android:textColorPrimary    
android:textColorPrimaryInverse    
android:textColorSecondary    
android:textColorSecondaryInverse    
android:windowBackground   

Are these colors just different names for the same thing or am I just looking in the incorrect place? I couldn't find anything in the material design documentation that that had names similar to what was in android studio so I'm a bit unsure.

Any guidance would be greatly appreciated!

Upvotes: 11

Views: 2140

Answers (1)

ciprian
ciprian

Reputation: 151

The new colors attributes are not available on current stable version 1.0.0, however are available in latest 1.1.0 alpha:

implement "com.google.android.material:material:1.1.0-alpha05"

The documentation is ahead of implementation. You can check the release logs to have an idea: https://github.com/material-components/material-components-android/releases

Upvotes: 1

Related Questions