mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 20:47:01 +05:30
UrlLauncherImpl: use AndroidX Browser methods to launch custom tab
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
f71bd27a03
commit
829a6bbdc6
1 changed files with 1 additions and 8 deletions
|
@ -3,8 +3,6 @@ package dev.msfjarvis.lobsters.urllauncher
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import androidx.browser.customtabs.CustomTabsIntent
|
import androidx.browser.customtabs.CustomTabsIntent
|
||||||
import saschpe.android.customtabs.CustomTabsHelper
|
|
||||||
import saschpe.android.customtabs.WebViewFallback
|
|
||||||
|
|
||||||
class UrlLauncherImpl(private val context: Context) : UrlLauncher {
|
class UrlLauncherImpl(private val context: Context) : UrlLauncher {
|
||||||
override fun launch(url: String) {
|
override fun launch(url: String) {
|
||||||
|
@ -12,11 +10,6 @@ class UrlLauncherImpl(private val context: Context) : UrlLauncher {
|
||||||
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
|
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
|
||||||
.setShowTitle(true)
|
.setShowTitle(true)
|
||||||
.build()
|
.build()
|
||||||
CustomTabsHelper.addKeepAliveExtra(context, customTabsIntent.intent)
|
customTabsIntent.launchUrl(context, Uri.parse(url))
|
||||||
CustomTabsHelper.openCustomTab(
|
|
||||||
context, customTabsIntent,
|
|
||||||
Uri.parse(url),
|
|
||||||
WebViewFallback()
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue