Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
09302e5f
Commit
09302e5f
authored
Mar 13, 2018
by
pcforgeek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed merge conflict and message layout
parent
16b3a106
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+8
-5
item_message.xml
app/src/main/res/layout/item_message.xml
+3
-4
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
09302e5f
...
@@ -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.
...
...
app/src/main/res/layout/item_message.xml
View file @
09302e5f
...
@@ -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_to
TopOf=
"parent
"
>
app:layout_constraintTop_to
BottomOf=
"@+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_to
BottomOf=
"@id/new_messages_notif
"
/>
app:layout_constraintTop_to
TopOf=
"@+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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment