Skip to content

Commit 8adf18b

Browse files
committed
fix to enable links in markdown
fix to enable links in markdown when no top level domain was included in the link description Signed-off-by: Marcel Hibbe <[email protected]>
1 parent ae8495a commit 8adf18b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/src/main/java/com/nextcloud/talk/utils/message/MessageUtils.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import android.content.Intent
2525
import android.net.Uri
2626
import android.text.SpannableString
2727
import android.text.Spanned
28-
import android.util.Log
2928
import android.view.View
29+
import androidx.core.content.ContextCompat.startActivity
3030
import com.nextcloud.talk.R
3131
import com.nextcloud.talk.models.json.chat.ChatMessage
3232
import com.nextcloud.talk.ui.theme.ViewThemeUtils
@@ -161,8 +161,12 @@ class MessageUtils(val context: Context) {
161161
}
162162

163163
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
164-
builder.linkResolver { view: View?, link: String? ->
165-
Log.i(TAG, "Link action not implemented $view / $link")
164+
builder.linkResolver { _: View?, link: String? ->
165+
val urlIntent = Intent(
166+
Intent.ACTION_VIEW,
167+
Uri.parse(link)
168+
)
169+
startActivity(context, urlIntent, null)
166170
}
167171
}
168172
})

app/src/main/res/layout/activity_chat.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
app:outcomingTextLinkColor="@color/high_emphasis_text"
169169
app:outcomingTextSize="@dimen/chat_text_size"
170170
app:outcomingTimeTextSize="12sp"
171-
app:textAutoLink="all"
172171
tools:visibility="visible"/>
173172

174173
<com.nextcloud.ui.popupbubble.PopupBubble

0 commit comments

Comments
 (0)