diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/ui/NFTCollections.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/ui/NFTCollections.kt index 2d42caaf85..3036cc073f 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/ui/NFTCollections.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/collections/ui/NFTCollections.kt @@ -1,8 +1,8 @@ package com.tangem.features.nft.collections.ui import androidx.activity.compose.BackHandler +import androidx.compose.foundation.background import androidx.compose.foundation.layout.* -import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.tangem.core.ui.components.appbar.AppBarWithBackButton @@ -17,31 +17,28 @@ import com.tangem.features.nft.impl.R internal fun NFTCollections(state: NFTCollectionsStateUM, modifier: Modifier = Modifier) { BackHandler(onBack = state.onBackClick) - Scaffold( - modifier = modifier, - containerColor = TangemTheme.colors.background.secondary, - topBar = { - AppBarWithBackButton( - modifier = Modifier.statusBarsPadding(), - onBackClick = state.onBackClick, - text = stringResourceSafe(id = R.string.nft_collections_title), - iconRes = R.drawable.ic_back_24, - ) - }, - content = { innerPadding -> - TangemPullToRefreshContainer( - config = state.pullToRefreshConfig, - modifier = Modifier - .padding(innerPadding) - .fillMaxSize(), - ) { - when (val content = state.content) { - is NFTCollectionsUM.Content -> NFTCollectionsContent(content) - is NFTCollectionsUM.Empty -> NFTCollectionsEmpty(content) - is NFTCollectionsUM.Failed -> NFTCollectionsFailed(content) - is NFTCollectionsUM.Loading -> NFTCollectionsLoading(content) - } + Column( + modifier = modifier + .background(TangemTheme.colors.background.secondary), + ) { + AppBarWithBackButton( + modifier = Modifier, + onBackClick = state.onBackClick, + text = stringResourceSafe(id = R.string.nft_collections_title), + iconRes = R.drawable.ic_back_24, + ) + + TangemPullToRefreshContainer( + config = state.pullToRefreshConfig, + modifier = Modifier + .fillMaxSize(), + ) { + when (val content = state.content) { + is NFTCollectionsUM.Content -> NFTCollectionsContent(content) + is NFTCollectionsUM.Empty -> NFTCollectionsEmpty(content) + is NFTCollectionsUM.Failed -> NFTCollectionsFailed(content) + is NFTCollectionsUM.Loading -> NFTCollectionsLoading(content) } - }, - ) + } + } } \ No newline at end of file diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/common/ui/NFTContent.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/common/ui/NFTContent.kt index ef907f1e0f..f906d793ee 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/common/ui/NFTContent.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/common/ui/NFTContent.kt @@ -19,8 +19,8 @@ import com.tangem.features.nft.common.NFTRoute @Composable internal fun NFTContent(stackState: ChildStack) { Column( - modifier = Modifier.Companion - .background(color = TangemTheme.colors.background.tertiary) + modifier = Modifier + .background(color = TangemTheme.colors.background.secondary) .fillMaxSize() .imePadding() .systemBarsPadding(), diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/details/ui/NFTDetails.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/details/ui/NFTDetails.kt index 203288ef78..2c3ad2ede5 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/details/ui/NFTDetails.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/details/ui/NFTDetails.kt @@ -1,13 +1,10 @@ package com.tangem.features.nft.details.ui import androidx.activity.compose.BackHandler -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.statusBarsPadding -import androidx.compose.material3.FabPosition -import androidx.compose.material3.Scaffold +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import com.tangem.core.ui.components.PrimaryButton import com.tangem.core.ui.components.appbar.TangemTopAppBar @@ -22,25 +19,25 @@ import com.tangem.features.nft.impl.R internal fun NFTDetails(state: NFTDetailsUM, modifier: Modifier = Modifier) { BackHandler(onBack = state.onBackClick) - Scaffold( - modifier = modifier, - containerColor = TangemTheme.colors.background.secondary, - topBar = { + Box( + modifier = modifier + .background(TangemTheme.colors.background.secondary), + ) { + Column( + modifier = Modifier.fillMaxSize(), + ) { TangemTopAppBar( - modifier = Modifier.statusBarsPadding(), + modifier = Modifier, startButton = TopAppBarButtonUM( iconRes = R.drawable.ic_back_24, onIconClicked = state.onBackClick, ), title = state.nftAsset.name, ) - }, - content = { innerPadding -> + TangemPullToRefreshContainer( config = state.pullToRefreshConfig, - modifier = Modifier - .padding(innerPadding) - .fillMaxSize(), + modifier = Modifier.fillMaxSize(), ) { NFTDetailsAsset( state = state.nftAsset, @@ -49,16 +46,19 @@ internal fun NFTDetails(state: NFTDetailsUM, modifier: Modifier = Modifier) { onExploreClick = state.onExploreClick, ) } - }, - floatingActionButtonPosition = FabPosition.Center, - floatingActionButton = { - PrimaryButton( - modifier = Modifier - .padding(horizontal = TangemTheme.dimens.spacing16) - .fillMaxWidth(), - text = stringResourceSafe(id = R.string.common_send), - onClick = state.onSendClick, - ) - }, - ) + } + + PrimaryButton( + modifier = Modifier + .align(Alignment.BottomCenter) + .padding( + start = TangemTheme.dimens.spacing16, + end = TangemTheme.dimens.spacing16, + bottom = TangemTheme.dimens.spacing16, + ) + .fillMaxWidth(), + text = stringResourceSafe(id = R.string.common_send), + onClick = state.onSendClick, + ) + } } \ No newline at end of file diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceive.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceive.kt index 4dac3a8d5c..21c147c3a9 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceive.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/receive/ui/NFTReceive.kt @@ -1,8 +1,8 @@ package com.tangem.features.nft.receive.ui import androidx.activity.compose.BackHandler +import androidx.compose.foundation.background import androidx.compose.foundation.layout.* -import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.tangem.common.ui.bottomsheet.receive.TokenReceiveBottomSheet @@ -22,41 +22,33 @@ import com.tangem.features.nft.receive.entity.NFTReceiveUM internal fun NFTReceive(state: NFTReceiveUM, modifier: Modifier = Modifier) { BackHandler(onBack = state.onBackClick) - Scaffold( - modifier = modifier, - containerColor = TangemTheme.colors.background.secondary, - topBar = { - TangemTopAppBar( - modifier = Modifier.statusBarsPadding(), - startButton = TopAppBarButtonUM( - iconRes = R.drawable.ic_close_24, - onIconClicked = state.onBackClick, - ), - title = stringResourceSafe(id = R.string.nft_receive_title), - subtitle = state.appBarSubtitle.resolveReference(), - ) - }, - content = { innerPadding -> - Column( - modifier = Modifier - .padding(innerPadding) - .fillMaxSize(), - ) { - SearchBar( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = TangemTheme.dimens.spacing16), - state = state.search, - colors = TangemSearchBarDefaults.secondaryTextFieldColors, - ) + Column( + modifier = modifier + .background(TangemTheme.colors.background.secondary), + ) { + TangemTopAppBar( + modifier = Modifier, + startButton = TopAppBarButtonUM( + iconRes = R.drawable.ic_close_24, + onIconClicked = state.onBackClick, + ), + title = stringResourceSafe(id = R.string.nft_receive_title), + subtitle = state.appBarSubtitle.resolveReference(), + ) - when (val networks = state.networks) { - is NFTReceiveUM.Networks.Content -> NFTReceiveNetworksContent(networks) - is NFTReceiveUM.Networks.Empty -> NFTReceiveNetworksEmpty() - } - } - }, - ) + SearchBar( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = TangemTheme.dimens.spacing16), + state = state.search, + colors = TangemSearchBarDefaults.secondaryTextFieldColors, + ) + + when (val networks = state.networks) { + is NFTReceiveUM.Networks.Content -> NFTReceiveNetworksContent(networks) + is NFTReceiveUM.Networks.Empty -> NFTReceiveNetworksEmpty() + } + } ShowBottomSheet(state.bottomSheetConfig) } diff --git a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/traits/ui/NFTAssetTraits.kt b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/traits/ui/NFTAssetTraits.kt index f6e27276f2..9f18df108f 100644 --- a/features/nft/impl/src/main/kotlin/com/tangem/features/nft/traits/ui/NFTAssetTraits.kt +++ b/features/nft/impl/src/main/kotlin/com/tangem/features/nft/traits/ui/NFTAssetTraits.kt @@ -1,9 +1,8 @@ package com.tangem.features.nft.traits.ui import androidx.activity.compose.BackHandler -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.statusBarsPadding -import androidx.compose.material3.Scaffold +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.tangem.core.ui.components.appbar.TangemTopAppBar @@ -17,25 +16,21 @@ import com.tangem.features.nft.traits.entity.NFTAssetTraitsUM internal fun NFTAssetTraits(state: NFTAssetTraitsUM, modifier: Modifier = Modifier) { BackHandler(onBack = state.onBackClick) - Scaffold( - modifier = modifier, - containerColor = TangemTheme.colors.background.secondary, - topBar = { - TangemTopAppBar( - modifier = Modifier.statusBarsPadding(), - startButton = TopAppBarButtonUM( - iconRes = R.drawable.ic_back_24, - onIconClicked = state.onBackClick, - ), - title = stringResourceSafe(R.string.nft_traits_title), - ) - }, - content = { innerPadding -> - NFTAssetTraitsContent( - modifier = Modifier - .padding(innerPadding), - state = state, - ) - }, - ) + Column( + modifier = modifier + .background(TangemTheme.colors.background.secondary), + ) { + TangemTopAppBar( + modifier = Modifier, + startButton = TopAppBarButtonUM( + iconRes = R.drawable.ic_back_24, + onIconClicked = state.onBackClick, + ), + title = stringResourceSafe(R.string.nft_traits_title), + ) + + NFTAssetTraitsContent( + state = state, + ) + } } \ No newline at end of file