Skip to content

Commit

Permalink
Add show Reader card announcement methods to AppPrefs
Browse files Browse the repository at this point in the history
  • Loading branch information
RenanLukas committed May 16, 2024
1 parent c2fa592 commit 42fa1c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public enum DeletablePrefKey implements PrefKey {
SHOULD_HIDE_DYNAMIC_CARD,
PINNED_SITE_IDS,
READER_READING_PREFERENCES_JSON,
SHOULD_SHOW_READER_ANNOUNCEMENT_CARD,
}

/**
Expand Down Expand Up @@ -1780,6 +1781,14 @@ public static void setPinnedSiteLocalIds(@NonNull final String ids) {
setString(DeletablePrefKey.PINNED_SITE_IDS, ids);
}

public static boolean getShouldShowReaderAnnouncementCard() {
return prefs().getBoolean(DeletablePrefKey.SHOULD_SHOW_READER_ANNOUNCEMENT_CARD.name(), true);
}

public static void setShouldShowReaderAnnouncementCard(final boolean shouldShow) {
prefs().edit().putBoolean(DeletablePrefKey.SHOULD_SHOW_READER_ANNOUNCEMENT_CARD.name(), shouldShow).apply();
}

@Nullable
public static String getReaderReadingPreferencesJson() {
return getString(DeletablePrefKey.READER_READING_PREFERENCES_JSON, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@ class AppPrefsWrapper @Inject constructor() {

fun setBookmarkPostsPseudoIdsUpdated() = AppPrefs.setBookmarkPostsPseudoIdsUpdated()

fun shouldShowReaderAnnouncementCard(): Boolean = AppPrefs.getShouldShowReaderAnnouncementCard()

fun setShouldShowReaderAnnouncementCard(shouldShow: Boolean) =
AppPrefs.setShouldShowReaderAnnouncementCard(shouldShow)

fun getAllPrefs(): Map<String, Any?> = AppPrefs.getAllPrefs()

fun setString(prefKey: PrefKey, value: String) {
Expand Down

0 comments on commit 42fa1c8

Please sign in to comment.