Color attribute | Source |
---|---|
colorPrimary |
AppCompat |
colorPrimaryVariant |
MDC |
colorOnPrimary |
MDC |
colorSecondary |
MDC |
colorSecondaryVariant |
MDC |
colorOnSecondary |
MDC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<!-- In res/values/themes.xml --> | |
<style name="ThemeOverlay.App.PrimarySecondary" parent=""> | |
<item name="colorPrimary">?attr/colorSecondary</item> | |
<item name="colorOnPrimary">?attr/colorOnSecondary</item> | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<!-- In button/res/color/mtrl_btn_bg_color_selector.xml --> | |
<selector ...> | |
<item android:color="?attr/colorPrimary" android:state_enabled="true" /> | |
<item android:alpha="0.12" android:color="?attr/colorOnSurface" /> | |
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<!-- In res/color/primary_60.xml --> | |
<selector ...> | |
<item android:alpha="0.6" android:color="?attr/colorPrimary" /> | |
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<Button | |
... | |
- app:backgroundTint="@color/green_300" | |
+ app:backgroundTint="?attr/colorPrimary" | |
- android:textColor="@color/black" | |
+ android:textColor="?attr/colorOnPrimary" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<!-- In res/values/themes.xml --> | |
<style name="Theme.App" parent="Theme.App.Base"> | |
... | |
<item name="colorPrimary">@color/navy_700</item> | |
<item name="colorPrimaryVariant">@color/navy_900</item> | |
<item name="colorSecondary">@color/green_300</item> | |
<item name="colorSecondaryVariant">@color/green_900</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<!-- In res/values/colors.xml --> | |
<color name="navy_500">#64869B</color> | |
<color name="navy_700">#37596D</color> | |
<color name="navy_900">#073042</color> | |
<color name="green_300">#3DDC84</color> | |
<color name="green_500">#00A956</color> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<!-- In res/values/attrs.xml --> | |
<attr name="colorCustom" format="color" /> | |
<!-- In res/values/themes.xml --> | |
<style name="Theme.App" parent="Theme.MaterialComponents.*"> | |
... | |
<item name="colorCustom">@color/...</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<Button | |
- android:textColor="@android:color/white" | |
+ android:textColor="?attr/colorOnPrimary" | |
... /> |