mirror of
https://github.com/nextcloud/talk-android
synced 2025-08-14 07:25:16 +01:00
refactor
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
5fb1ae4560
commit
ee01481a1d
@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
package com.nextcloud.talk.utils
|
package com.nextcloud.talk.utils
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.text.method.ScrollingMovementMethod
|
import android.text.method.ScrollingMovementMethod
|
||||||
@ -37,15 +36,11 @@ object MarkwonUtils {
|
|||||||
|
|
||||||
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
||||||
builder.linkResolver(object : LinkResolverDef() {
|
builder.linkResolver(object : LinkResolverDef() {
|
||||||
@SuppressLint("SuspiciousIndentation")
|
|
||||||
override fun resolve(view: View, link: String) {
|
override fun resolve(view: View, link: String) {
|
||||||
var linkToOpen = link
|
var linkToOpen = link
|
||||||
if (!(linkToOpen.contains("http://") || linkToOpen.contains("https://"))) {
|
if (!(linkToOpen.contains("http://") || linkToOpen.contains("https://"))) {
|
||||||
linkToOpen = "https://$link"
|
linkToOpen = "https://$link"
|
||||||
} else {
|
|
||||||
linkToOpen = link
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val browserIntent = Intent(
|
val browserIntent = Intent(
|
||||||
Intent.ACTION_VIEW,
|
Intent.ACTION_VIEW,
|
||||||
linkToOpen.toUri()
|
linkToOpen.toUri()
|
||||||
|
Loading…
Reference in New Issue
Block a user