Poll notifications (#1229)
* show poll notifications in the app * show poll notifications in the app * allow filtering poll notifications in the poll fragment * show poll notifications in system notifications
This commit is contained in:
parent
647238052b
commit
e735e4843e
44 changed files with 1076 additions and 318 deletions
|
@ -222,7 +222,8 @@ public class NotificationsFragment extends SFragment implements
|
|||
|
||||
recyclerView.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
|
||||
|
||||
adapter = new NotificationsAdapter(dataSource, this, this);
|
||||
adapter = new NotificationsAdapter(accountManager.getActiveAccount().getAccountId(),
|
||||
dataSource, this, this);
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||
alwaysShowSensitiveMedia = accountManager.getActiveAccount().getAlwaysShowSensitiveMedia();
|
||||
boolean mediaPreviewEnabled = accountManager.getActiveAccount().getMediaPreviewEnabled();
|
||||
|
@ -652,13 +653,15 @@ public class NotificationsFragment extends SFragment implements
|
|||
private String getNotificationText(Notification.Type type) {
|
||||
switch (type) {
|
||||
case MENTION:
|
||||
return getString(R.string.filter_mentions);
|
||||
return getString(R.string.notification_mention_name);
|
||||
case FAVOURITE:
|
||||
return getString(R.string.filter_favorites);
|
||||
return getString(R.string.notification_favourite_name);
|
||||
case REBLOG:
|
||||
return getString(R.string.filter_boosts);
|
||||
return getString(R.string.notification_boost_name);
|
||||
case FOLLOW:
|
||||
return getString(R.string.filter_follows);
|
||||
return getString(R.string.notification_follow_name);
|
||||
case POLL:
|
||||
return getString(R.string.notification_poll_name);
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
|
|
|
@ -62,6 +62,10 @@ class NotificationPreferencesFragment : PreferenceFragmentCompat(), Preference.O
|
|||
favoritedPref.isChecked = activeAccount.notificationsFavorited
|
||||
favoritedPref.onPreferenceChangeListener = this
|
||||
|
||||
val pollsPref = requirePreference("notificationFilterPolls") as SwitchPreference
|
||||
pollsPref.isChecked = activeAccount.notificationsPolls
|
||||
pollsPref.onPreferenceChangeListener = this
|
||||
|
||||
val soundPref = requirePreference("notificationAlertSound") as SwitchPreference
|
||||
soundPref.isChecked = activeAccount.notificationSound
|
||||
soundPref.onPreferenceChangeListener = this
|
||||
|
@ -94,6 +98,7 @@ class NotificationPreferencesFragment : PreferenceFragmentCompat(), Preference.O
|
|||
"notificationFilterFollows" -> activeAccount.notificationsFollowed = newValue as Boolean
|
||||
"notificationFilterReblogs" -> activeAccount.notificationsReblogged = newValue as Boolean
|
||||
"notificationFilterFavourites" -> activeAccount.notificationsFavorited = newValue as Boolean
|
||||
"notificationFilterPolls" -> activeAccount.notificationsPolls = newValue as Boolean
|
||||
"notificationAlertSound" -> activeAccount.notificationSound = newValue as Boolean
|
||||
"notificationAlertVibrate" -> activeAccount.notificationVibration = newValue as Boolean
|
||||
"notificationAlertLight" -> activeAccount.notificationLight = newValue as Boolean
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue