fix: putting out 100 little fires

... before they become an inferno
This commit is contained in:
TwistedUmbrellaX 2024-03-20 16:19:51 -04:00
parent 633ec19c90
commit 1d740d33a0

View file

@ -12,6 +12,7 @@ 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 ani.dantotsu.setAnimation
import ani.dantotsu.toPx
import com.xwray.groupie.viewbinding.BindableItem import com.xwray.groupie.viewbinding.BindableItem
class NotificationItem( class NotificationItem(
@ -40,23 +41,11 @@ class NotificationItem(
?: notification.media?.coverImage?.large ?: notification.media?.coverImage?.large
blurImage(binding.notificationBannerImage, cover) blurImage(binding.notificationBannerImage, cover)
val defaultHeight = TypedValue.applyDimension( val defaultHeight = 153.toPx
TypedValue.COMPLEX_UNIT_DIP,
153f,
binding.root.context.resources.displayMetrics
).toInt()
val userHeight = TypedValue.applyDimension( val userHeight = 90.toPx
TypedValue.COMPLEX_UNIT_DIP,
90f,
binding.root.context.resources.displayMetrics
).toInt()
val textMarginStart = TypedValue.applyDimension( val textMarginStart = 125.toPx
TypedValue.COMPLEX_UNIT_DIP,
125f,
binding.root.context.resources.displayMetrics
).toInt()
if (user) { if (user) {
binding.notificationCover.visibility = View.GONE binding.notificationCover.visibility = View.GONE