feat: following / followers page
This commit is contained in:
parent
8da0092561
commit
31afbd547e
17 changed files with 546 additions and 215 deletions
33
app/src/main/java/ani/dantotsu/profile/FollowerItem.kt
Normal file
33
app/src/main/java/ani/dantotsu/profile/FollowerItem.kt
Normal file
|
@ -0,0 +1,33 @@
|
|||
package ani.dantotsu.profile
|
||||
|
||||
import android.view.View
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.databinding.ItemFollowerBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
|
||||
class FollowerItem(
|
||||
private val id: Int,
|
||||
private val name: String,
|
||||
private val avatar: String?,
|
||||
private val banner: String?,
|
||||
val clickCallback: (Int) -> Unit
|
||||
): BindableItem<ItemFollowerBinding>() {
|
||||
private lateinit var binding: ItemFollowerBinding
|
||||
|
||||
override fun bind(viewBinding: ItemFollowerBinding, position: Int) {
|
||||
binding = viewBinding
|
||||
binding.profileUserName.text = name
|
||||
avatar?.let { binding.profileUserAvatar.loadImage(it) }
|
||||
banner?.let { binding.profileBannerImage.loadImage(it) }
|
||||
binding.root.setOnClickListener { clickCallback(id) }
|
||||
}
|
||||
|
||||
override fun getLayout(): Int {
|
||||
return R.layout.item_follower
|
||||
}
|
||||
|
||||
override fun initializeViewBinding(view: View): ItemFollowerBinding {
|
||||
return ItemFollowerBinding.bind(view)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue