fix: long click boost button actions on customlocaltimelines

Before, you just couldnt reblog something with the unlisted visibility directly from the custom local timelines, now you can! And there are some small adjustments to the behavior.
This commit is contained in:
LucasGGamerM 2023-04-12 13:32:22 -03:00
parent 4c698cf217
commit 8b27e6de33
1 changed files with 23 additions and 15 deletions

View File

@ -228,26 +228,21 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
}
private void onBoostClick(View v){
if (GlobalUserPreferences.confirmBeforeReblog) {
v.startAnimation(opacityIn);
onBoostLongClick(v);
return;
}
if(item.status.reloadWhenClicked){
UiUtils.lookupStatus(v.getContext(),
item.status, item.accountID, null,
status -> {
if (GlobalUserPreferences.confirmBeforeReblog) {
v.startAnimation(opacityIn);
onBoostLongClick(v);
} else {
boost.setSelected(!status.reblogged);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setReblogged(status, !status.reblogged, null, r->boostConsumer(v, r));
}
}
);
return;
}
if (GlobalUserPreferences.confirmBeforeReblog) {
v.startAnimation(opacityIn);
onBoostLongClick(v);
return;
}
boost.setSelected(!item.status.reblogged);
AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setReblogged(item.status, !item.status.reblogged, null, r->boostConsumer(v, r));
}
@ -265,9 +260,22 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
Consumer<StatusPrivacy> doReblog = (visibility) -> {
v.startAnimation(opacityOut);
if(item.status.reloadWhenClicked){
UiUtils.lookupStatus(v.getContext(),
item.status, item.accountID, null,
status -> {
session.getStatusInteractionController()
.setReblogged(status, !status.reblogged, visibility, r->boostConsumer(v, r));
boost.setSelected(status.reblogged);
dialog.dismiss();
}
);
} else {
session.getStatusInteractionController()
.setReblogged(item.status, !item.status.reblogged, visibility, r->boostConsumer(v, r));
boost.setSelected(item.status.reblogged);
dialog.dismiss();
}
};
View separator = menu.findViewById(R.id.separator);