Commit a1a92fa5 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Add more dump data to be able to show the scrolling effect on chat list screen.

parent 9590ac94
......@@ -20,7 +20,7 @@ class ChatListFragment : Fragment() {
showChatList(createDumpData())
}
// This is just a sample showing 6 chat rooms (aka user subscription). We need to get it rid in a real word. REMARK: remove this comment and this method.
// This is just a sample showing 8 chat rooms (aka user subscription). We need to get it rid in a real word. REMARK: remove this comment and this method.
private fun createDumpData(): List<Chat> {
val dumpChat1 = Chat("https://open.rocket.chat/avatar/leonardo.aramaki",
"Leonardo Aramaki",
......@@ -64,9 +64,23 @@ class ChatListFragment : Fragment() {
"Yes @sttyru, but you'll need to implement from the ground up following the docs at docs.rocket.chat where you can see the REST (HTTP) and Real-Time (WebSockets) calls.",
LocalDateTime.of(2017, 11, 14,1, 3),
0)
val dumpChat7 = Chat("https://open.rocket.chat/avatar/bestrun",
"androidnativeapp-2",
"c",
null,
"Just downloaded .zip and imported into Android Studio then build the project.",
LocalDateTime.of(2017, 11, 4,12, 47),
0)
val dumpChat8 = Chat("https://open.rocket.chat/avatar/3djc",
"iosnativeapp",
"c",
null,
"Ok, got confused by the blog announcement that shows a screenshot with github oAuth ! Sorry !",
LocalDateTime.of(2017, 11, 4,12, 43),
0)
// creates a list of chat sorted by lastMessageDateTime attribute.
return listOf(dumpChat1, dumpChat2, dumpChat3, dumpChat4, dumpChat5, dumpChat6).sortedByDescending { chat -> chat.lastMessageDateTime }
return listOf(dumpChat1, dumpChat2, dumpChat3, dumpChat4, dumpChat5, dumpChat6, dumpChat7, dumpChat8).sortedByDescending { chat -> chat.lastMessageDateTime }
}
// REMARK: The presenter should call this method. The presenter also need to sort the chat list by latest message (compared by its date).
......
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