feat: show reply sheet on reply button

This commit is contained in:
FineFindus 2024-03-16 23:34:00 +01:00
parent 3939fc9795
commit 14a36d2602
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
1 changed files with 12 additions and 12 deletions

View File

@ -205,37 +205,37 @@ public class FooterStatusDisplayItem extends StatusDisplayItem{
item.status, item.accountID, null, item.status, item.accountID, null,
status -> { status -> {
UiUtils.opacityIn(v); UiUtils.opacityIn(v);
Bundle args=new Bundle(); openComposeView(status, item.accountID);
args.putString("account", item.accountID);
args.putParcelable("replyTo", Parcels.wrap(status));
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
} }
); );
return; return;
} }
UiUtils.opacityIn(v); UiUtils.opacityIn(v);
Bundle args=new Bundle(); openComposeView(item.status, item.accountID);
args.putString("account", item.accountID);
args.putParcelable("replyTo", Parcels.wrap(item.status));
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
} }
private boolean onReplyLongClick(View v) { private boolean onReplyLongClick(View v) {
if(item.status.preview) return false; if(item.status.preview) return false;
if (AccountSessionManager.getInstance().getLoggedInAccounts().size() < 2) return false; if (AccountSessionManager.getInstance().getLoggedInAccounts().size() < 2) return false;
UiUtils.pickAccount(v.getContext(), item.accountID, R.string.sk_reply_as, R.drawable.ic_fluent_arrow_reply_28_regular, session -> { UiUtils.pickAccount(v.getContext(), item.accountID, R.string.sk_reply_as, R.drawable.ic_fluent_arrow_reply_28_regular, session -> {
Bundle args=new Bundle();
String accountID = session.getID(); String accountID = session.getID();
args.putString("account", accountID);
UiUtils.lookupStatus(v.getContext(), item.status, accountID, item.accountID, status -> { UiUtils.lookupStatus(v.getContext(), item.status, accountID, item.accountID, status -> {
if (status == null) return; if (status == null) return;
args.putParcelable("replyTo", Parcels.wrap(status)); openComposeView(status, accountID);
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
}); });
}, null); }, null);
return true; return true;
} }
private void openComposeView(Status status, String accountID) {
item.parentFragment.maybeShowPreReplySheet(status, () ->{
Bundle args=new Bundle();
args.putString("account", accountID);
args.putParcelable("replyTo", Parcels.wrap(status));
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
});
}
private void onBoostClick(View v){ private void onBoostClick(View v){
if(item.status.preview) return; if(item.status.preview) return;
if (GlobalUserPreferences.confirmBoost) { if (GlobalUserPreferences.confirmBoost) {