Skip to content

Commit

Permalink
fix(social): activity name
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush2622 committed Apr 27, 2024
1 parent 90e611d commit 140dd2e
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions app/src/main/java/ani/dantotsu/home/status/Stories.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<Set<Int>>(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)
Expand All @@ -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 {
""
Expand All @@ -406,6 +410,20 @@ constructor(
null)
}



val userList = arrayListOf<User>()
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()
Expand All @@ -431,20 +449,5 @@ constructor(
}
}
}

val userList = arrayListOf<User>()
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<Set<Int>>(key, setOf()).plus((story.id))
PrefManager.setCustomVal(key, set)
}
}

0 comments on commit 140dd2e

Please sign in to comment.