feat: Delete,edit activity
This commit is contained in:
parent
6878d12b5c
commit
ea75197120
16 changed files with 336 additions and 208 deletions
|
@ -74,7 +74,9 @@ class RepliesBottomDialog : BottomSheetDialogFragment() {
|
|||
replies.map {
|
||||
ActivityReplyItem(
|
||||
it,
|
||||
activityId,
|
||||
requireActivity(),
|
||||
adapter,
|
||||
clickCallback = { int, _ ->
|
||||
onClick(int)
|
||||
}
|
||||
|
@ -109,7 +111,6 @@ class RepliesBottomDialog : BottomSheetDialogFragment() {
|
|||
super.onResume()
|
||||
loading(true)
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
delay(2000)
|
||||
loadData()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -422,14 +422,14 @@ class Stories @JvmOverloads constructor(
|
|||
}
|
||||
val likeColor = ContextCompat.getColor(context, R.color.yt_red)
|
||||
val notLikeColor = ContextCompat.getColor(context, R.color.bg_opp)
|
||||
binding.replyCount.text = story.replyCount.toString()
|
||||
binding.activityReplies.setColorFilter(ContextCompat.getColor(context, R.color.bg_opp))
|
||||
binding.activityRepliesContainer.setOnClickListener {
|
||||
RepliesBottomDialog.newInstance(story.id)
|
||||
.show(activity.supportFragmentManager, "replies")
|
||||
}
|
||||
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
||||
binding.replyCount.text = story.replyCount.toString()
|
||||
binding.activityLikeCount.text = story.likeCount.toString()
|
||||
binding.activityReplies.setColorFilter(ContextCompat.getColor(context, R.color.bg_opp))
|
||||
binding.activityLikeContainer.setOnClickListener {
|
||||
like()
|
||||
}
|
||||
|
@ -451,7 +451,7 @@ class Stories @JvmOverloads constructor(
|
|||
val notLikeColor = ContextCompat.getColor(context, R.color.bg_opp)
|
||||
val scope = CoroutineScope(Dispatchers.IO + SupervisorJob())
|
||||
scope.launch {
|
||||
val res = Anilist.query.toggleLike(story.id, "ACTIVITY")
|
||||
val res = Anilist.mutation.toggleLike(story.id, "ACTIVITY")
|
||||
withContext(Dispatchers.Main) {
|
||||
if (res != null) {
|
||||
if (story.isLiked == true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue