Commit 4aafc216 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update dump date.

parent 9f1ce5b9
......@@ -9,6 +9,7 @@ import android.view.View
import android.view.ViewGroup
import chat.rocket.android.R
import kotlinx.android.synthetic.main.fragment_chat_list.*
import org.threeten.bp.LocalDateTime
/**
* @author Filipe de Lima Brito (filipedelimabrito@gmail.com)
......@@ -22,18 +23,54 @@ class ChatListFragment : Fragment() {
showChatList(createDumpData())
}
// 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.
// 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.
private fun createDumpData(): MutableList<Chat> {
val dumpChat1 = Chat("https://open.rocket.chat/avatar/filipe.brito", "Filipe Brito", "d", "online", "Type something...Type something...Type something", "11:45", 150)
val dumpChat2 = Chat("https://open.rocket.chat/avatar/leonardo.aramaki", "Leonardo Aramaki", "d", "busy", "Type something", "11:44", 1)
val dumpChat3 = Chat("https://open.rocket.chat/avatar/lucio.maciel", "Lucio Maciel", "d", "away", "Type something", "11:40", 0)
val dumpChat4 = Chat("https://open.rocket.chat/avatar/sing.li", "mobile-internal", "p", null, "@aaron.ogle @rafael.kellermann same problem over here. Although all the servers show up on the selection.", "11:40", 0)
val dumpChat5 = Chat("https://open.rocket.chat/avatar/matheus.cardoso", "androidnativeapp", "c", null, "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.", "11:40", 0)
val dumpChat6 = Chat("https://open.rocket.chat/avatar/hetal", "general", "c", null, "Has joined the channel.", "11:40", 0)
val dumpChat1 = Chat("https://open.rocket.chat/avatar/filipe.brito",
"Filipe Brito",
"d",
"online",
"Type something...Type something...Type something",
LocalDateTime.of(2017, 11, 22,1, 3),
150)
val dumpChat2 = Chat("https://open.rocket.chat/avatar/leonardo.aramaki",
"Leonardo Aramaki",
"d",
"busy",
"Type something",
LocalDateTime.of(2017, 11, 21,1, 3),
1)
val dumpChat3 = Chat("https://open.rocket.chat/avatar/lucio.maciel",
"Lucio Maciel",
"d",
"away",
"Type something",
LocalDateTime.of(2017, 11, 17,1, 3),
0)
val dumpChat4 = Chat("https://open.rocket.chat/avatar/sing.li",
"mobile-internal",
"p",
null,
"@aaron.ogle @rafael.kellermann same problem over here. Although all the servers show up on the selection.",
LocalDateTime.of(2017, 11, 15,1, 3),
0)
val dumpChat5 = Chat("https://open.rocket.chat/avatar/matheus.cardoso",
"androidnativeapp",
"c",
null,
"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 dumpChat6 = Chat("https://open.rocket.chat/avatar/hetal",
"general",
"c",
null,
"Has joined the channel.",
LocalDateTime.of(2017, 11, 13,1, 3),
0)
return arrayListOf(dumpChat1, dumpChat2, dumpChat3, dumpChat4, dumpChat5, dumpChat6)
}
// REMARK: The presenter should call this method. The presenter also need to sort the chat list by latest message (compared by its timestamp).
// REMARK: The presenter should call this method. The presenter also need to sort the chat list by latest message (compared by its date).
private fun showChatList(dataSet: MutableList<Chat>) {
val context = activity.applicationContext
recycler_view.adapter = ChatListAdapter(dataSet, context)
......
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