From 6c527d52fb3ace3c26ac2b1e25a764e2dd99231d Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 22 Aug 2021 14:16:54 -0400 Subject: [PATCH] Use custom tabs instead of browser (closes #5754) --- .../ui/base/controller/ConductorExtensions.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt index 17735cf49..d225bec56 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/ConductorExtensions.kt @@ -1,6 +1,5 @@ package eu.kanade.tachiyomi.ui.base.controller -import android.content.Intent import android.content.pm.PackageManager.PERMISSION_GRANTED import androidx.core.content.ContextCompat import androidx.core.net.toUri @@ -8,7 +7,7 @@ import com.bluelinelabs.conductor.Controller import com.bluelinelabs.conductor.Router import com.bluelinelabs.conductor.RouterTransaction import eu.kanade.tachiyomi.ui.main.MainActivity -import eu.kanade.tachiyomi.util.system.toast +import eu.kanade.tachiyomi.util.system.openInBrowser fun Router.popControllerWithTag(tag: String): Boolean { val controller = getControllerWithTag(tag) @@ -35,12 +34,7 @@ fun Controller.withFadeTransaction(): RouterTransaction { } fun Controller.openInBrowser(url: String) { - try { - val intent = Intent(Intent.ACTION_VIEW, url.toUri()) - startActivity(intent) - } catch (e: Throwable) { - activity?.toast(e.message) - } + activity?.openInBrowser(url.toUri()) } /**