Updated on 2026-08-14
This commit is contained in:
parent
75f8a45cd4
commit
f7412dfd86
3 changed files with 14 additions and 7 deletions
|
|
@ -141,6 +141,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicBottomSheet(
|
|||
val model = config.content as? T ?: return
|
||||
|
||||
val statusBarHeight = with(LocalDensity.current) { WindowInsets.statusBars.getTop(this).toDp() }
|
||||
val bottomBarHeight = with(LocalDensity.current) { WindowInsets.systemBars.getBottom(this).toDp() }
|
||||
|
||||
ModalBottomSheet(
|
||||
// FIXME temporary solution to fix height of the bottom sheet
|
||||
|
|
@ -155,7 +156,7 @@ inline fun <reified T : TangemBottomSheetConfigContent> BasicBottomSheet(
|
|||
Column(
|
||||
modifier = Modifier.let {
|
||||
if (addBottomInsets) {
|
||||
it.navigationBarsPadding()
|
||||
it.padding(bottom = bottomBarHeight)
|
||||
} else {
|
||||
it
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,15 +2,19 @@ package com.tangem.feature.referral.ui
|
|||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.height
|
||||
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.LocalDensity
|
||||
import androidx.compose.ui.platform.LocalInspectionMode
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.google.accompanist.web.WebView
|
||||
import com.google.accompanist.web.rememberWebViewState
|
||||
import com.tangem.core.ui.components.appbar.TangemTopAppBar
|
||||
|
|
@ -22,11 +26,10 @@ import com.tangem.feature.referral.presentation.R
|
|||
* Bottom sheet content with referral program terms of use
|
||||
*
|
||||
* @param url link to the html page
|
||||
* @param bottomBarHeight bottom insets
|
||||
*/
|
||||
@Composable
|
||||
internal fun AgreementBottomSheetContent(url: String) {
|
||||
val bottomBarHeight = with(LocalDensity.current) { WindowInsets.systemBars.getBottom(this).toDp() }
|
||||
|
||||
internal fun AgreementBottomSheetContent(url: String, bottomBarHeight: Dp) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
|
|
@ -62,6 +65,6 @@ private fun AgreementHtmlView(url: String) {
|
|||
@Composable
|
||||
private fun Preview_AgreementBottomSheet() {
|
||||
TangemThemePreview {
|
||||
AgreementBottomSheetContent(url = "https://tangem.com/en/")
|
||||
AgreementBottomSheetContent(url = "https://tangem.com/en/", 50.dp)
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.tangem.feature.referral.ui
|
|||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.statusBars
|
||||
import androidx.compose.foundation.layout.systemBars
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.ModalBottomSheet
|
||||
|
|
@ -24,6 +25,7 @@ internal fun ReferralBottomSheet(
|
|||
config: ReferralStateHolder.ReferralInfoState,
|
||||
) {
|
||||
val statusBarHeight = with(LocalDensity.current) { WindowInsets.statusBars.getTop(this).toDp() }
|
||||
val bottomBarHeight = with(LocalDensity.current) { WindowInsets.systemBars.getBottom(this).toDp() }
|
||||
|
||||
if (isVisible) {
|
||||
ModalBottomSheet(
|
||||
|
|
@ -43,6 +45,7 @@ internal fun ReferralBottomSheet(
|
|||
is ReferralStateHolder.ReferralInfoState.ParticipantContent -> config.url
|
||||
is ReferralStateHolder.ReferralInfoState.Loading -> ""
|
||||
},
|
||||
bottomBarHeight = bottomBarHeight,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue