1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package fr.plnech.dunbar.dummy
import android.provider.ContactsContract
import fr.plnech.dunbar.model.Friend
import java.util.*
/**
* Helper class for providing sample content for user interfaces created by
* Android template wizards.
*
* TODO: Replace all uses of this class before publishing your app.
*/
object DummyContent {
/**
* An array of sample (dummy) items.
*/
val ITEMS: MutableList<Friend> = ArrayList()
/**
* A map of sample (dummy) items, by ID.
*/
val ITEM_MAP: MutableMap<Int, Friend> = HashMap()
private val COUNT = 25
init {
// Add some sample items.
for (i in 1..COUNT) {
addItem(createFriend(i))
}
}
private fun addItem(item: Friend) {
ITEMS.add(item)
ITEM_MAP[item.id] = item
}
private fun createFriend(position: Int): Friend {
return Friend(
mapOf(
ContactsContract.Contacts._ID to "$position",
ContactsContract.Contacts.DISPLAY_NAME to "Friend $position",
"data1" to "01 23 45 67 89",
"details" to "$position: this friend has a lot of details about them. What do you think?"
)
)
}
}