Updated on 2026-08-14
This commit is contained in:
parent
fbbd94051a
commit
2abbc1a365
46 changed files with 747 additions and 206 deletions
21
app/src/main/java/com/tangem/tap/common/CustomTabsManager.kt
Normal file
21
app/src/main/java/com/tangem/tap/common/CustomTabsManager.kt
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package com.tangem.tap.common
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.browser.customtabs.CustomTabColorSchemeParams
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import com.tangem.tap.common.extensions.getColorCompat
|
||||
import com.tangem.wallet.R
|
||||
|
||||
class CustomTabsManager {
|
||||
fun openUrl(url: String, context: Context) {
|
||||
val customTabsIntent = CustomTabsIntent.Builder()
|
||||
.setDefaultColorSchemeParams(
|
||||
CustomTabColorSchemeParams.Builder()
|
||||
.setNavigationBarColor(context.getColorCompat(R.color.toolbarColor))
|
||||
.build()
|
||||
)
|
||||
.build()
|
||||
customTabsIntent.launchUrl(context, Uri.parse(url))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue