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側で利用する