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
aa269d78
Commit
aa269d78
authored
Feb 14, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Show groupable messages."
parent
e207fa00
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
17 deletions
+2
-17
ChatRoomAdapter.kt
...n/java/chat/rocket/android/chatroom/ui/ChatRoomAdapter.kt
+2
-15
MessageViewModel.kt
...hat/rocket/android/chatroom/viewmodel/MessageViewModel.kt
+0
-2
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomAdapter.kt
View file @
aa269d78
...
...
@@ -36,8 +36,7 @@ class ChatRoomAdapter(private val roomType: String,
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
=
ViewHolder
(
parent
.
inflate
(
R
.
layout
.
item_message
),
roomType
,
roomName
,
presenter
)
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
=
holder
.
bind
(
dataSet
[
position
],
dataSet
.
getOrNull
(
position
+
1
))
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
=
holder
.
bind
(
dataSet
[
position
])
override
fun
getItemCount
():
Int
=
dataSet
.
size
...
...
@@ -78,21 +77,12 @@ class ChatRoomAdapter(private val roomType: String,
val
presenter
:
ChatRoomPresenter
)
:
RecyclerView
.
ViewHolder
(
itemView
),
MenuItem
.
OnMenuItemClickListener
{
private
lateinit
var
messageViewModel
:
MessageViewModel
fun
bind
(
message
:
MessageViewModel
,
nextMessage
:
MessageViewModel
?
)
=
with
(
itemView
)
{
fun
bind
(
message
:
MessageViewModel
)
=
with
(
itemView
)
{
messageViewModel
=
message
image_avatar
.
setImageURI
(
message
.
avatarUri
)
text_sender
.
text
=
message
.
senderName
text_message_time
.
content
=
message
.
time
if
(
nextMessage
!=
null
)
{
if
(
isSequential
(
message
,
nextMessage
))
{
image_avatar
.
setVisible
(
false
)
text_sender
.
setVisible
(
false
)
text_message_time
.
setVisible
(
false
)
}
}
text_content
.
content
=
message
.
content
text_content
.
movementMethod
=
LinkMovementMethod
()
bindAttachment
(
message
,
message_attachment
,
image_attachment
,
audio_video_attachment
,
file_name
)
...
...
@@ -136,9 +126,6 @@ class ChatRoomAdapter(private val roomType: String,
return
true
}
private
fun
isSequential
(
message
:
MessageViewModel
,
nextMessage
:
MessageViewModel
):
Boolean
=
(
message
.
isGroupable
&&
nextMessage
.
isGroupable
)
&&
(
message
.
senderId
==
nextMessage
.
senderId
)
private
fun
bindAttachment
(
message
:
MessageViewModel
,
attachment_container
:
View
,
image_attachment
:
SimpleDraweeView
,
...
...
app/src/main/java/chat/rocket/android/chatroom/viewmodel/MessageViewModel.kt
View file @
aa269d78
...
...
@@ -31,8 +31,6 @@ data class MessageViewModel(val context: Context,
private
val
localRepository
:
LocalRepository
,
private
val
currentServerRepository
:
CurrentServerRepository
)
{
val
id
:
String
=
message
.
id
val
isGroupable
=
message
.
groupable
val
senderId
=
message
.
sender
?.
id
val
avatarUri
:
String
?
val
roomId
:
String
=
message
.
roomId
val
time
:
CharSequence
...
...
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