Skip to content

Commit

Permalink
Improve button styles
Browse files Browse the repository at this point in the history
farmblocks-android issue: 3
  • Loading branch information
KennedySDias committed Aug 16, 2019
1 parent d113235 commit 5e1b4af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_buttons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
android:orientation="vertical"
tools:context=".ButtonsActivity">

<Button
<com.google.android.material.button.MaterialButton
style="@style/FarmBlocks.Button.Primary"
android:layout_margin="8dp"
android:text="Primary Button"
tools:ignore="HardcodedText" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/FarmBlocks.Button.Neutral"
android:layout_margin="8dp"
android:text="Neutral Button"
tools:ignore="HardcodedText" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/FarmBlocks.Button.White"
android:layout_margin="8dp"
android:text="White Button"
tools:ignore="HardcodedText" />

<Button
<com.google.android.material.button.MaterialButton
style="@style/FarmBlocks.Button.Primary"
android:layout_margin="8dp"
android:enabled="false"
Expand Down
9 changes: 5 additions & 4 deletions components/src/main/res/values/button_styles.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="FarmBlocks.Button">
<item name="android:textAppearance">@style/FarmBlocks.TextStyle.Button.White</item>
<item name="android:foreground">?android:attr/selectableItemBackground</item>
<style name="FarmBlocks.Button" parent="Widget.MaterialComponents.Button">
<item name="android:textAppearance">@style/FarmBlocks.TextStyle.Button</item>
<item name="android:background">@drawable/button_shape_background</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">50dp</item>
<item name="android:layout_height">56dp</item>
<item name="android:paddingStart">24dp</item>
<item name="android:paddingEnd">24dp</item>
<item name="android:elevation">2dp</item>
<item name="android:textAllCaps">false</item>
</style>

<style name="FarmBlocks.Button.Primary">
Expand Down

0 comments on commit 5e1b4af

Please sign in to comment.