feat: animations for comment/activity/notification

This commit is contained in:
rebelonion 2024-03-15 21:21:14 -05:00
parent 96e29a8c59
commit 94aae33d10
3 changed files with 6 additions and 0 deletions

View file

@ -14,6 +14,7 @@ import ani.dantotsu.databinding.ItemCommentsBinding
import ani.dantotsu.loadImage import ani.dantotsu.loadImage
import ani.dantotsu.others.ImageViewDialog import ani.dantotsu.others.ImageViewDialog
import ani.dantotsu.profile.ProfileActivity import ani.dantotsu.profile.ProfileActivity
import ani.dantotsu.setAnimation
import ani.dantotsu.snackString import ani.dantotsu.snackString
import ani.dantotsu.util.ColorEditor.Companion.adjustColorForContrast import ani.dantotsu.util.ColorEditor.Companion.adjustColorForContrast
import ani.dantotsu.util.ColorEditor.Companion.getContrastRatio import ani.dantotsu.util.ColorEditor.Companion.getContrastRatio
@ -55,6 +56,7 @@ class CommentItem(val comment: Comment,
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun bind(viewBinding: ItemCommentsBinding, position: Int) { override fun bind(viewBinding: ItemCommentsBinding, position: Int) {
binding = viewBinding binding = viewBinding
setAnimation(binding!!.root.context, binding!!.root)
viewBinding.commentRepliesList.layoutManager = LinearLayoutManager(commentsFragment.activity) viewBinding.commentRepliesList.layoutManager = LinearLayoutManager(commentsFragment.activity)
viewBinding.commentRepliesList.adapter = adapter viewBinding.commentRepliesList.adapter = adapter
val isUserComment = CommentsAPI.userId == comment.userId val isUserComment = CommentsAPI.userId == comment.userId

View file

@ -14,6 +14,7 @@ import ani.dantotsu.databinding.ItemActivityBinding
import ani.dantotsu.loadImage import ani.dantotsu.loadImage
import ani.dantotsu.profile.User import ani.dantotsu.profile.User
import ani.dantotsu.profile.UsersDialogFragment import ani.dantotsu.profile.UsersDialogFragment
import ani.dantotsu.setAnimation
import ani.dantotsu.snackString import ani.dantotsu.snackString
import ani.dantotsu.util.AniMarkdown.Companion.getBasicAniHTML import ani.dantotsu.util.AniMarkdown.Companion.getBasicAniHTML
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
@ -40,6 +41,7 @@ class ActivityItem(
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun bind(viewBinding: ItemActivityBinding, position: Int) { override fun bind(viewBinding: ItemActivityBinding, position: Int) {
binding = viewBinding binding = viewBinding
setAnimation(binding.root.context, binding.root)
repliesAdapter = GroupieAdapter() repliesAdapter = GroupieAdapter()
binding.activityReplies.adapter = repliesAdapter binding.activityReplies.adapter = repliesAdapter

View file

@ -9,6 +9,7 @@ import ani.dantotsu.connections.anilist.api.NotificationType
import ani.dantotsu.databinding.ItemNotificationBinding import ani.dantotsu.databinding.ItemNotificationBinding
import ani.dantotsu.loadImage import ani.dantotsu.loadImage
import ani.dantotsu.profile.activity.NotificationActivity.Companion.NotificationClickType import ani.dantotsu.profile.activity.NotificationActivity.Companion.NotificationClickType
import ani.dantotsu.setAnimation
import com.xwray.groupie.viewbinding.BindableItem import com.xwray.groupie.viewbinding.BindableItem
class NotificationItem( class NotificationItem(
@ -18,6 +19,7 @@ class NotificationItem(
private lateinit var binding: ItemNotificationBinding private lateinit var binding: ItemNotificationBinding
override fun bind(viewBinding: ItemNotificationBinding, position: Int) { override fun bind(viewBinding: ItemNotificationBinding, position: Int) {
binding = viewBinding binding = viewBinding
setAnimation(binding.root.context, binding.root)
setBinding() setBinding()
} }