1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-09 04:38:08 -05:00

Make everything clickable in messages (links, email addresses, telephone numbers).

This commit is contained in:
Sebastian Kaspari 2012-01-21 08:57:28 +01:00
parent e04499070a
commit ec90fe3db6

View File

@ -33,6 +33,7 @@ import android.text.SpannableString;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.text.style.ImageSpan; import android.text.style.ImageSpan;
import android.text.util.Linkify;
import android.widget.TextView; import android.widget.TextView;
/** /**
@ -323,6 +324,10 @@ public class Message
TextView canvas = new TextView(context); TextView canvas = new TextView(context);
canvas.setAutoLinkMask(Linkify.ALL);
canvas.setLinksClickable(true);
canvas.setLinkTextColor(COLOR_BLUE);
canvas.setText(this.render(context)); canvas.setText(this.render(context));
canvas.setTextSize(settings.getFontSize()); canvas.setTextSize(settings.getFontSize());
canvas.setTypeface(Typeface.MONOSPACE); canvas.setTypeface(Typeface.MONOSPACE);