From 140dd2e0c3c58d507393df60d574f858caf9a6f7 Mon Sep 17 00:00:00 2001 From: aayush262 Date: Sat, 27 Apr 2024 17:54:49 +0530 Subject: [PATCH] fix(social): activity name --- .../java/ani/dantotsu/home/status/Stories.kt | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/home/status/Stories.kt b/app/src/main/java/ani/dantotsu/home/status/Stories.kt index b67626b6aa..6a93c953e0 100644 --- a/app/src/main/java/ani/dantotsu/home/status/Stories.kt +++ b/app/src/main/java/ani/dantotsu/home/status/Stories.kt @@ -372,8 +372,12 @@ constructor( private fun loadStory(story: Activity) { loadingView.visibility = View.GONE animation.start() - val bannerAnimations: Boolean = PrefManager.getVal(PrefName.BannerAnimations) + val key = "${story.user?.id}_activities" + val set = PrefManager.getCustomVal>(key, setOf()).plus((story.id)) + PrefManager.setCustomVal(key, set) + + val bannerAnimations: Boolean = PrefManager.getVal(PrefName.BannerAnimations) blurImage(if (bannerAnimations)imageContentViewKen else imageContentView, story.media?.bannerImage ?: story.media?.coverImage?.extraLarge) userAvatar.loadImage(story.user?.avatar?.large) coverImage.loadImage(story.media?.coverImage?.extraLarge) @@ -387,7 +391,7 @@ constructor( it.toString() } }} ${story.progress ?: story.media?.title?.userPreferred} " + - if (story.status?.contains("Completed") != false) { + if (story.status?.contains("completed") == false) { "of ${story.media?.title?.userPreferred}" }else { "" @@ -406,6 +410,20 @@ constructor( null) } + + + val userList = arrayListOf() + story.likes?.forEach { i -> + userList.add(User(i.id, i.name.toString(), i.avatar?.medium, i.bannerImage)) + } + activityLikeContainer.setOnLongClickListener { + UsersDialogFragment().apply { + userList(userList) + show(activ.supportFragmentManager, "dialog") + } + true + } + val likeColor = ContextCompat.getColor(context, R.color.yt_red) val notLikeColor = ContextCompat.getColor(context, R.color.bg_opp) activityLikeCount.text = story.likeCount.toString() @@ -431,20 +449,5 @@ constructor( } } } - - val userList = arrayListOf() - story.likes?.forEach { i -> - userList.add(User(i.id, i.name.toString(), i.avatar?.medium, i.bannerImage)) - } - activityLikeContainer.setOnLongClickListener { - UsersDialogFragment().apply { - userList(userList) - show(activ.supportFragmentManager, "dialog") - } - true - } - val key = "${story.user?.id}_activities" - val set = PrefManager.getCustomVal>(key, setOf()).plus((story.id)) - PrefManager.setCustomVal(key, set) } } \ No newline at end of file