mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 13:35:33 +03:00
fix to enable links in markdown
fix to enable links in markdown when no top level domain was included in the link description This will disable automatic link parsing for hyperlinks, numbers, email address,... Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
3e4995de36
commit
cabe16202b
2 changed files with 7 additions and 4 deletions
|
@ -11,8 +11,8 @@ import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.text.SpannableString
|
import android.text.SpannableString
|
||||||
import android.text.Spanned
|
import android.text.Spanned
|
||||||
import android.util.Log
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import androidx.core.content.ContextCompat.startActivity
|
||||||
import com.nextcloud.talk.R
|
import com.nextcloud.talk.R
|
||||||
import com.nextcloud.talk.models.json.chat.ChatMessage
|
import com.nextcloud.talk.models.json.chat.ChatMessage
|
||||||
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||||
|
@ -155,8 +155,12 @@ class MessageUtils(val context: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
override fun configureConfiguration(builder: MarkwonConfiguration.Builder) {
|
||||||
builder.linkResolver { view: View?, link: String? ->
|
builder.linkResolver { _: View?, link: String? ->
|
||||||
Log.i(TAG, "Link action not implemented $view / $link")
|
val urlIntent = Intent(
|
||||||
|
Intent.ACTION_VIEW,
|
||||||
|
Uri.parse(link)
|
||||||
|
)
|
||||||
|
startActivity(context, urlIntent, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -154,7 +154,6 @@
|
||||||
app:outcomingTextLinkColor="@color/high_emphasis_text"
|
app:outcomingTextLinkColor="@color/high_emphasis_text"
|
||||||
app:outcomingTextSize="@dimen/chat_text_size"
|
app:outcomingTextSize="@dimen/chat_text_size"
|
||||||
app:outcomingTimeTextSize="12sp"
|
app:outcomingTimeTextSize="12sp"
|
||||||
app:textAutoLink="all"
|
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<com.nextcloud.ui.popupbubble.PopupBubble
|
<com.nextcloud.ui.popupbubble.PopupBubble
|
||||||
|
|
Loading…
Reference in a new issue