From d9a965f5d844ddbd6799acc2f217538bc85df063 Mon Sep 17 00:00:00 2001
From: Chilja Gossow <49635654+chiljamgossow@users.noreply.github.com>
Date: Fri, 8 Jan 2021 18:48:18 +0100
Subject: [PATCH] Adjust ripple area on dispatcher screen (EXPOSUREAPP-4518)
 #2058

Co-authored-by: Ralf Gehrer <ralfgehrer@users.noreply.github.com>
---
 .../res/layout/fragment_test_appconfig.xml    |  8 ++++----
 .../layout/fragment_test_contact_diary.xml    |  8 ++++----
 .../res/layout/fragment_test_debugoptions.xml |  4 ++--
 .../res/layout/fragment_test_deviceinfo.xml   |  4 ++--
 .../res/layout/fragment_test_keydownload.xml  |  4 ++--
 .../fragment_test_risk_level_calculation.xml  |  2 +-
 .../res/layout/fragment_test_submission.xml   |  6 +++---
 .../layout/fragment_test_task_controller.xml  |  8 ++++----
 .../res/layout/view_crashreport_list_item.xml |  4 ++--
 .../main/res/drawable/grey_card_ripple.xml    | 16 +++++++++++++++
 .../res/layout/contact_diary_privacy_card.xml |  2 +-
 .../layout/fragment_submission_dispatcher.xml |  1 -
 .../src/main/res/layout/include_16_years.xml  |  4 ++--
 .../res/layout/include_dispatcher_card.xml    |  3 +--
 .../main/res/layout/include_privacy_card.xml  |  4 ++--
 .../include_privacy_card_no_consent.xml       |  4 ++--
 .../include_submission_consent_body.xml       |  2 +-
 ...nclude_submission_country_no_selection.xml |  4 ++--
 .../include_submission_country_selector.xml   |  4 ++--
 .../src/main/res/values/styles.xml            | 20 +++++++++++--------
 20 files changed, 65 insertions(+), 47 deletions(-)
 create mode 100644 Corona-Warn-App/src/main/res/drawable/grey_card_ripple.xml

diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_appconfig.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_appconfig.xml
index 3ee3624e0..6727ba483 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_appconfig.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_appconfig.xml
@@ -14,7 +14,7 @@
         android:paddingBottom="32dp">
 
         <LinearLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -74,7 +74,7 @@
         </LinearLayout>
 
         <LinearLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -93,7 +93,7 @@
         </LinearLayout>
 
         <LinearLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -109,4 +109,4 @@
         </LinearLayout>
 
     </LinearLayout>
-</androidx.core.widget.NestedScrollView>
\ No newline at end of file
+</androidx.core.widget.NestedScrollView>
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_contact_diary.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_contact_diary.xml
index 704e37bb5..248f44fa2 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_contact_diary.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_contact_diary.xml
@@ -15,7 +15,7 @@
         android:paddingBottom="32dp">
 
         <androidx.constraintlayout.widget.ConstraintLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -76,7 +76,7 @@
 
 
         <androidx.constraintlayout.widget.ConstraintLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny">
@@ -196,7 +196,7 @@
         </androidx.constraintlayout.widget.ConstraintLayout>
 
         <androidx.constraintlayout.widget.ConstraintLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny">
@@ -223,4 +223,4 @@
         </androidx.constraintlayout.widget.ConstraintLayout>
 
     </LinearLayout>
-</androidx.core.widget.NestedScrollView>
\ No newline at end of file
+</androidx.core.widget.NestedScrollView>
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_debugoptions.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_debugoptions.xml
index bd1eeb247..92afdbf89 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_debugoptions.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_debugoptions.xml
@@ -17,7 +17,7 @@
 
             <androidx.constraintlayout.widget.ConstraintLayout
                 android:id="@+id/debug_container"
-                style="@style/card"
+                style="@style/Card"
                 android:layout_margin="@dimen/spacing_tiny"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content">
@@ -57,7 +57,7 @@
 
             <androidx.constraintlayout.widget.ConstraintLayout
                 android:id="@+id/environment_container"
-                style="@style/card"
+                style="@style/Card"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_margin="@dimen/spacing_tiny">
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_deviceinfo.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_deviceinfo.xml
index f7d6edb92..4bdea42d3 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_deviceinfo.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_deviceinfo.xml
@@ -16,7 +16,7 @@
             android:orientation="vertical">
             <androidx.constraintlayout.widget.ConstraintLayout
                 android:id="@+id/gms_container"
-                style="@style/card"
+                style="@style/Card"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_margin="@dimen/spacing_tiny">
@@ -57,7 +57,7 @@
 
             <androidx.constraintlayout.widget.ConstraintLayout
                 android:id="@+id/tracing_container"
-                style="@style/card"
+                style="@style/Card"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_margin="@dimen/spacing_tiny">
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_keydownload.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_keydownload.xml
index 7c160bde7..8140fa2cb 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_keydownload.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_keydownload.xml
@@ -15,7 +15,7 @@
         android:paddingBottom="32dp">
 
         <androidx.constraintlayout.widget.ConstraintLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -85,4 +85,4 @@
             android:layout_height="match_parent" />
 
     </LinearLayout>
-</androidx.core.widget.NestedScrollView>
\ No newline at end of file
+</androidx.core.widget.NestedScrollView>
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_risk_level_calculation.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_risk_level_calculation.xml
index 53f6d063c..d91080a77 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_risk_level_calculation.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_risk_level_calculation.xml
@@ -16,7 +16,7 @@
 
             <LinearLayout
                 android:id="@+id/environment_container"
-                style="@style/card"
+                style="@style/Card"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:orientation="vertical">
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_submission.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_submission.xml
index e7ee015db..2bcf0b827 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_submission.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_submission.xml
@@ -15,7 +15,7 @@
         android:paddingBottom="32dp">
 
         <androidx.constraintlayout.widget.ConstraintLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -67,7 +67,7 @@
 
         <androidx.constraintlayout.widget.ConstraintLayout
             android:id="@+id/tek_history"
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny">
@@ -140,4 +140,4 @@
         </androidx.constraintlayout.widget.ConstraintLayout>
 
     </LinearLayout>
-</androidx.core.widget.NestedScrollView>
\ No newline at end of file
+</androidx.core.widget.NestedScrollView>
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_task_controller.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_task_controller.xml
index 78caeca3b..190f14bca 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_task_controller.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/fragment_test_task_controller.xml
@@ -15,7 +15,7 @@
         android:orientation="vertical">
 
         <LinearLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -40,7 +40,7 @@
         </LinearLayout>
 
         <androidx.constraintlayout.widget.ConstraintLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -92,7 +92,7 @@
             android:layout_height="wrap_content" />
 
         <LinearLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -115,4 +115,4 @@
         </LinearLayout>
 
     </LinearLayout>
-</androidx.core.widget.NestedScrollView>
\ No newline at end of file
+</androidx.core.widget.NestedScrollView>
diff --git a/Corona-Warn-App/src/deviceForTesters/res/layout/view_crashreport_list_item.xml b/Corona-Warn-App/src/deviceForTesters/res/layout/view_crashreport_list_item.xml
index f1dac5d2e..a301fc4ec 100644
--- a/Corona-Warn-App/src/deviceForTesters/res/layout/view_crashreport_list_item.xml
+++ b/Corona-Warn-App/src/deviceForTesters/res/layout/view_crashreport_list_item.xml
@@ -25,7 +25,7 @@
         android:paddingBottom="2dp">
 
         <androidx.constraintlayout.widget.ConstraintLayout
-            style="@style/card"
+            style="@style/Card"
             android:layout_width="390dp"
             android:layout_height="wrap_content"
             android:layout_margin="@dimen/spacing_tiny"
@@ -71,4 +71,4 @@
 
         </androidx.constraintlayout.widget.ConstraintLayout>
     </LinearLayout>
-</layout>
\ No newline at end of file
+</layout>
diff --git a/Corona-Warn-App/src/main/res/drawable/grey_card_ripple.xml b/Corona-Warn-App/src/main/res/drawable/grey_card_ripple.xml
new file mode 100644
index 000000000..cf1bad719
--- /dev/null
+++ b/Corona-Warn-App/src/main/res/drawable/grey_card_ripple.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    android:color="?android:attr/colorControlHighlight">
+    <item android:id="@android:id/mask">
+        <shape android:shape="rectangle">
+            <solid android:color="@color/colorSurface2Pressed" />
+            <corners android:radius="@dimen/radius_card" />
+        </shape>
+    </item>
+    <item>
+        <shape android:shape="rectangle">
+            <corners android:radius="@dimen/radius_card" />
+            <solid android:color="@color/colorSurface2" />
+        </shape>
+    </item>
+</ripple>
diff --git a/Corona-Warn-App/src/main/res/layout/contact_diary_privacy_card.xml b/Corona-Warn-App/src/main/res/layout/contact_diary_privacy_card.xml
index 5494b6376..3d9a24832 100644
--- a/Corona-Warn-App/src/main/res/layout/contact_diary_privacy_card.xml
+++ b/Corona-Warn-App/src/main/res/layout/contact_diary_privacy_card.xml
@@ -4,7 +4,7 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/contact_diary_privacy_card"
-        style="@style/cardGrey"
+        style="@style/GreyCard"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="@dimen/spacing_normal"
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_submission_dispatcher.xml b/Corona-Warn-App/src/main/res/layout/fragment_submission_dispatcher.xml
index 186e1d64d..218e14261 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_submission_dispatcher.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_submission_dispatcher.xml
@@ -85,7 +85,6 @@
                     app:layout_constraintStart_toStartOf="@+id/guideline_card_start"
                     app:layout_constraintTop_toBottomOf="@+id/submission_dispatcher_needs_testing_text" />
 
-
                 <TextView
                     android:id="@+id/submission_dispatcher_already_positive_text"
                     style="@style/headline6"
diff --git a/Corona-Warn-App/src/main/res/layout/include_16_years.xml b/Corona-Warn-App/src/main/res/layout/include_16_years.xml
index 005f767b1..1019f8d92 100644
--- a/Corona-Warn-App/src/main/res/layout/include_16_years.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_16_years.xml
@@ -4,7 +4,7 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/sixteen_years"
-        style="@style/card"
+        style="@style/Card"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_margin="@dimen/spacing_small"
@@ -40,4 +40,4 @@
             app:layout_constraintTop_toBottomOf="@+id/sixteen_years_headline" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
-</layout>
\ No newline at end of file
+</layout>
diff --git a/Corona-Warn-App/src/main/res/layout/include_dispatcher_card.xml b/Corona-Warn-App/src/main/res/layout/include_dispatcher_card.xml
index 8c05e3387..c5da5315d 100644
--- a/Corona-Warn-App/src/main/res/layout/include_dispatcher_card.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_dispatcher_card.xml
@@ -22,8 +22,7 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/dispatcher_card"
-        style="@style/cardGrey"
-        android:foreground="?selectableItemBackground"
+        style="@style/GreyCard.Ripple"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:focusable="true"
diff --git a/Corona-Warn-App/src/main/res/layout/include_privacy_card.xml b/Corona-Warn-App/src/main/res/layout/include_privacy_card.xml
index 7b45ae304..b9679f833 100644
--- a/Corona-Warn-App/src/main/res/layout/include_privacy_card.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_privacy_card.xml
@@ -4,7 +4,7 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/privacy_card"
-        style="@style/cardGrey"
+        style="@style/GreyCard"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="@dimen/spacing_normal"
@@ -35,4 +35,4 @@
             app:layout_constraintTop_toBottomOf="@+id/privacy_card_title" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
-</layout>
\ No newline at end of file
+</layout>
diff --git a/Corona-Warn-App/src/main/res/layout/include_privacy_card_no_consent.xml b/Corona-Warn-App/src/main/res/layout/include_privacy_card_no_consent.xml
index caba912eb..7fc079167 100644
--- a/Corona-Warn-App/src/main/res/layout/include_privacy_card_no_consent.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_privacy_card_no_consent.xml
@@ -4,7 +4,7 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/privacy_card"
-        style="@style/cardGrey"
+        style="@style/GreyCard"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="@dimen/spacing_normal"
@@ -61,4 +61,4 @@
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 
-</layout>
\ No newline at end of file
+</layout>
diff --git a/Corona-Warn-App/src/main/res/layout/include_submission_consent_body.xml b/Corona-Warn-App/src/main/res/layout/include_submission_consent_body.xml
index 1923dfa18..1575d3be9 100644
--- a/Corona-Warn-App/src/main/res/layout/include_submission_consent_body.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_submission_consent_body.xml
@@ -16,7 +16,7 @@
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="@id/submission_consent_your_consent_subsection_headline"
         app:layout_constraintBottom_toBottomOf="@id/submission_consent_your_consent_subsection_third_point"
-        style="@style/cardGrey" />
+        style="@style/GreyCard" />
 
     <TextView
         android:id="@+id/submission_consent_your_consent_subsection_headline"
diff --git a/Corona-Warn-App/src/main/res/layout/include_submission_country_no_selection.xml b/Corona-Warn-App/src/main/res/layout/include_submission_country_no_selection.xml
index d09131213..f1738b390 100644
--- a/Corona-Warn-App/src/main/res/layout/include_submission_country_no_selection.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_submission_country_no_selection.xml
@@ -13,7 +13,7 @@
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/submission_country_no_selection_container"
-        style="@style/cardGrey"
+        style="@style/GreyCard"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:backgroundTint="@{FormatterSubmissionHelper.formatCountrySelectCardColor(active)}"
@@ -36,4 +36,4 @@
         <include layout="@layout/merge_guidelines_side" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
-</layout>
\ No newline at end of file
+</layout>
diff --git a/Corona-Warn-App/src/main/res/layout/include_submission_country_selector.xml b/Corona-Warn-App/src/main/res/layout/include_submission_country_selector.xml
index b6ad8ae72..b083159cb 100644
--- a/Corona-Warn-App/src/main/res/layout/include_submission_country_selector.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_submission_country_selector.xml
@@ -21,7 +21,7 @@
     </data>
 
     <androidx.constraintlayout.widget.ConstraintLayout
-        style="@style/cardGrey"
+        style="@style/GreyCard"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:backgroundTint="@{FormatterSubmissionHelper.formatCountrySelectCardColor(active)}"
@@ -58,4 +58,4 @@
         <include layout="@layout/merge_guidelines_side" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
-</layout>
\ No newline at end of file
+</layout>
diff --git a/Corona-Warn-App/src/main/res/values/styles.xml b/Corona-Warn-App/src/main/res/values/styles.xml
index c275b3fc1..e1dfb4901 100644
--- a/Corona-Warn-App/src/main/res/values/styles.xml
+++ b/Corona-Warn-App/src/main/res/values/styles.xml
@@ -175,16 +175,26 @@
     <!-- ####################################
                     Card
     ###################################### -->
-    <style name="card">
+    <style name="Card">
         <item name="android:padding">@dimen/card_padding</item>
         <item name="android:background">@drawable/card</item>
         <item name="android:elevation">@dimen/elevation_strong</item>
     </style>
 
-    <style name="cardNoPadding" parent="card">
+    <style name="Card.NoPadding">
         <item name="android:padding">@dimen/no_padding</item>
     </style>
 
+    <style name="GreyCard" parent="Card.NoPadding">
+        <item name="android:tint">@color/card_dark</item>
+        <item name="android:elevation">0dp</item>
+        <item name="android:backgroundTint">@color/colorSurface2</item>
+    </style>
+
+    <style name="GreyCard.Ripple">
+        <item name="android:background">@drawable/grey_card_ripple</item>
+    </style>
+
     <style name="cardTracing">
         <item name="android:padding">@dimen/card_padding</item>
         <item name="android:background">@drawable/card</item>
@@ -208,12 +218,6 @@
         <item name="android:background">@drawable/card</item>
     </style>
 
-    <style name="cardGrey" parent="cardNoPadding">
-        <item name="android:tint">@color/card_dark</item>
-        <item name="android:elevation">0dp</item>
-        <item name="android:backgroundTint">@color/colorSurface2</item>
-    </style>
-
     <!-- ####################################
             Grey Body Background
     ###################################### -->
-- 
GitLab