mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-23 03:11:03 +00:00
feat: reviews
This commit is contained in:
@@ -2,6 +2,7 @@ package ani.dantotsu.profile
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.SpannableString
|
||||
import android.view.View
|
||||
import android.view.ViewGroup.MarginLayoutParams
|
||||
import android.widget.ImageButton
|
||||
@@ -54,7 +55,7 @@ class FollowActivity : AppCompatActivity() {
|
||||
)
|
||||
binding.listRecyclerView.adapter = adapter
|
||||
binding.listProgressBar.visibility = View.VISIBLE
|
||||
binding.listBack.setOnClickListener { finish() }
|
||||
binding.listBack.setOnClickListener { onBackPressedDispatcher.onBackPressed() }
|
||||
|
||||
val title = intent.getStringExtra("title")
|
||||
val userID = intent.getIntExtra("userId", 0)
|
||||
@@ -97,10 +98,11 @@ class FollowActivity : AppCompatActivity() {
|
||||
}
|
||||
users?.forEach { user ->
|
||||
if (getLayoutType(selected) == 0) {
|
||||
val username = SpannableString(user.name ?: "Unknown")
|
||||
adapter.add(
|
||||
FollowerItem(
|
||||
user.id,
|
||||
user.name ?: "Unknown",
|
||||
username,
|
||||
user.avatar?.medium,
|
||||
user.bannerImage ?: user.avatar?.medium
|
||||
) { onUserClick(it) })
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ani.dantotsu.profile
|
||||
|
||||
|
||||
import android.text.SpannableString
|
||||
import android.view.View
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.blurImage
|
||||
@@ -10,9 +11,10 @@ import com.xwray.groupie.viewbinding.BindableItem
|
||||
|
||||
class FollowerItem(
|
||||
private val id: Int,
|
||||
private val name: String,
|
||||
private val name: SpannableString,
|
||||
private val avatar: String?,
|
||||
private val banner: String?,
|
||||
private val altText: String? = null,
|
||||
val clickCallback: (Int) -> Unit
|
||||
) : BindableItem<ItemFollowerBinding>() {
|
||||
private lateinit var binding: ItemFollowerBinding
|
||||
@@ -21,6 +23,10 @@ class FollowerItem(
|
||||
binding = viewBinding
|
||||
binding.profileUserName.text = name
|
||||
avatar?.let { binding.profileUserAvatar.loadImage(it) }
|
||||
altText?.let {
|
||||
binding.altText.visibility = View.VISIBLE
|
||||
binding.altText.text = it
|
||||
}
|
||||
blurImage(binding.profileBannerImage, banner ?: avatar)
|
||||
binding.root.setOnClickListener { clickCallback(id) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user