1
0
Fork 1

Add monero too

(cherry picked from commit 068c9896747409e40c3accf3e338617859d90483)
This commit is contained in:
Stephen Paul Weber 2024-11-09 14:55:59 -05:00 committed by Arne
parent c9d6e7b64b
commit a7bbfeee75
3 changed files with 11 additions and 0 deletions

View file

@ -867,6 +867,10 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
binding.command.setText(uri.getSchemeSpecificPart());
binding.command.setCompoundDrawablesRelativeWithIntrinsicBounds(getDrawable(R.drawable.bitcoin_cash_24dp), null, null, null);
binding.command.setCompoundDrawablePadding(20);
} else if (uri.getScheme().equals("monero")) {
binding.command.setText(uri.getSchemeSpecificPart());
binding.command.setCompoundDrawablesRelativeWithIntrinsicBounds(getDrawable(R.drawable.monero_24dp), null, null, null);
binding.command.setCompoundDrawablePadding(20);
} else if (uri.getScheme().equals("https") && "liberapay.com".equals(uri.getHost())) {
binding.command.setText(uri.getPath().substring(1));
binding.command.setCompoundDrawablesRelativeWithIntrinsicBounds(getDrawable(R.drawable.liberapay), null, null, null);

View file

@ -134,6 +134,7 @@ public class MyLinkify {
Linkify.addLinks(body, Patterns.SMS_URI, "sms");
Linkify.addLinks(body, Patterns.BITCOIN_URI, "bitcoin");
Linkify.addLinks(body, Patterns.BITCOINCASH_URI, "bitcoincash");
Linkify.addLinks(body, Patterns.MONERO_URI, "monero");
Linkify.addLinks(body, Patterns.AUTOLINK_WEB_URL, "http", WEBURL_MATCH_FILTER, WEBURL_TRANSFORM_FILTER);
if (includeGeo) {
Linkify.addLinks(body, GeoHelper.GEO_URI, "geo");

View file

@ -45,6 +45,12 @@ public class Patterns {
+ "\\;\\/\\?\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])"
+ "|(?:\\%[a-fA-F0-9]{2}))+)?");
public static final Pattern MONERO_URI = Pattern
.compile("monero\\:(?:[48][0-9AB][1-9A-HJ-NP-Za-km-z]{93})(?:\\?(?:(?:["
+ Patterns.GOOD_IRI_CHAR
+ "\\;\\/\\?\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])"
+ "|(?:\\%[a-fA-F0-9]{2}))+)?");
/**
* Regular expression to match all IANA top-level domains.
* List accurate as of 2011/07/18. List taken from: