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
250d34cc
Commit
250d34cc
authored
Dec 08, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dump data.
parent
516bfb53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
MessageFragment.kt
.../java/chat/rocket/android/app/chatroom/MessageFragment.kt
+25
-0
No files found.
app/src/main/java/chat/rocket/android/app/chatroom/MessageFragment.kt
View file @
250d34cc
...
...
@@ -2,12 +2,37 @@ package chat.rocket.android.app.chatroom
import
android.app.Fragment
import
android.os.Bundle
import
android.support.v7.widget.LinearLayoutManager
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
chat.rocket.android.R
import
chat.rocket.android.app.User
import
kotlinx.android.synthetic.main.fragment_chat_list.*
import
org.threeten.bp.LocalDateTime
class
MessageFragment
:
Fragment
()
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
?,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
=
inflater
?.
inflate
(
R
.
layout
.
fragment_message
,
container
,
false
)
override
fun
onViewCreated
(
view
:
View
?,
savedInstanceState
:
Bundle
?)
{
super
.
onViewCreated
(
view
,
savedInstanceState
)
showMessageList
(
createDumpData
())
}
// This is just a sample showing 2 messages in the chat room. We need to get it rid in a real word. REMARK: remove this comment and this method.
private
fun
createDumpData
():
List
<
Message
>
{
val
user1
=
User
(
"1"
,
"Filipe Brito"
,
"filipe.brito"
,
"online"
,
"https://open.rocket.chat/avatar/filipe.brito"
)
val
user2
=
User
(
"2"
,
"Lucio Maciel"
,
"Lucio Maciel"
,
"busy"
,
"https://open.rocket.chat/avatar/lucio.maciel"
)
val
message1
=
Message
(
user1
,
"This is a multiline chat message from Bertie that will take more than just one line of text. I have sure that everything is amazing!"
,
LocalDateTime
.
now
())
val
message2
=
Message
(
user2
,
"Great!"
,
LocalDateTime
.
now
().
plusHours
(
1
))
return
listOf
(
message1
,
message2
)
}
// REMARK: The presenter should call this method.
private
fun
showMessageList
(
dataSet
:
List
<
Message
>)
{
recycler_view
.
layoutManager
=
LinearLayoutManager
(
activity
.
applicationContext
,
LinearLayoutManager
.
VERTICAL
,
false
)
recycler_view
.
adapter
=
MessageListAdapter
(
dataSet
.
toMutableList
())
}
}
\ No newline at end of file
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