fix: simplify boolean view logic

This is a pretty basic conversion from `if (true) View.VISIBLE else View.GONE` to `isVisible` which is exactly that, but easier to track.
This commit is contained in:
TwistedUmbrellaX 2024-03-19 17:08:01 -04:00
parent e65e7a79a5
commit 9b2015f4cf
25 changed files with 107 additions and 111 deletions

View file

@ -3,6 +3,7 @@ package ani.dantotsu.profile.activity
import android.annotation.SuppressLint
import android.view.View
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.LinearLayoutManager
import ani.dantotsu.R
@ -58,8 +59,7 @@ class ActivityItem(
val likeColor = ContextCompat.getColor(binding.root.context, R.color.yt_red)
val notLikeColor = ContextCompat.getColor(binding.root.context, R.color.bg_opp)
binding.activityLike.setColorFilter(if (activity.isLiked == true) likeColor else notLikeColor)
binding.commentRepliesContainer.visibility =
if (activity.replyCount > 0) View.VISIBLE else View.GONE
binding.commentRepliesContainer.isVisible = activity.replyCount > 0
binding.commentRepliesContainer.setOnClickListener {
when (binding.activityReplies.visibility) {
View.GONE -> {