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

@ -9,6 +9,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import ani.dantotsu.BottomSheetDialogFragment
import ani.dantotsu.MainActivity
import ani.dantotsu.profile.ProfileActivity
@ -94,7 +95,7 @@ class SettingsDialogFragment : BottomSheetDialogFragment() {
Anilist.loginIntent(requireActivity())
}
}
binding.settingsNotificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
binding.settingsNotificationCount.isVisible = Anilist.unreadNotificationCount > 0
binding.settingsNotificationCount.text = Anilist.unreadNotificationCount.toString()
binding.settingsUserAvatar.setOnClickListener{
ContextCompat.startActivity(