From b9760a0b63b3179d290cb9c85fff9061fd56c891 Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Fri, 4 May 2018 18:57:42 +0200
Subject: [PATCH] Improve rendering of shadow for chatline

Signed-off-by: Janne Koschinski <janne@kuschku.de>
---
 app/src/main/res/layout-land/layout_main.xml  | 19 +++++++++++++++----
 .../res/layout-sw600dp-land/layout_main.xml   | 19 +++++++++++++++----
 app/src/main/res/layout/layout_main.xml       | 19 +++++++++++++++----
 app/src/main/res/values/dimens.xml            |  2 ++
 4 files changed, 47 insertions(+), 12 deletions(-)

diff --git a/app/src/main/res/layout-land/layout_main.xml b/app/src/main/res/layout-land/layout_main.xml
index fe0645113..839ab2728 100644
--- a/app/src/main/res/layout-land/layout_main.xml
+++ b/app/src/main/res/layout-land/layout_main.xml
@@ -51,11 +51,22 @@
       tools:listitem="@layout/widget_nick" />
   </android.support.design.widget.CoordinatorLayout>
 
-  <de.kuschku.quasseldroid.util.ui.ShadowView
+  <LinearLayout
     android:layout_width="match_parent"
-    android:layout_height="16dp"
-    android:gravity="bottom"
-    app:layout_anchor="@id/fragment_chatline" />
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    app:layout_anchor="@id/fragment_chatline"
+    app:layout_anchorGravity="top">
+
+    <de.kuschku.quasseldroid.util.ui.ShadowView
+      android:layout_width="match_parent"
+      android:layout_height="@dimen/shadow_height"
+      android:gravity="bottom" />
+
+    <Space
+      android:layout_width="match_parent"
+      android:layout_height="@dimen/shadow_height" />
+  </LinearLayout>
 
   <fragment
     android:id="@+id/fragment_chatline"
diff --git a/app/src/main/res/layout-sw600dp-land/layout_main.xml b/app/src/main/res/layout-sw600dp-land/layout_main.xml
index 1e0c0825b..675b648f5 100644
--- a/app/src/main/res/layout-sw600dp-land/layout_main.xml
+++ b/app/src/main/res/layout-sw600dp-land/layout_main.xml
@@ -49,11 +49,22 @@
         tools:listitem="@layout/widget_nick" />
     </android.support.design.widget.CoordinatorLayout>
 
-    <de.kuschku.quasseldroid.util.ui.ShadowView
+    <LinearLayout
       android:layout_width="match_parent"
-      android:layout_height="16dp"
-      android:gravity="bottom"
-      app:layout_anchor="@id/fragment_chatline" />
+      android:layout_height="wrap_content"
+      android:orientation="vertical"
+      app:layout_anchor="@id/fragment_chatline"
+      app:layout_anchorGravity="top">
+
+      <de.kuschku.quasseldroid.util.ui.ShadowView
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/shadow_height"
+        android:gravity="bottom" />
+
+      <Space
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/shadow_height" />
+    </LinearLayout>
 
     <fragment
       android:id="@+id/fragment_chatline"
diff --git a/app/src/main/res/layout/layout_main.xml b/app/src/main/res/layout/layout_main.xml
index 542176b9e..abf1a11d4 100644
--- a/app/src/main/res/layout/layout_main.xml
+++ b/app/src/main/res/layout/layout_main.xml
@@ -56,11 +56,22 @@
         tools:listitem="@layout/widget_nick" />
     </android.support.design.widget.CoordinatorLayout>
 
-    <de.kuschku.quasseldroid.util.ui.ShadowView
+    <LinearLayout
       android:layout_width="match_parent"
-      android:layout_height="16dp"
-      android:gravity="bottom"
-      app:layout_anchor="@id/fragment_chatline" />
+      android:layout_height="wrap_content"
+      android:orientation="vertical"
+      app:layout_anchor="@id/fragment_chatline"
+      app:layout_anchorGravity="top">
+
+      <de.kuschku.quasseldroid.util.ui.ShadowView
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/shadow_height"
+        android:gravity="bottom" />
+
+      <Space
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/shadow_height" />
+    </LinearLayout>
 
     <fragment
       android:id="@+id/fragment_chatline"
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 234c5282c..b27240fb9 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -32,6 +32,8 @@
 
   <dimen name="button_corner_radius">2dp</dimen>
 
+  <dimen name="shadow_height">4dp</dimen>
+
   <dimen name="colorchooser_circlesize">56dp</dimen>
   <dimen name="avatar_size">35sp</dimen>
 
-- 
GitLab