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

Update dump data.

parent 5dabfbae
...@@ -8,6 +8,7 @@ import android.view.LayoutInflater ...@@ -8,6 +8,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import chat.rocket.android.R import chat.rocket.android.R
import chat.rocket.android.app.User
import kotlinx.android.synthetic.main.fragment_chat_list.* import kotlinx.android.synthetic.main.fragment_chat_list.*
import org.threeten.bp.LocalDateTime import org.threeten.bp.LocalDateTime
...@@ -22,59 +23,60 @@ class ChatListFragment : Fragment() { ...@@ -22,59 +23,60 @@ class ChatListFragment : Fragment() {
// 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 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> { private fun createDumpData(): List<Chat> {
val dumpChat1 = Chat("https://open.rocket.chat/avatar/leonardo.aramaki", val filipe = User("1", "Filipe Brito", "filipe.brito", "online", "https://open.rocket.chat/avatar/filipe.brito")
val lucio = User("2", "Lucio Maciel", "Lucio Maciel", "busy", "https://open.rocket.chat/avatar/lucio.maciel")
val leonardo = User("3", "Leonardo Aramaki", "leonardo.aramaki", "busy", "https://open.rocket.chat/avatar/leonardo.aramaki")
val sing = User("4", "Filipe Brito", "filipe.brito", "online", "https://open.rocket.chat/avatar/filipe.brito")
val hetal = User("5", "Filipe Brito", "filipe.brito", "online", "https://open.rocket.chat/avatar/filipe.brito")
val matheus = User("6", "Filipe Brito", "filipe.brito", "online", "https://open.rocket.chat/avatar/filipe.brito")
val bestrun = User("7", "Filipe Brito", "filipe.brito", "online", "https://open.rocket.chat/avatar/filipe.brito")
val djc = User("8", "3djc", "3djc", "online", "https://open.rocket.chat/avatar/filipe.brito")
val dumpChat1 = Chat(leonardo,
"Leonardo Aramaki", "Leonardo Aramaki",
"d", "d",
"busy",
"Type something", "Type something",
LocalDateTime.of(2017, 11, 21,1, 3), LocalDateTime.of(2017, 11, 21,1, 3),
1) 1)
val dumpChat2 = Chat("https://open.rocket.chat/avatar/filipe.brito", val dumpChat2 = Chat(filipe,
"Filipe Brito", "Filipe Brito",
"d", "d",
"online",
"Type something...Type something...Type something", "Type something...Type something...Type something",
LocalDateTime.of(2017, 11, 22,1, 3), LocalDateTime.of(2017, 11, 22,1, 3),
150) 150)
val dumpChat3 = Chat("https://open.rocket.chat/avatar/lucio.maciel", val dumpChat3 = Chat(lucio,
"Lucio Maciel", "Lucio Maciel",
"d", "d",
"away",
"Type something", "Type something",
LocalDateTime.of(2017, 11, 17,1, 3), LocalDateTime.of(2017, 11, 17,1, 3),
0) 0)
val dumpChat4 = Chat("https://open.rocket.chat/avatar/sing.li", val dumpChat4 = Chat(sing,
"mobile-internal", "mobile-internal",
"p", "p",
null,
"@aaron.ogle @rafael.kellermann same problem over here. Although all the servers show up on the selection.", "@aaron.ogle @rafael.kellermann same problem over here. Although all the servers show up on the selection.",
LocalDateTime.of(2017, 11, 15,1, 3), LocalDateTime.of(2017, 11, 15,1, 3),
0) 0)
val dumpChat5 = Chat("https://open.rocket.chat/avatar/hetal", val dumpChat5 = Chat(hetal,
"general", "general",
"c", "c",
null,
"Has joined the channel.", "Has joined the channel.",
LocalDateTime.of(2017, 11, 13,1, 3), LocalDateTime.of(2017, 11, 13,1, 3),
0) 0)
val dumpChat6 = Chat("https://open.rocket.chat/avatar/matheus.cardoso", val dumpChat6 = Chat(matheus,
"androidnativeapp", "androidnativeapp",
"c", "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.", "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), LocalDateTime.of(2017, 11, 14,1, 3),
0) 0)
val dumpChat7 = Chat("https://open.rocket.chat/avatar/bestrun", val dumpChat7 = Chat(bestrun,
"androidnativeapp-2", "androidnativeapp-2",
"c", "c",
null,
"Just downloaded .zip and imported into Android Studio then build the project.", "Just downloaded .zip and imported into Android Studio then build the project.",
LocalDateTime.of(2017, 11, 4,12, 47), LocalDateTime.of(2017, 11, 4,12, 47),
0) 0)
val dumpChat8 = Chat("https://open.rocket.chat/avatar/3djc", val dumpChat8 = Chat(djc,
"iosnativeapp", "iosnativeapp",
"c", "c",
null,
"Ok, got confused by the blog announcement that shows a screenshot with github oAuth ! Sorry !", "Ok, got confused by the blog announcement that shows a screenshot with github oAuth ! Sorry !",
LocalDateTime.of(2017, 11, 4,12, 43), LocalDateTime.of(2017, 11, 4,12, 43),
0) 0)
...@@ -86,8 +88,8 @@ class ChatListFragment : Fragment() { ...@@ -86,8 +88,8 @@ class ChatListFragment : Fragment() {
// REMARK: The presenter should call this method. The presenter also need to sort the chat list by latest message (compared by its date). // 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: List<Chat>) { private fun showChatList(dataSet: List<Chat>) {
val context = activity.applicationContext val context = activity.applicationContext
recycler_view.adapter = ChatListAdapter(dataSet.toMutableList(), context)
recycler_view.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) recycler_view.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
recycler_view.addItemDecoration(DividerItemDecoration(activity, DividerItemDecoration.VERTICAL)) recycler_view.addItemDecoration(DividerItemDecoration(activity, DividerItemDecoration.VERTICAL))
recycler_view.adapter = ChatListAdapter(dataSet.toMutableList(), 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