use AndroidX WorkManager instead of Evernote Android Job (#1783)

* use AndroidX WorkManager instead of Evernote Android Job

* move notification related classes to their own package

* fix missing import
This commit is contained in:
Konrad Pozniak 2020-05-12 18:46:49 +02:00 committed by GitHub
commit b280e25727
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 163 additions and 182 deletions

View file

@ -23,7 +23,7 @@ import androidx.preference.SwitchPreferenceCompat
import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.db.AccountManager
import com.keylesspalace.tusky.di.Injectable
import com.keylesspalace.tusky.util.NotificationHelper
import com.keylesspalace.tusky.components.notifications.NotificationHelper
import javax.inject.Inject
class NotificationPreferencesFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChangeListener, Injectable {
@ -70,9 +70,9 @@ class NotificationPreferencesFragment : PreferenceFragmentCompat(), Preference.O
"notificationsEnabled" -> {
activeAccount.notificationsEnabled = newValue as Boolean
if (NotificationHelper.areNotificationsEnabled(preference.context, accountManager)) {
NotificationHelper.enablePullNotifications()
NotificationHelper.enablePullNotifications(preference.context)
} else {
NotificationHelper.disablePullNotifications()
NotificationHelper.disablePullNotifications(preference.context)
}
}
"notificationFilterMentions" -> activeAccount.notificationsMentioned = newValue as Boolean