Skip to content

Commit

Permalink
Hide notification bell if notifications disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Apr 10, 2023
1 parent ed67d09 commit d8dd433
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 d8dd433

Please sign in to comment.