UrlLauncherImpl: use AndroidX Browser methods to launch custom tab

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-10-03 02:07:36 +05:30
parent f71bd27a03
commit 829a6bbdc6
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -3,8 +3,6 @@ package dev.msfjarvis.lobsters.urllauncher
import android.content.Context
import android.net.Uri
import androidx.browser.customtabs.CustomTabsIntent
import saschpe.android.customtabs.CustomTabsHelper
import saschpe.android.customtabs.WebViewFallback
class UrlLauncherImpl(private val context: Context) : UrlLauncher {
override fun launch(url: String) {
@ -12,11 +10,6 @@ class UrlLauncherImpl(private val context: Context) : UrlLauncher {
.setShareState(CustomTabsIntent.SHARE_STATE_ON)
.setShowTitle(true)
.build()
CustomTabsHelper.addKeepAliveExtra(context, customTabsIntent.intent)
CustomTabsHelper.openCustomTab(
context, customTabsIntent,
Uri.parse(url),
WebViewFallback()
)
customTabsIntent.launchUrl(context, Uri.parse(url))
}
}