Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 507
Faust O'Keiber Avatar asked Sep 12 '18 14:09

Faust O'Keiber


People also ask

How do I change the color scheme in Android Studio?

Go to File > Settings, now under IDE settings click on appearance and select the theme of your choice from the dropdown. File > Import Settings , select the file or your choice and select ok a pop up to restart the studio will open up click yes and studio will restart and your theme will be applied.

What is material design in Android Studio?

Material design is a comprehensive guide for visual, motion, and interaction design across platforms and devices. To use material design in your Android apps, follow the guidelines defined in the material design specification and use the new components and styles available in the material design support library.


1 Answers

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

like image 62
ciprian Avatar answered Sep 27 '22 19:09

ciprian