1
0
Fork 1

Monero uses a different query param for amount

(cherry picked from commit 6128df6e7443eb33318de0c966369df440e55e05)
This commit is contained in:
Stephen Paul Weber 2024-11-12 08:58:12 -05:00 committed by Arne
parent 30ff489e22
commit de59e05880

View file

@ -943,15 +943,19 @@ public class MessageAdapter extends ArrayAdapter<Message> {
viewHolder.audioPlayer.setVisibility(View.GONE);
viewHolder.download_button.setVisibility(View.VISIBLE);
final var uri = message.wholeIsKnownURI();
final var amount = uri.getQueryParameter("amount");
final var formattedAmount = amount == null || amount.equals("") ? "" : amount + " ";
if ("bitcoin".equals(uri.getScheme())) {
final var amount = uri.getQueryParameter("amount");
final var formattedAmount = amount == null || amount.equals("") ? "" : amount + " ";
viewHolder.download_button.setIconResource(R.drawable.bitcoin_24dp);
viewHolder.download_button.setText("Send " + formattedAmount + "Bitcoin");
} else if ("bitcoincash".equals(uri.getScheme())) {
final var amount = uri.getQueryParameter("amount");
final var formattedAmount = amount == null || amount.equals("") ? "" : amount + " ";
viewHolder.download_button.setIconResource(R.drawable.bitcoin_cash_24dp);
viewHolder.download_button.setText("Send " + formattedAmount + "Bitcoin Cash");
} else if ("monero".equals(uri.getScheme())) {
final var amount = uri.getQueryParameter("tx_amount");
final var formattedAmount = amount == null || amount.equals("") ? "" : amount + " ";
viewHolder.download_button.setIconResource(R.drawable.monero_24dp);
viewHolder.download_button.setText("Send " + formattedAmount + "Monero");
}