Commit f8867ffb authored by bizzbyster's avatar bizzbyster

more cleanup

parent 594b4cd7
...@@ -172,10 +172,12 @@ class MessageParser @Inject constructor(val context: Application, private val co ...@@ -172,10 +172,12 @@ class MessageParser @Inject constructor(val context: Application, private val co
if (!link.startsWith("@") && link !in consumed) { if (!link.startsWith("@") && link !in consumed) {
builder.setSpan(object : ClickableSpan() { builder.setSpan(object : ClickableSpan() {
override fun onClick(view: View) { override fun onClick(view: View) {
val tabsbuilder = CustomTabsIntent.Builder() with (view) {
tabsbuilder.setToolbarColor(ContextCompat.getColor(view.context, R.color.colorPrimary)) val tabsbuilder = CustomTabsIntent.Builder()
val customTabsIntent = tabsbuilder.build() tabsbuilder.setToolbarColor(ResourcesCompat.getColor(context.resources, R.color.colorPrimary, context.theme))
customTabsIntent.launchUrl(view.context, getUri(link)) val customTabsIntent = tabsbuilder.build()
customTabsIntent.launchUrl(context, getUri(link))
}
} }
}, matcher.start(0), matcher.end(0)) }, matcher.start(0), matcher.end(0))
consumed.add(link) consumed.add(link)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment