Commit 09302e5f authored by pcforgeek's avatar pcforgeek

Fixed merge conflict and message layout

parent 16b3a106
...@@ -155,13 +155,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -155,13 +155,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
} }
override fun showMessages(dataSet: List<BaseViewModel<*>>) { override fun showMessages(dataSet: List<BaseViewModel<*>>) {
// track the message sent immediately after the current message
var prevMessageViewModel : MessageViewModel? = null
var prevMsgModel = dataSet[0] var prevMsgModel = dataSet[0]
//checking for all messages to assign true to the required showDayMaker //checking for all messages to assign true to the required showDayMaker
//Loop over received messages to determine first unread
for (i in dataSet.indices) { for (i in dataSet.indices) {
val msgModel = dataSet[i] val msgModel = dataSet[i]
if(i>0){ if(i>0){
...@@ -175,8 +171,15 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR ...@@ -175,8 +171,15 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
prevMsgModel.showDayMarker = true prevMsgModel.showDayMarker = true
} }
} }
}
if (msgModel is MessageViewModel){ // track the message sent immediately after the current message
var prevMessageViewModel : MessageViewModel? = null
//Loop over received messages to determine first unread
for (i in dataSet.indices) {
val msgModel = dataSet[i]
if (msgModel is MessageViewModel) {
val msg = msgModel.rawData val msg = msgModel.rawData
if (msg.timestamp < chatRoomLastSeen) { if (msg.timestamp < chatRoomLastSeen) {
// This message was sent before the last seen of the room. Hence, it was seen. // This message was sent before the last seen of the room. Hence, it was seen.
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toBottomOf="@+id/new_messages_notif">
<View <View
android:layout_width="0px" android:layout_width="0px"
...@@ -47,9 +47,8 @@ ...@@ -47,9 +47,8 @@
layout="@layout/avatar" layout="@layout/avatar"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_marginTop="5dp"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/new_messages_notif" /> app:layout_constraintTop_toTopOf="@+id/top_container" />
<LinearLayout <LinearLayout
android:id="@+id/new_messages_notif" android:id="@+id/new_messages_notif"
...@@ -81,7 +80,6 @@ ...@@ -81,7 +80,6 @@
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/new_messages_notif"
app:layout_constraintLeft_toRightOf="@+id/layout_avatar" app:layout_constraintLeft_toRightOf="@+id/layout_avatar"
app:layout_constraintTop_toBottomOf="@+id/day_marker_layout"> app:layout_constraintTop_toBottomOf="@+id/day_marker_layout">
...@@ -108,6 +106,7 @@ ...@@ -108,6 +106,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="@id/top_container" app:layout_constraintLeft_toLeftOf="@id/top_container"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintStart_toEndOf="@+id/layout_avatar" app:layout_constraintStart_toEndOf="@+id/layout_avatar"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment