From 7732282bfb955cb1c92379317c13756b0d2a19a0 Mon Sep 17 00:00:00 2001
From: fynngodau <fynngodau@mailbox.org>
Date: Wed, 28 Apr 2021 18:47:39 +0200
Subject: [PATCH] Replace spacing near scroll views with overscroll (COMMUNTIY)
 (#2884)

* Remove space below scrollers and add overscroll in app info screens

Note that this changes the total padding of the content in the debuglog
fragment from 20dp to 24dp for consistency within the layout.

* Remove spacing below scroll view and add overscroll to stats explanation

* Fix scrollbars

* Fix contact diary (edit places & locations) scroll behavior

* Remove space below scrollers and add overscroll in settings screens

* Undo changes to PPA more info fragment

This partially reverts commit 85e4650e12e27999a01a293695121cd324a7123f
to avoid conflicts with #2945.

* Fix Check In onboarding

Also changes margin of button to match that of contact journal
onboarding

* Uniform bottom paddings

Co-authored-by: harambasicluka <64483219+harambasicluka@users.noreply.github.com>
---
 .../layout/bugreporting_debuglog_fragment.xml |  3 +-
 .../contact_diary_edit_locations_fragment.xml |  6 +++-
 .../contact_diary_edit_persons_fragment.xml   |  6 +++-
 .../main/res/layout/fragment_information.xml  |  6 ++--
 .../res/layout/fragment_information_about.xml | 12 +++----
 .../layout/fragment_information_contact.xml   | 12 +++----
 .../res/layout/fragment_information_legal.xml | 13 +++-----
 .../layout/fragment_information_privacy.xml   |  4 ++-
 .../layout/fragment_information_technical.xml |  4 ++-
 .../src/main/res/layout/fragment_settings.xml | 12 +++----
 .../fragment_settings_background_priority.xml | 12 +++----
 .../fragment_settings_notifications.xml       | 12 +++----
 ..._settings_privacy_preserving_analytics.xml | 33 +++----------------
 .../fragment_statistics_explanation.xml       | 15 +++------
 .../fragment_trace_location_onboarding.xml    |  9 +++--
 15 files changed, 60 insertions(+), 99 deletions(-)

diff --git a/Corona-Warn-App/src/main/res/layout/bugreporting_debuglog_fragment.xml b/Corona-Warn-App/src/main/res/layout/bugreporting_debuglog_fragment.xml
index 2277fe672..dc52ad183 100644
--- a/Corona-Warn-App/src/main/res/layout/bugreporting_debuglog_fragment.xml
+++ b/Corona-Warn-App/src/main/res/layout/bugreporting_debuglog_fragment.xml
@@ -22,9 +22,8 @@
         android:id="@+id/scrollview"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_marginBottom="12dp"
         android:clipToPadding="false"
-        android:paddingBottom="8dp"
+        android:paddingBottom="@dimen/spacing_normal"
         app:layout_constraintBottom_toTopOf="@id/log_control_container"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
diff --git a/Corona-Warn-App/src/main/res/layout/contact_diary_edit_locations_fragment.xml b/Corona-Warn-App/src/main/res/layout/contact_diary_edit_locations_fragment.xml
index f849d27ac..72bfa1700 100644
--- a/Corona-Warn-App/src/main/res/layout/contact_diary_edit_locations_fragment.xml
+++ b/Corona-Warn-App/src/main/res/layout/contact_diary_edit_locations_fragment.xml
@@ -58,7 +58,11 @@
             android:id="@+id/locations_recycler_view"
             android:layout_width="0dp"
             android:layout_height="0dp"
-            android:layout_margin="@dimen/spacing_normal"
+            android:layout_marginBottom="@dimen/spacing_normal"
+            android:paddingTop="@dimen/spacing_normal"
+            android:paddingHorizontal="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
             android:importantForAccessibility="no"
             android:scrollbars="vertical"
             app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
diff --git a/Corona-Warn-App/src/main/res/layout/contact_diary_edit_persons_fragment.xml b/Corona-Warn-App/src/main/res/layout/contact_diary_edit_persons_fragment.xml
index b49af4222..e58bf18b2 100644
--- a/Corona-Warn-App/src/main/res/layout/contact_diary_edit_persons_fragment.xml
+++ b/Corona-Warn-App/src/main/res/layout/contact_diary_edit_persons_fragment.xml
@@ -57,7 +57,11 @@
             android:id="@+id/persons_recycler_view"
             android:layout_width="0dp"
             android:layout_height="0dp"
-            android:layout_margin="@dimen/spacing_normal"
+            android:layout_marginBottom="@dimen/spacing_normal"
+            android:paddingTop="@dimen/spacing_normal"
+            android:paddingHorizontal="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
             android:importantForAccessibility="no"
             android:scrollbars="vertical"
             app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_information.xml b/Corona-Warn-App/src/main/res/layout/fragment_information.xml
index 25dfed9ca..1fd3284d9 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_information.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_information.xml
@@ -26,8 +26,10 @@
             android:layout_width="match_parent"
             android:layout_height="0dp"
             android:fillViewport="true"
-            android:layout_marginTop="@dimen/spacing_normal"
-            android:layout_marginBottom="@dimen/spacing_normal"
+            android:paddingTop="@dimen/spacing_normal"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
             app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_information_about.xml b/Corona-Warn-App/src/main/res/layout/fragment_information_about.xml
index 5d5c89cfd..cbc670c87 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_information_about.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_information_about.xml
@@ -24,7 +24,10 @@
             android:layout_width="0dp"
             android:layout_height="0dp"
             android:fillViewport="true"
-            app:layout_constraintBottom_toBottomOf="@+id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/information_about_header">
@@ -103,13 +106,6 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/guideline_bottom" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </layout>
\ No newline at end of file
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_information_contact.xml b/Corona-Warn-App/src/main/res/layout/fragment_information_contact.xml
index 75163b421..968aa88b3 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_information_contact.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_information_contact.xml
@@ -24,7 +24,10 @@
             android:layout_width="0dp"
             android:layout_height="0dp"
             android:fillViewport="true"
-            app:layout_constraintBottom_toBottomOf="@+id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/information_contact_header">
@@ -152,13 +155,6 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/guideline_bottom" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </layout>
\ No newline at end of file
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_information_legal.xml b/Corona-Warn-App/src/main/res/layout/fragment_information_legal.xml
index acc309aed..620ef558a 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_information_legal.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_information_legal.xml
@@ -31,9 +31,11 @@
         <ScrollView
             android:layout_width="0dp"
             android:layout_height="0dp"
-            android:fillViewport="true"
             android:focusable="true"
-            app:layout_constraintBottom_toBottomOf="@+id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/information_legal_header">
@@ -155,13 +157,6 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/guideline_bottom" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </layout>
\ No newline at end of file
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_information_privacy.xml b/Corona-Warn-App/src/main/res/layout/fragment_information_privacy.xml
index dd56b2ae0..3fa267962 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_information_privacy.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_information_privacy.xml
@@ -30,7 +30,9 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:fillViewport="true"
-            android:paddingBottom="@dimen/guideline_bottom">
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay">
 
             <include
                 android:id="@+id/information_privacy_header_details"
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_information_technical.xml b/Corona-Warn-App/src/main/res/layout/fragment_information_technical.xml
index 2cbf8db7f..2d648ab3d 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_information_technical.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_information_technical.xml
@@ -30,7 +30,9 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:fillViewport="true"
-            android:paddingBottom="@dimen/guideline_bottom">
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay">
 
             <include
                 android:id="@+id/information_technical_header_details"
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_settings.xml b/Corona-Warn-App/src/main/res/layout/fragment_settings.xml
index e80f31e3e..48388cf27 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_settings.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_settings.xml
@@ -43,7 +43,10 @@
             android:layout_width="0dp"
             android:layout_height="0dp"
             android:fillViewport="true"
-            app:layout_constraintBottom_toBottomOf="@+id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/settings_header">
@@ -158,13 +161,6 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/guideline_bottom" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </layout>
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_settings_background_priority.xml b/Corona-Warn-App/src/main/res/layout/fragment_settings_background_priority.xml
index cb4c41011..b3a12bb19 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_settings_background_priority.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_settings_background_priority.xml
@@ -31,7 +31,10 @@
             android:layout_width="0dp"
             android:layout_height="0dp"
             android:fillViewport="true"
-            app:layout_constraintBottom_toBottomOf="@+id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/settings_background_priority_header">
@@ -120,13 +123,6 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/guideline_bottom" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </layout>
\ No newline at end of file
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_settings_notifications.xml b/Corona-Warn-App/src/main/res/layout/fragment_settings_notifications.xml
index f2a5f0f15..f97962270 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_settings_notifications.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_settings_notifications.xml
@@ -32,7 +32,10 @@
             android:layout_width="0dp"
             android:layout_height="0dp"
             android:fillViewport="true"
-            app:layout_constraintBottom_toBottomOf="@+id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/settings_notifications_header">
@@ -120,13 +123,6 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/guideline_bottom" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 
 </layout>
\ No newline at end of file
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_settings_privacy_preserving_analytics.xml b/Corona-Warn-App/src/main/res/layout/fragment_settings_privacy_preserving_analytics.xml
index 21731d367..b158a7869 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_settings_privacy_preserving_analytics.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_settings_privacy_preserving_analytics.xml
@@ -27,7 +27,10 @@
             android:id="@+id/scrollview"
             android:layout_width="0dp"
             android:layout_height="0dp"
-            app:layout_constraintBottom_toTopOf="@+id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@id/settings_ppa_header">
@@ -377,33 +380,5 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@id/guideline_top"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_begin="@dimen/guideline_top" />
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/spacing_small" />
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@id/guideline_start"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            app:layout_constraintGuide_begin="@dimen/guideline_start" />
-
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@id/guideline_end"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical"
-            app:layout_constraintGuide_end="@dimen/guideline_end" />
-
     </androidx.constraintlayout.widget.ConstraintLayout>
 </layout>
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_statistics_explanation.xml b/Corona-Warn-App/src/main/res/layout/fragment_statistics_explanation.xml
index 3a7715815..082aa18e1 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_statistics_explanation.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_statistics_explanation.xml
@@ -93,7 +93,10 @@
         <ScrollView
             android:layout_width="0dp"
             android:layout_height="0dp"
-            app:layout_constraintBottom_toBottomOf="@id/guideline_bottom"
+            android:paddingBottom="@dimen/spacing_normal"
+            android:clipToPadding="false"
+            android:scrollbarStyle="outsideOverlay"
+            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintHorizontal_bias="1.0"
             app:layout_constraintStart_toStartOf="parent"
@@ -426,9 +429,8 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_marginStart="@dimen/guideline_start"
-                    android:layout_marginTop="24dp"
+                    android:layout_marginTop="@dimen/spacing_normal"
                     android:layout_marginEnd="@dimen/guideline_end"
-                    android:layout_marginBottom="23dp"
                     android:contentDescription="@string/statistics_explanation_trend_description"
                     android:focusable="true"
                     android:text="@string/statistics_explanation_trend_description" />
@@ -437,13 +439,6 @@
 
         </ScrollView>
 
-        <androidx.constraintlayout.widget.Guideline
-            android:id="@+id/guideline_bottom"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            app:layout_constraintGuide_end="@dimen/guideline_bottom" />
-
         <include layout="@layout/merge_guidelines_side" />
 
     </androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/Corona-Warn-App/src/main/res/layout/fragment_trace_location_onboarding.xml b/Corona-Warn-App/src/main/res/layout/fragment_trace_location_onboarding.xml
index fd7e77dd2..d86a5a7de 100644
--- a/Corona-Warn-App/src/main/res/layout/fragment_trace_location_onboarding.xml
+++ b/Corona-Warn-App/src/main/res/layout/fragment_trace_location_onboarding.xml
@@ -20,9 +20,10 @@
         style="@style/buttonPrimary"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginHorizontal="24dp"
-        android:layout_marginBottom="24dp"
+        android:layout_marginHorizontal="@dimen/spacing_normal"
+        android:layout_marginVertical="@dimen/spacing_small"
         android:text="@string/trace_location_onboarding_body_confirm"
+        app:layout_constraintTop_toBottomOf="@id/check_in_onboarding_scroll_view"
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent" />
@@ -31,7 +32,9 @@
         android:id="@+id/check_in_onboarding_scroll_view"
         android:layout_width="match_parent"
         android:layout_height="0dp"
-        android:layout_marginBottom="20dp"
+        android:paddingBottom="@dimen/spacing_small"
+        android:clipToPadding="false"
+        android:scrollbarStyle="outsideOverlay"
         app:layout_constraintBottom_toTopOf="@+id/check_in_onboarding_acknowledge"
         app:layout_constraintTop_toBottomOf="@id/check_in_onboarding_toolbar">
 
-- 
GitLab