mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 10:47:46 +00:00
Merge pull request #691 from hjubb/fix_url_open_dialog
Fix URL Open Dialog
This commit is contained in:
commit
d99d4d5ffc
@ -41,6 +41,7 @@ import org.thoughtcrime.securesms.mms.GlideRequests
|
||||
import org.thoughtcrime.securesms.util.SearchUtil
|
||||
import org.thoughtcrime.securesms.util.SearchUtil.StyleFactory
|
||||
import org.thoughtcrime.securesms.util.UiModeUtilities
|
||||
import java.net.IDN
|
||||
import java.util.*
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ -212,7 +213,8 @@ class VisibleMessageContentView : LinearLayout {
|
||||
|
||||
// replace URLSpans with ModalURLSpans
|
||||
body.getSpans<URLSpan>(0, body.length).toList().forEach { urlSpan ->
|
||||
val replacementSpan = ModalURLSpan(urlSpan.url) { url ->
|
||||
val updatedUrl = urlSpan.url.let(IDN::toASCII)
|
||||
val replacementSpan = ModalURLSpan(updatedUrl) { url ->
|
||||
val activity = context as AppCompatActivity
|
||||
OpenURLDialog(url).show(activity.supportFragmentManager, "Open URL Dialog")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user