Skip to content

Commit

Permalink
Merge pull request #3520 from Bnyro/master
Browse files Browse the repository at this point in the history
Hide notification bell if notifications disabled
  • Loading branch information
Bnyro committed Apr 10, 2023
2 parents f492f6d + d8dd433 commit bcc5d55
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit bcc5d55

Please sign in to comment.