diff --git a/app/build.gradle.kts b/app/build.gradle.kts index da836aa0ae..ef57ab1251 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -228,7 +228,6 @@ dependencies { implementation(deps.xmlShimmer) implementation(deps.viewBindingDelegate) implementation(deps.armadillo) - implementation(deps.mviCore.watcher) implementation(deps.kotlin.serialization) implementation(deps.reownCore) implementation(deps.reownWeb3) diff --git a/features/swap/presentation/build.gradle.kts b/features/swap/presentation/build.gradle.kts index ddbb0c1e9a..bd52ee999a 100644 --- a/features/swap/presentation/build.gradle.kts +++ b/features/swap/presentation/build.gradle.kts @@ -60,7 +60,6 @@ dependencies { implementation(deps.compose.ui.tooling) implementation(deps.compose.coil) implementation(deps.compose.constraintLayout) - implementation(deps.compose.accompanist.systemUiController) /** Api */ implementation(projects.features.swap.api) @@ -71,7 +70,6 @@ dependencies { /** Other libraries */ implementation(deps.compose.shimmer) - implementation(deps.compose.accompanist.webView) implementation(deps.compose.accompanist.systemUiController) implementation(deps.kotlin.serialization) implementation(deps.kotlin.immutable.collections) diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/states/WebViewBottomSheetConfig.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/states/WebViewBottomSheetConfig.kt deleted file mode 100644 index ee2bce3961..0000000000 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/models/states/WebViewBottomSheetConfig.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.tangem.feature.swap.models.states - -import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfigContent - -internal data class WebViewBottomSheetConfig(val url: String) : TangemBottomSheetConfigContent \ No newline at end of file diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreen.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreen.kt index 29be3b7df1..e474858740 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreen.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapScreen.kt @@ -15,7 +15,6 @@ import com.tangem.core.ui.utils.WindowInsetsZero import com.tangem.feature.swap.models.SwapStateHolder import com.tangem.feature.swap.models.states.ChooseFeeBottomSheetConfig import com.tangem.feature.swap.models.states.ChooseProviderBottomSheetConfig -import com.tangem.feature.swap.models.states.WebViewBottomSheetConfig import com.tangem.feature.swap.presentation.R @Composable @@ -40,20 +39,13 @@ internal fun SwapScreen(stateHolder: SwapStateHolder) { modifier = Modifier.padding(scaffoldPaddings), ) - stateHolder.bottomSheetConfig?.let { config -> + if (stateHolder.bottomSheetConfig != null) { + val config = stateHolder.bottomSheetConfig + when (config.content) { - is GiveTxPermissionBottomSheetConfig -> { - GiveTxPermissionBottomSheet(config = config) - } - is ChooseProviderBottomSheetConfig -> { - ChooseProviderBottomSheet(config = config) - } - is ChooseFeeBottomSheetConfig -> { - ChooseFeeBottomSheet(config = config) - } - is WebViewBottomSheetConfig -> { - WebViewBottomSheet(config = config) - } + is GiveTxPermissionBottomSheetConfig -> GiveTxPermissionBottomSheet(config = config) + is ChooseProviderBottomSheetConfig -> ChooseProviderBottomSheet(config = config) + is ChooseFeeBottomSheetConfig -> ChooseFeeBottomSheet(config = config) } } } diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/WebViewBottomSheet.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/WebViewBottomSheet.kt deleted file mode 100644 index 00a27d8a22..0000000000 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/WebViewBottomSheet.kt +++ /dev/null @@ -1,70 +0,0 @@ -package com.tangem.feature.swap.ui - -import android.content.res.Configuration -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxHeight -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.platform.LocalInspectionMode -import androidx.compose.ui.tooling.preview.Preview -import com.google.accompanist.web.WebView -import com.google.accompanist.web.rememberWebViewState -import com.tangem.core.ui.components.bottomsheets.TangemBottomSheet -import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig -import com.tangem.core.ui.res.TangemTheme -import com.tangem.core.ui.res.TangemThemePreview -import com.tangem.feature.swap.models.states.WebViewBottomSheetConfig - -@Composable -fun WebViewBottomSheet(config: TangemBottomSheetConfig) { - TangemBottomSheet( - config = config, - containerColor = TangemTheme.colors.background.tertiary, - ) { content: WebViewBottomSheetConfig -> - WebViewBottomSheetContent( - WebViewBottomSheetConfig(url = content.url), - ) - } -} - -@Composable -private fun WebViewBottomSheetContent(content: WebViewBottomSheetConfig) { - val state = rememberWebViewState(content.url) - val isInPreviewMode = LocalInspectionMode.current - Column( - modifier = Modifier - .fillMaxHeight() - .verticalScroll(rememberScrollState()), - ) { - WebView( - state = state, - modifier = Modifier - .background(TangemTheme.colors.background.secondary), - captureBackPresses = false, - onCreated = { - if (!isInPreviewMode) { - it.settings.apply { - javaScriptEnabled = false - allowFileAccess = false - } - } - }, - ) - } -} - -@Preview -@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) -@Composable -private fun Preview_WebViewBottomSheetContent() { - TangemThemePreview { - WebViewBottomSheetContent( - content = WebViewBottomSheetConfig( - url = "https://tangem.com/en/", - ), - ) - } -} \ No newline at end of file diff --git a/gradle/dependencies.toml b/gradle/dependencies.toml index fd6300302f..26b64b1a5c 100644 --- a/gradle/dependencies.toml +++ b/gradle/dependencies.toml @@ -248,7 +248,6 @@ timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } viewBindingDelegate = { module = "com.github.kirich1409:viewbindingpropertydelegate-noreflection", version.ref = "viewBindingDelegate" } xmlShimmer = { module = "com.github.skydoves:androidveil", version.ref = "xmlShimmer" } zxing-qrCore = { module = "com.google.zxing:core", version.ref = "zxingQrCode" } -mviCore-watcher = { module = "com.github.badoo.mvicore:mvicore-diff", version.ref = "mviCore" } kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinSerialization" } arrow-core = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" } arrow-fx = { module = "io.arrow-kt:arrow-fx-coroutines", version.ref = "arrow" }