diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-11-03 19:44:07 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-11-03 19:44:07 +0100 |
commit | 0a6879eea573d5475ee6fbb00caee9e09113c4c4 (patch) | |
tree | 37a9c522e14a02118e1d422459fdf4fadc3ffacc /src/main/java/de/pixart/messenger/ui | |
parent | 7d7835e03538f5176fc1f39445589e6afd5ee012 (diff) |
fixed links in privacy warning in channel discovery
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java | 8 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/text/FixedURLSpan.java | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java index 77892c16e..efcf8d02d 100644 --- a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java @@ -8,6 +8,7 @@ import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; import android.text.Html; +import android.text.method.LinkMovementMethod; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; @@ -158,6 +159,13 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O builder.setPositiveButton(R.string.confirm, (dialog, which) -> optIn()); builder.setOnCancelListener(dialog -> finish()); final AlertDialog dialog = builder.create(); + dialog.setOnShowListener(d -> { + final TextView textView = dialog.findViewById(android.R.id.message); + if (textView == null) { + return; + } + textView.setMovementMethod(LinkMovementMethod.getInstance()); + }); dialog.setCanceledOnTouchOutside(false); dialog.show(); } diff --git a/src/main/java/de/pixart/messenger/ui/text/FixedURLSpan.java b/src/main/java/de/pixart/messenger/ui/text/FixedURLSpan.java index 67232462c..c22dcc4cf 100644 --- a/src/main/java/de/pixart/messenger/ui/text/FixedURLSpan.java +++ b/src/main/java/de/pixart/messenger/ui/text/FixedURLSpan.java @@ -67,8 +67,8 @@ public class FixedURLSpan extends URLSpan { public void onClick(View widget) { final Uri uri = Uri.parse(getURL()); final Context context = widget.getContext(); - final boolean candidateToProcessDirecty = "xmpp".equals(uri.getScheme()) || ("https".equals(uri.getScheme()) && Config.inviteHostURL.equals(uri.getHost()) && uri.getPathSegments().size() > 1 && Arrays.asList("j", "i").contains(uri.getPathSegments().get(0))); - if (candidateToProcessDirecty && context instanceof ConversationsActivity) { + final boolean candidateToProcessDirectly = "xmpp".equals(uri.getScheme()) || ("https".equals(uri.getScheme()) && Config.inviteHostURL.equals(uri.getHost()) && uri.getPathSegments().size() > 1 && Arrays.asList("j", "i").contains(uri.getPathSegments().get(0))); + if (candidateToProcessDirectly && context instanceof ConversationsActivity) { if (((ConversationsActivity) context).onXmppUriClicked(uri)) { widget.playSoundEffect(0); return; |