feat(social): mark alr watched
This commit is contained in:
parent
da456d3067
commit
f4c95b6cc0
5 changed files with 135 additions and 16 deletions
|
@ -7,8 +7,10 @@ import androidx.core.content.ContextCompat
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import ani.dantotsu.databinding.ItemUserStatusBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.profile.ProfileActivity
|
||||
import ani.dantotsu.profile.User
|
||||
import ani.dantotsu.setAnimation
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import java.io.Serializable
|
||||
|
||||
class UserStatus(private val user: ArrayList<User>) :
|
||||
|
@ -28,6 +30,17 @@ class UserStatus(private val user: ArrayList<User>) :
|
|||
null
|
||||
)
|
||||
}
|
||||
itemView.setOnLongClickListener {
|
||||
ContextCompat.startActivity(
|
||||
itemView.context,
|
||||
Intent(
|
||||
itemView.context,
|
||||
ProfileActivity::class.java
|
||||
).putExtra("userId", user[bindingAdapterPosition].id),
|
||||
null
|
||||
)
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,6 +61,10 @@ class UserStatus(private val user: ArrayList<User>) :
|
|||
b.profileUserAvatar.loadImage(user.pfp)
|
||||
b.profileUserName.text = user.name
|
||||
|
||||
val watchedActivityIds = PrefManager.getCustomVal<Set<Int>>("${user.id}_activities", setOf())
|
||||
val activityIdToStatusList = user.activity.map { watchedActivityIds.contains(it.id) }
|
||||
b.profileUserStatusIndicator.setParts(user.activity.size, activityIdToStatusList)
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = user.size
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue