-
Notifications
You must be signed in to change notification settings - Fork 7
/
User.kt
30 lines (24 loc) · 1.03 KB
/
User.kt
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
package com.amrdeveloper.easyadapterlibrary.data
import android.graphics.Color
import com.amrdeveloper.easyadapter.adapter.ArrayAdapter
import com.amrdeveloper.easyadapter.adapter.ListAdapter
import com.amrdeveloper.easyadapter.adapter.PagingDataAdapter
import com.amrdeveloper.easyadapter.adapter.RecyclerAdapter
import com.amrdeveloper.easyadapter.bind.*
import com.amrdeveloper.easyadapter.option.ImageLoader
import com.amrdeveloper.easyadapter.option.ListenerType
private const val userListItem = "list_item_user"
@BindListener(ListenerType.OnHover)
@BindExpandable(userListItem)
@ArrayAdapter(appPackageId, userListItem)
@RecyclerAdapter(appPackageId, userListItem)
@ListAdapter(appPackageId, userListItem, "username")
@PagingDataAdapter(appPackageId, userListItem, "username")
data class User (
@BindText("user_name")
val username : String,
@BindImage(ImageLoader.COIL, "use_avatar", condition = "item.avatarUrl.isNotEmpty()")
val avatarUrl : String,
@BindTextColor("user_name")
val textColor : Int = Color.BLACK
)