Added more styles to be used on top of primary color

This commit is contained in:
Viktor De Pasquale 2019-10-06 11:14:11 +02:00
parent 88027f2151
commit d35d1b8860
5 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?colorDisabled" android:state_enabled="false" />
<item android:color="?colorOnPrimary" />
</selector>

View File

@ -20,6 +20,7 @@
<item name="colorTextTransient">@color/color_text_transient</item>
<item name="colorPrimaryTransient">@color/color_primary_transient</item>
<item name="colorErrorTransient">@color/color_error_transient</item>
<item name="colorOnPrimaryTransient">@color/color_on_primary_transient</item>
</style>
</resources>

View File

@ -21,13 +21,17 @@
<!--Button-->
<attr name="styleButtonDefault" format="reference" />
<attr name="styleButtonDefaultOnPrimary" format="reference" />
<attr name="styleButtonFlat" format="reference" />
<attr name="styleButtonFlatOnPrimary" format="reference" />
<attr name="styleButtonText" format="reference" />
<attr name="styleButtonTextOnPrimary" format="reference" />
<attr name="styleButtonError" format="reference" />
<!--Icon-->
<attr name="styleIconNormal" format="reference" />
<attr name="styleIconPrimary" format="reference" />
<attr name="styleIconOnPrimary" format="reference" />
<attr name="styleIconError" format="reference" />
<!--Image-->
@ -70,6 +74,7 @@
<!--Transient-->
<attr name="colorTextTransient" format="reference" />
<attr name="colorPrimaryTransient" format="reference" />
<attr name="colorOnPrimaryTransient" format="reference" />
<attr name="colorErrorTransient" format="reference" />
<!--Static-->

View File

@ -33,12 +33,16 @@
<item name="styleCardOnPrimary">@style/WidgetFoundation.Card.OnPrimary</item>
<item name="styleButtonDefault">@style/WidgetFoundation.Button</item>
<item name="styleButtonDefaultOnPrimary">@style/WidgetFoundation.Button.OnPrimary</item>
<item name="styleButtonFlat">@style/WidgetFoundation.Button.Flat</item>
<item name="styleButtonFlatOnPrimary">@style/WidgetFoundation.Button.Flat.OnPrimary</item>
<item name="styleButtonText">@style/WidgetFoundation.Button.Text</item>
<item name="styleButtonTextOnPrimary">@style/WidgetFoundation.Button.Text.OnPrimary</item>
<item name="styleButtonError">@style/WidgetFoundation.Button.Error</item>
<item name="styleIconNormal">@style/WidgetFoundation.Icon</item>
<item name="styleIconPrimary">@style/WidgetFoundation.Icon.Primary</item>
<item name="styleIconOnPrimary">@style/WidgetFoundation.Icon.OnPrimary</item>
<item name="styleIconError">@style/WidgetFoundation.Icon.Error</item>
<item name="styleImageBig">@style/WidgetFoundation.Image.Big</item>
@ -97,6 +101,7 @@
<item name="colorTextTransient">@color/color_text_transient</item>
<item name="colorPrimaryTransient">@color/color_primary_transient</item>
<item name="colorErrorTransient">@color/color_error_transient</item>
<item name="colorOnPrimaryTransient">@color/color_on_primary_transient</item>
</style>
</resources>

View File

@ -42,14 +42,34 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
<item name="android:textStyle">bold</item>
</style>
<style name="WidgetFoundation.Button.OnPrimary">
<item name="backgroundTint">?colorOnPrimary</item>
<item name="rippleColor">?colorPrimary</item>
<item name="android:textColor">?colorPrimary</item>
<item name="iconTint">?colorPrimary</item>
</style>
<style name="WidgetFoundation.Button.Flat" parent="Widget.MaterialComponents.Button.UnelevatedButton">
<item name="android:textStyle">bold</item>
</style>
<style name="WidgetFoundation.Button.Flat.OnPrimary">
<item name="backgroundTint">?colorOnPrimary</item>
<item name="rippleColor">?colorPrimary</item>
<item name="android:textColor">?colorPrimary</item>
<item name="iconTint">?colorPrimary</item>
</style>
<style name="WidgetFoundation.Button.Text" parent="Widget.MaterialComponents.Button.TextButton">
<item name="android:textStyle">bold</item>
</style>
<style name="WidgetFoundation.Button.Text.OnPrimary">
<item name="rippleColor">?colorOnPrimary</item>
<item name="android:textColor">?colorOnPrimary</item>
<item name="iconTint">?colorOnPrimary</item>
</style>
<style name="WidgetFoundation.Button.Error" parent="WidgetFoundation.Button.Text">
<item name="rippleColor">?colorError</item>
<item name="android:textColor">?colorError</item>
@ -83,6 +103,10 @@ variant. Make sure to use style referenced by attribute defined it attrs.xml.
<item name="tint">?colorPrimaryTransient</item>
</style>
<style name="WidgetFoundation.Icon.OnPrimary">
<item name="tint">?colorOnPrimaryTransient</item>
</style>
<style name="WidgetFoundation.Icon.Error">
<item name="tint">?colorErrorTransient</item>
</style>