add option to always expand content warnings (#1422)

This commit is contained in:
Konrad Pozniak 2019-07-28 19:59:52 +02:00 committed by GitHub
commit 8834c22120
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 742 additions and 210 deletions

View file

@ -162,6 +162,7 @@ public class NotificationsFragment extends SFragment implements
private boolean bottomLoading;
private String bottomId;
private boolean alwaysShowSensitiveMedia;
private boolean alwaysOpenSpoiler;
private boolean showNotificationsFilter;
// Each element is either a Notification for loading data or a Placeholder
@ -173,7 +174,8 @@ public class NotificationsFragment extends SFragment implements
Notification notification = input.asRight();
return ViewDataUtils.notificationToViewData(
notification,
alwaysShowSensitiveMedia
alwaysShowSensitiveMedia,
alwaysOpenSpoiler
);
} else {
return new NotificationViewData.Placeholder(input.asLeft().id, false);
@ -236,6 +238,7 @@ public class NotificationsFragment extends SFragment implements
adapter = new NotificationsAdapter(accountManager.getActiveAccount().getAccountId(),
dataSource, this, this);
alwaysShowSensitiveMedia = accountManager.getActiveAccount().getAlwaysShowSensitiveMedia();
alwaysOpenSpoiler = accountManager.getActiveAccount().getAlwaysOpenSpoiler();
boolean mediaPreviewEnabled = accountManager.getActiveAccount().getMediaPreviewEnabled();
adapter.setMediaPreviewEnabled(mediaPreviewEnabled);
boolean useAbsoluteTime = preferences.getBoolean("absoluteTimeView", false);