Add options to confirm reblog/unreblog actions, close #460 (#1650)

This commit is contained in:
Ivan Kupalov 2020-03-03 21:27:26 +01:00 committed by GitHub
commit 67c20326f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 71 additions and 20 deletions

View file

@ -246,7 +246,8 @@ public class NotificationsFragment extends SFragment implements
preferences.getBoolean("absoluteTimeView", false),
preferences.getBoolean("showBotOverlay", true),
preferences.getBoolean("useBlurhash", true),
CardViewMode.NONE
CardViewMode.NONE,
preferences.getBoolean("confirmReblogs", true)
);
adapter = new NotificationsAdapter(accountManager.getActiveAccount().getAccountId(),

View file

@ -230,7 +230,8 @@ public class TimelineFragment extends SFragment implements
preferences.getBoolean("useBlurhash", true),
preferences.getBoolean("showCardsInTimelines", false) ?
CardViewMode.INDENTED :
CardViewMode.NONE
CardViewMode.NONE,
preferences.getBoolean("confirmReblogs", true)
);
adapter = new TimelineAdapter(dataSource, statusDisplayOptions, this);
@ -580,6 +581,10 @@ public class TimelineFragment extends SFragment implements
@Override
public void onReblog(final boolean reblog, final int position) {
final Status status = statuses.get(position).asRight();
doReblog(reblog, position, status);
}
private void doReblog(boolean reblog, int position, Status status) {
timelineCases.reblog(status, reblog)
.observeOn(AndroidSchedulers.mainThread())
.as(autoDisposable(from(this, Lifecycle.Event.ON_DESTROY)))

View file

@ -135,7 +135,8 @@ public final class ViewThreadFragment extends SFragment implements
preferences.getBoolean("useBlurhash", true),
preferences.getBoolean("showCardsInTimelines", false) ?
CardViewMode.INDENTED :
CardViewMode.NONE
CardViewMode.NONE,
preferences.getBoolean("confirmReblogs", true)
);
adapter = new ThreadAdapter(statusDisplayOptions, this);
}