diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java index fa71d00e3..52d205552 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/NotificationsAdapter.java @@ -233,6 +233,10 @@ public class NotificationsAdapter extends RecyclerView.Adapter { mediaPreviewEnabled = enabled; } + public boolean isMediaPreviewEnabled() { + return mediaPreviewEnabled; + } + public interface NotificationActionListener { void onViewAccount(String id); diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index 1a76a227d..d6ece229f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -522,8 +522,10 @@ public class NotificationsFragment extends SFragment implements } case "mediaPreviewEnabled": { boolean enabled = sharedPreferences.getBoolean("mediaPreviewEnabled", true); - adapter.setMediaPreviewEnabled(enabled); - fullyRefresh(); + if (enabled != adapter.isMediaPreviewEnabled()) { + adapter.setMediaPreviewEnabled(enabled); + fullyRefresh(); + } break; } }