fix crash in NotificationsFragment when Preferences are first accessed
fixes #797
This commit is contained in:
parent
d1630d11bd
commit
1fef8c0c2b
|
@ -233,6 +233,10 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
|
|||
mediaPreviewEnabled = enabled;
|
||||
}
|
||||
|
||||
public boolean isMediaPreviewEnabled() {
|
||||
return mediaPreviewEnabled;
|
||||
}
|
||||
|
||||
public interface NotificationActionListener {
|
||||
void onViewAccount(String id);
|
||||
|
||||
|
|
|
@ -522,8 +522,10 @@ public class NotificationsFragment extends SFragment implements
|
|||
}
|
||||
case "mediaPreviewEnabled": {
|
||||
boolean enabled = sharedPreferences.getBoolean("mediaPreviewEnabled", true);
|
||||
if (enabled != adapter.isMediaPreviewEnabled()) {
|
||||
adapter.setMediaPreviewEnabled(enabled);
|
||||
fullyRefresh();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue