Tweak some button styles with those added in .

The styles used by the app details showed good padding on either
side of the buttons text. This was because they had a certain amount
of screen space to fill up which resulted in nice empty space on either
side of the text. Other buttons do not have this type of layout, so
need to have a minimum amount of padding thrust upon them.

Required breaking out into values-v17 too, so refactored common styles
into base style to make this easier.
This commit is contained in:
Peter Serwylo 2016-12-08 07:04:31 +11:00
parent ffa3a8dbf3
commit 7209ab87f5
5 changed files with 21 additions and 6 deletions

@ -24,6 +24,7 @@
<Button
android:id="@+id/button"
tools:text="View all 10"
style="@style/DetailsSecondaryButtonStyle"
android:layout_width="wrap_content"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"

@ -54,6 +54,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Find people near me"
style="@style/DetailsSecondaryButtonStyle"
app:layout_constraintTop_toBottomOf="@+id/text2"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"

@ -15,6 +15,7 @@
<Button
android:id="@+id/update_all_button"
android:text="@string/my_apps_btn_update_all"
style="@style/DetailsSecondaryButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DetailsButtonStyle" parent="DetailsButtonStyleBase">
<item name="android:paddingStart">20dp</item>
<item name="android:paddingEnd">20dp</item>
</style>
</resources>

@ -1,17 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DetailsPrimaryButtonStyle">
<item name="android:padding">5dp</item>
<style name="DetailsButtonStyleBase">
<item name="android:paddingTop">5dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:paddingLeft">20dp</item>
<item name="android:paddingRight">20dp</item>
<item name="android:textSize">12sp</item>
<item name="android:textStyle">normal</item>
</style>
<style name="DetailsButtonStyle" parent="DetailsButtonStyleBase" />
<style name="DetailsPrimaryButtonStyle" parent="DetailsButtonStyle">
<item name="android:textColor">#ffffff</item>
<item name="android:background">@drawable/button_primary_background_selector</item>
</style>
<style name="DetailsSecondaryButtonStyle">
<item name="android:padding">5dp</item>
<item name="android:textSize">12sp</item>
<item name="android:textStyle">normal</item>
<style name="DetailsSecondaryButtonStyle" parent="DetailsButtonStyle">
<item name="android:textColor">@color/fdroid_blue</item>
<item name="android:background">@drawable/button_secondary_background_selector</item>
</style>