Updated on 2026-08-14
This commit is contained in:
parent
97dc754f0f
commit
b3fe4cbe05
4 changed files with 81 additions and 75 deletions
|
|
@ -6,11 +6,9 @@ import androidx.compose.animation.fadeIn
|
|||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.animation.togetherWith
|
||||
import androidx.compose.foundation.Canvas
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.ripple.rememberRipple
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.statusBarsPadding
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
|
|
@ -20,12 +18,13 @@ import androidx.compose.ui.graphics.PathEffect
|
|||
import androidx.compose.ui.graphics.StrokeJoin
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.drawText
|
||||
import androidx.compose.ui.text.rememberTextMeasurer
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.Constraints
|
||||
import com.tangem.core.ui.components.appbar.AppBarWithBackButtonAndIconContent
|
||||
import com.tangem.core.ui.components.appbar.TangemTopAppBar
|
||||
import com.tangem.core.ui.components.appbar.TopAppBarButton
|
||||
import com.tangem.core.ui.components.appbar.models.TopAppBarButtonUM
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.res.TangemColorPalette
|
||||
|
|
@ -59,46 +58,37 @@ internal fun QrScanningContent(
|
|||
Overlay(
|
||||
message = uiState.message,
|
||||
)
|
||||
AppBarWithBackButtonAndIconContent(
|
||||
onBackClick = uiState.onBackClick,
|
||||
|
||||
TangemTopAppBar(
|
||||
modifier = Modifier.statusBarsPadding(),
|
||||
backgroundColor = Color.Transparent,
|
||||
backIconTint = TangemColorPalette.White,
|
||||
iconContent = {
|
||||
Row {
|
||||
AnimatedContent(
|
||||
targetState = isFlash,
|
||||
transitionSpec = { fadeIn().togetherWith(fadeOut()) },
|
||||
label = "Flash Change",
|
||||
) {
|
||||
val flashIconRes = if (it) R.drawable.ic_flash_on_24 else R.drawable.ic_flash_off_24
|
||||
Icon(
|
||||
painter = painterResource(flashIconRes),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.padding(end = TangemTheme.dimens.spacing20)
|
||||
.size(size = TangemTheme.dimens.size24)
|
||||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = rememberRipple(bounded = false),
|
||||
onClick = { isFlash = !isFlash },
|
||||
),
|
||||
tint = TangemColorPalette.White,
|
||||
)
|
||||
}
|
||||
Icon(
|
||||
painter = painterResource(R.drawable.ic_gallery_24),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.size(size = TangemTheme.dimens.size24)
|
||||
.clickable(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
indication = rememberRipple(bounded = false),
|
||||
onClick = uiState.onGalleryClick,
|
||||
),
|
||||
title = null,
|
||||
startButton = TopAppBarButtonUM.Back(uiState.onBackClick),
|
||||
iconTint = TangemColorPalette.White,
|
||||
containerColor = Color.Transparent,
|
||||
endContent = {
|
||||
AnimatedContent(
|
||||
targetState = isFlash,
|
||||
transitionSpec = { fadeIn().togetherWith(fadeOut()) },
|
||||
label = "Flash Change",
|
||||
) {
|
||||
TopAppBarButton(
|
||||
button = TopAppBarButtonUM(
|
||||
iconRes = if (it) R.drawable.ic_flash_on_24 else R.drawable.ic_flash_off_24,
|
||||
onIconClicked = {
|
||||
isFlash = !isFlash
|
||||
},
|
||||
),
|
||||
tint = TangemColorPalette.White,
|
||||
)
|
||||
}
|
||||
|
||||
TopAppBarButton(
|
||||
button = TopAppBarButtonUM(
|
||||
iconRes = R.drawable.ic_gallery_24,
|
||||
onIconClicked = uiState.onGalleryClick,
|
||||
),
|
||||
tint = TangemColorPalette.White,
|
||||
)
|
||||
},
|
||||
)
|
||||
if (uiState.bottomSheetConfig != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue