diff --git a/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt b/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt index 854569d98e..c293235d23 100644 --- a/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt +++ b/app/src/main/java/com/github/libretube/ui/extensions/SetupNotificationBell.kt @@ -1,10 +1,17 @@ package com.github.libretube.ui.extensions +import androidx.core.view.isGone import com.github.libretube.R +import com.github.libretube.constants.PreferenceKeys import com.github.libretube.helpers.PreferenceHelper import com.google.android.material.button.MaterialButton fun MaterialButton.setupNotificationBell(channelId: String) { + if (!PreferenceHelper.getBoolean(PreferenceKeys.NOTIFICATION_ENABLED, true)) { + isGone = true + return + } + var isIgnorable = PreferenceHelper.isChannelNotificationIgnorable(channelId) setIconResource(if (isIgnorable) R.drawable.ic_bell else R.drawable.ic_notification)