Skip to content

Commit

Permalink
#1249 fix: remove usage of customtabs
Browse files Browse the repository at this point in the history
  • Loading branch information
sds100 committed Aug 4, 2024
1 parent 9247ed1 commit d393cf5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d393cf5

Please sign in to comment.