Updated on 2026-08-14
This commit is contained in:
parent
ef3fd2969b
commit
bb2ceaf6a8
4 changed files with 12 additions and 16 deletions
|
|
@ -31,6 +31,7 @@ object Library {
|
|||
const val accompanistAppCompatTheme = "com.google.accompanist:accompanist-appcompat-theme:" + Versions.accompanist
|
||||
const val accompanistSystemUiController =
|
||||
"com.google.accompanist:accompanist-systemuicontroller:" + Versions.accompanist
|
||||
const val accompanistWebView = "com.google.accompanist:accompanist-webview:" + Versions.accompanist
|
||||
const val amplitude = "com.amplitude:android-sdk:" + Versions.amplitude
|
||||
const val appsflyer = "com.appsflyer:af-android-sdk:" + Versions.appsflyer
|
||||
const val armadillo = "at.favre.lib:armadillo:" + Versions.armadillo
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ object Versions {
|
|||
// endregion Compose
|
||||
|
||||
// region Other libraries
|
||||
const val accompanist = "0.23.0"
|
||||
const val accompanist = "0.27.1"
|
||||
const val amplitude = "2.36.1"
|
||||
const val appsflyer = "6.5.1"
|
||||
const val armadillo = "0.9.0"
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ dependencies {
|
|||
|
||||
/** Other libraries */
|
||||
implementation(Library.composeShimmer)
|
||||
implementation(Library.accompanistWebView)
|
||||
|
||||
/** DI */
|
||||
implementation(Library.hilt)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
package com.tangem.feature.referral.ui
|
||||
|
||||
import android.view.ViewGroup.LayoutParams
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
|
|
@ -15,7 +12,8 @@ import androidx.compose.ui.platform.LocalConfiguration
|
|||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import com.google.accompanist.web.WebView
|
||||
import com.google.accompanist.web.rememberWebViewState
|
||||
import com.tangem.core.ui.components.appbar.AppBarWithAdditionalButtons
|
||||
import com.tangem.core.ui.components.atoms.Hand
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
|
@ -44,20 +42,16 @@ internal fun AgreementBottomSheetContent(url: String) {
|
|||
|
||||
@Composable
|
||||
private fun AgreementHtmlView(url: String) {
|
||||
AndroidView(
|
||||
val state = rememberWebViewState(url)
|
||||
WebView(
|
||||
state = state,
|
||||
modifier = Modifier.background(TangemTheme.colors.background.secondary),
|
||||
factory = {
|
||||
WebView(it).apply {
|
||||
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)
|
||||
webViewClient = WebViewClient()
|
||||
settings.apply {
|
||||
javaScriptEnabled = false
|
||||
allowFileAccess = false
|
||||
}
|
||||
loadUrl(url)
|
||||
onCreated = {
|
||||
it.settings.apply {
|
||||
javaScriptEnabled = false
|
||||
allowFileAccess = false
|
||||
}
|
||||
},
|
||||
update = { it.loadUrl(url) },
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue