mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Switch to LinkifyCompat.
We've seen some inconsistencies across OEMs with Linkify. Hopefully LinkifyCompat will resolve them.
This commit is contained in:
@@ -16,6 +16,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.text.util.LinkifyCompat;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
@@ -170,7 +171,7 @@ public class LongMessageActivity extends PassphraseRequiredActivity {
|
||||
|
||||
private SpannableString linkifyMessageBody(SpannableString messageBody) {
|
||||
int linkPattern = Linkify.WEB_URLS | Linkify.EMAIL_ADDRESSES | Linkify.PHONE_NUMBERS;
|
||||
boolean hasLinks = Linkify.addLinks(messageBody, linkPattern);
|
||||
boolean hasLinks = LinkifyCompat.addLinks(messageBody, linkPattern);
|
||||
|
||||
if (hasLinks) {
|
||||
Stream.of(messageBody.getSpans(0, messageBody.length(), URLSpan.class))
|
||||
|
||||
Reference in New Issue
Block a user