Rename NotificationMode.ENABLED_DEFAULT to NotificationMode.ENABLED

This commit is contained in:
TobiGr 2021-10-15 19:59:06 +02:00
parent 7c6140b331
commit 64a7978c7f
5 changed files with 6 additions and 6 deletions

View File

@ -4,11 +4,11 @@ import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@IntDef({NotificationMode.DISABLED, NotificationMode.ENABLED_DEFAULT})
@IntDef({NotificationMode.DISABLED, NotificationMode.ENABLED})
@Retention(RetentionPolicy.SOURCE)
public @interface NotificationMode {
int DISABLED = 0;
int ENABLED_DEFAULT = 1;
int ENABLED = 1;
//other values reserved for the future
}

View File

@ -414,7 +414,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
}
private void setNotify(final boolean isEnabled) {
final int mode = isEnabled ? NotificationMode.ENABLED_DEFAULT : NotificationMode.DISABLED;
final int mode = isEnabled ? NotificationMode.ENABLED : NotificationMode.DISABLED;
disposables.add(
subscriptionManager.updateNotificationMode(currentInfo.getServiceId(),
currentInfo.getUrl(), mode)

View File

@ -36,7 +36,7 @@ class NotificationWorker(
.map { feed ->
feed.mapNotNull { x ->
x.value?.takeIf {
it.notificationMode == NotificationMode.ENABLED_DEFAULT &&
it.notificationMode == NotificationMode.ENABLED &&
it.newStreamsCount > 0
}
}

View File

@ -92,7 +92,7 @@ class NotificationsChannelsConfigFragment : Fragment(), ModeToggleListener {
val subscriptions = adapter?.getCurrentList() ?: return
val mode = subscriptions.firstOrNull()?.notificationMode ?: return
val newMode = when (mode) {
NotificationMode.DISABLED -> NotificationMode.ENABLED_DEFAULT
NotificationMode.DISABLED -> NotificationMode.ENABLED
else -> NotificationMode.DISABLED
}
val subscriptionManager = SubscriptionManager(requireContext())

View File

@ -85,7 +85,7 @@ class NotificationsConfigAdapter(
val mode = if (checkedTextView.isChecked) {
NotificationMode.DISABLED
} else {
NotificationMode.ENABLED_DEFAULT
NotificationMode.ENABLED
}
listener.onModeToggle(adapterPosition, mode)
}