From d393cf5c3e3867b54cb24cbd241a16322e3dd0fb Mon Sep 17 00:00:00 2001 From: sds100 Date: Sun, 4 Aug 2024 22:15:31 +0200 Subject: [PATCH] #1249 fix: remove usage of customtabs --- app/build.gradle | 1 - .../io/github/sds100/keymapper/home/HomeFragment.kt | 2 +- .../io/github/sds100/keymapper/system/url/UrlUtils.kt | 10 ---------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7e1118b7d9..c9c3103a7d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -172,7 +172,6 @@ dependencies { implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" implementation "androidx.multidex:multidex:$multidex_version" - implementation "androidx.browser:browser:1.4.0" implementation 'androidx.appcompat:appcompat:1.7.0' implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.preference:preference-ktx:1.2.0' diff --git a/app/src/main/java/io/github/sds100/keymapper/home/HomeFragment.kt b/app/src/main/java/io/github/sds100/keymapper/home/HomeFragment.kt index 8eafffd9cf..ea54c30689 100644 --- a/app/src/main/java/io/github/sds100/keymapper/home/HomeFragment.kt +++ b/app/src/main/java/io/github/sds100/keymapper/home/HomeFragment.kt @@ -140,7 +140,7 @@ class HomeFragment : Fragment() { binding.appBar.setOnMenuItemClickListener { when (it.itemId) { R.id.action_help -> { - UrlUtils.launchCustomTab( + UrlUtils.openUrl( requireContext(), str(R.string.url_quick_start_guide), ) diff --git a/app/src/main/java/io/github/sds100/keymapper/system/url/UrlUtils.kt b/app/src/main/java/io/github/sds100/keymapper/system/url/UrlUtils.kt index af138d14d9..eb4968c214 100644 --- a/app/src/main/java/io/github/sds100/keymapper/system/url/UrlUtils.kt +++ b/app/src/main/java/io/github/sds100/keymapper/system/url/UrlUtils.kt @@ -4,7 +4,6 @@ import android.content.ActivityNotFoundException import android.content.Context import android.content.Intent import android.net.Uri -import androidx.browser.customtabs.CustomTabsIntent import io.github.sds100.keymapper.util.Error import io.github.sds100.keymapper.util.Result import io.github.sds100.keymapper.util.success @@ -14,15 +13,6 @@ import io.github.sds100.keymapper.util.success */ object UrlUtils { - fun launchCustomTab(ctx: Context, url: String) { - CustomTabsIntent.Builder() - .build() - .launchUrl( - ctx, - Uri.parse(url), - ) - } - fun openUrl(ctx: Context, url: String): Result<*> { Intent(Intent.ACTION_VIEW, Uri.parse(url)).apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK