refactor(notifications-tab/badge): use improved implementation

Removes the now unecessary network call, by hooking into the notification reciever instead.
This commit is contained in:
FineFindus
2023-03-01 22:00:49 +01:00
parent 4ecd525f13
commit ac5615497b
3 changed files with 8 additions and 22 deletions

View File

@@ -47,7 +47,7 @@ public class GlobalUserPreferences{
public static boolean collapseLongPosts;
public static boolean spectatorMode;
public static boolean autoHideFab;
public static long lastNotificationOpenedTime;
public static boolean unreadNotifications;
public static String publishButtonText;
public static ThemePreference theme;
public static ColorPreference color;
@@ -102,7 +102,7 @@ public class GlobalUserPreferences{
collapseLongPosts=prefs.getBoolean("collapseLongPosts", true);
spectatorMode=prefs.getBoolean("spectatorMode", false);
autoHideFab=prefs.getBoolean("autoHideFab", true);
lastNotificationOpenedTime=prefs.getLong("lastNotificationOpenedTime", 0);
unreadNotifications=prefs.getBoolean("unreadNotifications", false);
publishButtonText=prefs.getString("publishButtonText", "");
theme=ThemePreference.values()[prefs.getInt("theme", 0)];
recentLanguages=fromJson(prefs.getString("recentLanguages", "{}"), recentLanguagesType, new HashMap<>());
@@ -152,7 +152,7 @@ public class GlobalUserPreferences{
.putBoolean("collapseLongPosts", collapseLongPosts)
.putBoolean("spectatorMode", spectatorMode)
.putBoolean("autoHideFab", autoHideFab)
.putLong("lastNotificationOpenedTime", lastNotificationOpenedTime)
.putBoolean("unreadNotifications", unreadNotifications)
.putString("publishButtonText", publishButtonText)
.putBoolean("bottomEncoding", bottomEncoding)
.putInt("theme", theme.ordinal())