From d6b0f6b3129d58f5b1b10817582cbe951e904a4f Mon Sep 17 00:00:00 2001
From: Chilja Gossow <49635654+chiljamgossow@users.noreply.github.com>
Date: Fri, 4 Dec 2020 18:36:00 +0100
Subject: [PATCH] Adjusts dividers in country list view (EXPOSUREAPP-4126)
 (#1807)

Co-authored-by: harambasicluka <64483219+harambasicluka@users.noreply.github.com>
---
 .../coronawarnapp/ui/view/CountryListView.kt  |  8 ++++---
 ...sion_no_consent_positive_other_warning.xml |  4 ++--
 ..._list_participating_countries_overview.xml |  4 ++--
 ...view_country_list_entry_flag_container.xml | 21 ++++++++-----------
 4 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/view/CountryListView.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/view/CountryListView.kt
index 38163a84e..e27696ad3 100644
--- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/view/CountryListView.kt
+++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/view/CountryListView.kt
@@ -20,7 +20,7 @@ class CountryListView(context: Context, attrs: AttributeSet) : LinearLayout(cont
     private val grid: RecyclerView
     private val countryNames: TextView
 
-    var countries: List<Country> = emptyList()
+    var countries: List<Country> = defaultCountryList
         set(value) {
             field = value.also { countries ->
                 adapterCountryFlags.countryList = countries
@@ -41,7 +41,7 @@ class CountryListView(context: Context, attrs: AttributeSet) : LinearLayout(cont
 
     // Helper to allow for null in data binding
     fun setCountryList(countries: List<Country>?) {
-        this.countries = countries ?: emptyList()
+        this.countries = countries ?: defaultCountryList
     }
 
     companion object {
@@ -51,7 +51,7 @@ class CountryListView(context: Context, attrs: AttributeSet) : LinearLayout(cont
 
 private class CountryFlagsAdapter : BaseAdapter<CountryFlagViewHolder>() {
 
-    var countryList: List<Country> = emptyList()
+    var countryList: List<Country> = defaultCountryList
         set(value) {
             field = value
             notifyDataSetChanged()
@@ -76,3 +76,5 @@ private class CountryFlagsAdapter : BaseAdapter<CountryFlagViewHolder>() {
         }
     }
 }
+
+private val defaultCountryList = listOf(Country.DE)
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_submission_no_consent_positive_other_warning.xml b/Corona-Warn-App/src/main/res/layout/fragment_submission_no_consent_positive_other_warning.xml
index c8ba6938c..13c778375 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_submission_no_consent_positive_other_warning.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_submission_no_consent_positive_other_warning.xml
@@ -98,7 +98,7 @@
                     android:id="@+id/countryList"
                     android:layout_width="@dimen/match_constraint"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="@dimen/spacing_tiny"
+                    android:layout_marginTop="@dimen/spacing_normal"
                     app:layout_constraintEnd_toEndOf="@+id/guideline_end"
                     app:layout_constraintStart_toStartOf="@+id/guideline_start"
                     app:layout_constraintTop_toBottomOf="@+id/submission_positive_other_warning_text_second_part" />
@@ -108,7 +108,7 @@
                     layout="@layout/include_privacy_card_no_consent"
                     android:layout_width="@dimen/match_constraint"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="@dimen/spacing_small"
+                    android:layout_marginTop="@dimen/spacing_normal"
                     app:layout_constraintEnd_toStartOf="@+id/guideline_card_end"
                     app:layout_constraintStart_toStartOf="@+id/guideline_card_start"
                     app:layout_constraintTop_toBottomOf="@+id/countryList" />
diff --git a/Corona-Warn-App/src/main/res/layout/include_interop_list_participating_countries_overview.xml b/Corona-Warn-App/src/main/res/layout/include_interop_list_participating_countries_overview.xml
index 6ecf73f51..15ca518b3 100644
--- a/Corona-Warn-App/src/main/res/layout/include_interop_list_participating_countries_overview.xml
+++ b/Corona-Warn-App/src/main/res/layout/include_interop_list_participating_countries_overview.xml
@@ -44,7 +44,7 @@
             android:id="@+id/countryList"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="@dimen/spacing_tiny"
+            android:layout_marginTop="@dimen/spacing_normal"
             app:countryList="@{countryData}"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
@@ -64,4 +64,4 @@
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 
-</layout>
\ No newline at end of file
+</layout>
diff --git a/Corona-Warn-App/src/main/res/layout/view_country_list_entry_flag_container.xml b/Corona-Warn-App/src/main/res/layout/view_country_list_entry_flag_container.xml
index 1d1e7b16c..d29b2dd62 100644
--- a/Corona-Warn-App/src/main/res/layout/view_country_list_entry_flag_container.xml
+++ b/Corona-Warn-App/src/main/res/layout/view_country_list_entry_flag_container.xml
@@ -3,32 +3,29 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:layout_marginTop="8dp"
-    android:layout_marginBottom="8dp"
     android:orientation="vertical">
 
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="2dp"
+        android:layout_marginBottom="@dimen/spacing_tiny"
+        android:background="@color/colorHairline" />
+
     <androidx.recyclerview.widget.RecyclerView
         android:id="@+id/flagGrid"
         android:layout_width="match_parent"
         android:layout_height="wrap_content" />
 
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="3dp"
-        android:layout_marginTop="@dimen/spacing_small"
-        android:background="@color/colorHairline" />
-
     <TextView
         android:id="@+id/country_list_entry_label"
         style="@style/subtitle"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="8dp"
-        android:layout_marginBottom="8dp"
+        android:layout_marginVertical="@dimen/spacing_tiny"
         tools:text="Deutschland, Frankreich" />
 
     <View
         android:layout_width="match_parent"
-        android:layout_height="3dp"
+        android:layout_height="2dp"
         android:background="@color/colorHairline" />
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
-- 
GitLab