fix crash in NotificationsFragment when Preferences are first accessed
fixes #797
This commit is contained in:
parent
d1630d11bd
commit
1fef8c0c2b
2 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||
adapter.setMediaPreviewEnabled(enabled);
|
||||
fullyRefresh();
|
||||
if (enabled != adapter.isMediaPreviewEnabled()) {
|
||||
adapter.setMediaPreviewEnabled(enabled);
|
||||
fullyRefresh();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue