light theme | dark |
---|---|
![]() |
![]() |
color.xmlに以下のような感じでカラーコードを定義する
https://github.com/LeoAndo/AndroidM2ButtonJavaDemo/blob/master/app/src/main/res/values/colors.xml#L11-L12
light theme
https://github.com/LeoAndo/AndroidM2ButtonJavaDemo/blob/master/app/src/main/res/values/themes.xml#L5
dark theme
https://github.com/LeoAndo/AndroidM2ButtonJavaDemo/blob/master/app/src/main/res/values-night/themes.xml#L5
- resディレクトリの下にcolorディレクトリを作成する
- colorディレクトリの中にselectorファイルを追加する
- selectorファイルをButton側で利用する