Update app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java

Co-authored-by: litetex <40789489+litetex@users.noreply.github.com>
This commit is contained in:
Tobi 2021-10-15 20:22:12 +02:00 committed by GitHub
parent 64a7978c7f
commit 4f7cdcce55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -400,17 +400,16 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
if (menuNotifyButton == null) { if (menuNotifyButton == null) {
return; return;
} }
if (subscription == null) { if (subscription != null) {
menuNotifyButton.setVisible(false);
} else {
menuNotifyButton.setEnabled( menuNotifyButton.setEnabled(
NotificationHelper.isNewStreamsNotificationsEnabled(requireContext()) NotificationHelper.isNewStreamsNotificationsEnabled(requireContext())
); );
menuNotifyButton.setChecked( menuNotifyButton.setChecked(
subscription.getNotificationMode() != NotificationMode.DISABLED subscription.getNotificationMode() == NotificationMode.ENABLED
); );
menuNotifyButton.setVisible(true);
} }
menuNotifyButton.setVisible(subscription != null);
} }
private void setNotify(final boolean isEnabled) { private void setNotify(final boolean isEnabled) {