From e04ec17272438f22e984e557b2bbc7fbdd4a4859 Mon Sep 17 00:00:00 2001 From: Pierre Date: Tue, 19 Dec 2017 19:18:33 +0100 Subject: [PATCH] Improved views layout --- .../ConversationMessageAdapter.java | 45 +++++++++++++++ .../main/res/layout/fragment_conversation.xml | 4 +- .../fragment_conversation_message_item.xml | 57 ++++++++++++------- 3 files changed, 83 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessageAdapter.java b/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessageAdapter.java index 1b88d2b..07cda97 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessageAdapter.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/conversations/ConversationMessageAdapter.java @@ -4,6 +4,7 @@ import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.ArrayMap; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -75,6 +76,12 @@ public class ConversationMessageAdapter extends ArrayAdapter 0){ + previousMessage = getItem(position-1); + } + /* Get the view of the messages @@ -82,29 +89,38 @@ public class ConversationMessageAdapter extends ArrayAdapter + android:layout_weight="1" + android:divider="@null" + /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_conversation_message_item.xml b/app/src/main/res/layout/fragment_conversation_message_item.xml index 3d03447..ceb41b0 100644 --- a/app/src/main/res/layout/fragment_conversation_message_item.xml +++ b/app/src/main/res/layout/fragment_conversation_message_item.xml @@ -10,34 +10,48 @@ android:paddingTop="5dp"> - - - + android:orientation="vertical"> + tools:text="User name" /> - + + + + + + + + + - + tools:text="A message" />