From c3f180ea1b7820407202d41bd3e5d148b4146cfd Mon Sep 17 00:00:00 2001
From: axelherbstreith <75120552+axelherbstreith@users.noreply.github.com>
Date: Tue, 23 Feb 2021 10:29:20 +0100
Subject: [PATCH] Person Button Styling(EXPOSUREAPP-5160) (#2408)

* added basic button style

* removed divider

* refactoring

* Removed comments
---
 .../res/color/button_contact_diary_person.xml |  5 ++++
 .../color/button_text_color_emphasized.xml    |  2 +-
 .../layout/contact_diary_person_list_item.xml | 24 ++++++++++++++-----
 .../src/main/res/values/styles.xml            | 11 +++++++++
 4 files changed, 35 insertions(+), 7 deletions(-)
 create mode 100644 Corona-Warn-App/src/main/res/color/button_contact_diary_person.xml

diff --git a/Corona-Warn-App/src/main/res/color/button_contact_diary_person.xml b/Corona-Warn-App/src/main/res/color/button_contact_diary_person.xml
new file mode 100644
index 000000000..271ca0d8e
--- /dev/null
+++ b/Corona-Warn-App/src/main/res/color/button_contact_diary_person.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/colorBackground" android:state_checked="false" />
+    <item android:color="@color/colorAccentTintButtonPressed" android:state_checked="true" />
+</selector>
\ No newline at end of file
diff --git a/Corona-Warn-App/src/main/res/color/button_text_color_emphasized.xml b/Corona-Warn-App/src/main/res/color/button_text_color_emphasized.xml
index b50e718df..f3502eefc 100644
--- a/Corona-Warn-App/src/main/res/color/button_text_color_emphasized.xml
+++ b/Corona-Warn-App/src/main/res/color/button_text_color_emphasized.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:color="@color/colorTextPrimary2" android:state_enabled="false" /> <!-- disabled -->
+    <item android:color="@color/colorBackground" android:state_enabled="false" /> <!-- disabled -->
     <item android:color="@color/colorTextEmphasizedButton" /> <!-- default -->
 </selector>
\ No newline at end of file
diff --git a/Corona-Warn-App/src/main/res/layout/contact_diary_person_list_item.xml b/Corona-Warn-App/src/main/res/layout/contact_diary_person_list_item.xml
index d26e32b81..df108259f 100644
--- a/Corona-Warn-App/src/main/res/layout/contact_diary_person_list_item.xml
+++ b/Corona-Warn-App/src/main/res/layout/contact_diary_person_list_item.xml
@@ -22,15 +22,23 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/duration_below_15"
-            style="?attr/materialButtonOutlinedStyle"
             android:layout_width="match_parent"
+            app:backgroundTint="@color/colorBackground"
+            style="@style/contactDiaryPersonButton"
             android:layout_height="match_parent"
             android:layout_weight="1"
+            android:paddingHorizontal="5dp"
             android:text="@string/contact_diary_person_encounter_duration_below_15_min" />
 
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/cwaGrayHighlight" />
+
         <com.google.android.material.button.MaterialButton
             android:id="@+id/duration_above_15"
-            style="?attr/materialButtonOutlinedStyle"
+            style="@style/contactDiaryPersonButton"
+            app:backgroundTint="@color/colorBackground"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_weight="1"
@@ -52,15 +60,17 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/mask_with"
-            style="?attr/materialButtonOutlinedStyle"
+            style="@style/contactDiaryPersonButton"
             android:layout_width="match_parent"
+            app:backgroundTint="@color/colorBackground"
             android:layout_height="match_parent"
             android:layout_weight="1"
             android:text="@string/contact_diary_person_encounter_mask_with" />
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/mask_without"
-            style="?attr/materialButtonOutlinedStyle"
+            style="@style/contactDiaryPersonButton"
+            app:backgroundTint="@color/colorBackground"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_weight="1"
@@ -82,17 +92,19 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/environment_outside"
-            style="?attr/materialButtonOutlinedStyle"
+            style="@style/contactDiaryPersonButton"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            app:backgroundTint="@color/colorBackground"
             android:layout_weight="1"
             android:text="@string/contact_diary_person_encounter_environment_outside" />
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/environment_inside"
-            style="?attr/materialButtonOutlinedStyle"
+            style="@style/contactDiaryPersonButton"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            app:backgroundTint="@color/colorBackground"
             android:layout_weight="1"
             android:text="@string/contact_diary_person_encounter_environment_inside" />
 
diff --git a/Corona-Warn-App/src/main/res/values/styles.xml b/Corona-Warn-App/src/main/res/values/styles.xml
index c41fd93f1..7c756e3d3 100644
--- a/Corona-Warn-App/src/main/res/values/styles.xml
+++ b/Corona-Warn-App/src/main/res/values/styles.xml
@@ -104,6 +104,17 @@
         <item name="android:textColor">@color/button_text_color_emphasized</item>
     </style>
 
+    <style name="contactDiaryPersonButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
+        <item name="strokeColor">@color/button_contact_diary_person</item>
+        <item name="strokeWidth">2dp</item>
+        <item name="android:letterSpacing">0</item>
+        <item name="textAllCaps">false</item>
+        <item name="android:fontFamily">sans-serif-medium</item>
+        <item name="android:textStyle">normal</item>
+        <item name="android:textColor">#000000</item>
+
+    </style>
+
     <style name="buttonReset" parent="button">
         <item name="android:backgroundTint">@color/button_red</item>
         <item name="android:textColor">@color/button_text_color_emphasized</item>
-- 
GitLab