Updated on 2026-08-14
This commit is contained in:
parent
0a6b47b668
commit
71038ca2d8
39 changed files with 1073 additions and 89 deletions
|
|
@ -17,10 +17,7 @@ import androidx.compose.ui.graphics.BlendMode
|
|||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import com.tangem.core.ui.res.LocalIsInDarkTheme
|
||||
import com.tangem.core.ui.res.TangemColorPalette
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.*
|
||||
import com.valentinilk.shimmer.*
|
||||
|
||||
/**
|
||||
|
|
@ -31,7 +28,7 @@ fun RectangleShimmer(modifier: Modifier = Modifier, radius: Dp = TangemTheme.dim
|
|||
Box(
|
||||
modifier = modifier
|
||||
.clip(RoundedCornerShape(size = radius))
|
||||
.shimmer(TangemShimmer),
|
||||
.shimmer(LocalTangemShimmer.current),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -44,11 +41,11 @@ fun CircleShimmer(modifier: Modifier = Modifier) {
|
|||
Box(
|
||||
modifier = modifier
|
||||
.clip(CircleShape)
|
||||
.shimmer(TangemShimmer),
|
||||
.shimmer(LocalTangemShimmer.current),
|
||||
)
|
||||
}
|
||||
|
||||
private val TangemShimmer: Shimmer
|
||||
internal val TangemShimmer: Shimmer
|
||||
@Composable
|
||||
get() = rememberShimmer(
|
||||
shimmerBounds = ShimmerBounds.View,
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@ import android.content.res.Configuration
|
|||
import androidx.compose.animation.animateColorAsState
|
||||
import androidx.compose.animation.core.Spring
|
||||
import androidx.compose.animation.core.spring
|
||||
import androidx.compose.foundation.LocalIndication
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.*
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
|
|
@ -18,6 +16,7 @@ import androidx.compose.ui.graphics.Color
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
|
|
@ -57,12 +56,14 @@ inline fun <reified T> SegmentedButtons(
|
|||
val index = if (initialSelectedItem == null) 0 else config.indexOf(initialSelectedItem)
|
||||
mutableIntStateOf(index)
|
||||
}
|
||||
val shape = RoundedCornerShape(TangemTheme.dimens.radius26)
|
||||
|
||||
Row(
|
||||
modifier = modifier
|
||||
.clip(RoundedCornerShape(TangemTheme.dimens.radius26))
|
||||
.clip(shape)
|
||||
.background(dividerColor)
|
||||
.padding(TangemTheme.dimens.spacing1),
|
||||
.border(BorderStroke(1.dp, dividerColor), shape = shape)
|
||||
.height(IntrinsicSize.Max),
|
||||
horizontalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing1),
|
||||
) {
|
||||
repeat(config.size) { index ->
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.tangem.core.ui.components.fields
|
|||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
|
|
@ -37,7 +37,7 @@ fun SearchBar(state: SearchBarUM, modifier: Modifier = Modifier, colors: TextFie
|
|||
TextField(
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.height(TangemTheme.dimens.size48)
|
||||
.heightIn(min = TangemTheme.dimens.size48)
|
||||
.onFocusChanged {
|
||||
if (it.isFocused) {
|
||||
state.onActiveChange(true)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,5 @@ import androidx.compose.ui.Modifier
|
|||
fun interface ComposableContentComponent {
|
||||
|
||||
@Composable
|
||||
@Suppress("TopLevelComposableFunctions") // TODO: Remove this check
|
||||
fun Content(modifier: Modifier)
|
||||
}
|
||||
|
|
@ -9,6 +9,5 @@ interface ComposableDialogComponent {
|
|||
val doOnDismiss: () -> Unit
|
||||
|
||||
@Composable
|
||||
@Suppress("TopLevelComposableFunctions") // TODO: Remove this check
|
||||
fun Dialog()
|
||||
}
|
||||
|
|
@ -7,9 +7,11 @@ import androidx.compose.material3.SnackbarHostState
|
|||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import com.google.accompanist.systemuicontroller.rememberSystemUiController
|
||||
import com.tangem.core.ui.components.TangemShimmer
|
||||
import com.tangem.core.ui.haptic.HapticManager
|
||||
import com.tangem.core.ui.haptic.MockHapticManager
|
||||
import com.tangem.core.ui.windowsize.WindowSize
|
||||
import com.valentinilk.shimmer.Shimmer
|
||||
|
||||
@Composable
|
||||
fun TangemTheme(
|
||||
|
|
@ -49,10 +51,14 @@ fun TangemTheme(
|
|||
LocalSnackbarHostState provides snackbarHostState,
|
||||
LocalWindowSize provides windowSize,
|
||||
) {
|
||||
ProvideTextStyle(
|
||||
value = TangemTheme.typography.body1,
|
||||
content = content,
|
||||
)
|
||||
CompositionLocalProvider(
|
||||
LocalTangemShimmer provides TangemShimmer,
|
||||
) {
|
||||
ProvideTextStyle(
|
||||
value = TangemTheme.typography.body1,
|
||||
content = content,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -227,4 +233,8 @@ val LocalSnackbarHostState = staticCompositionLocalOf<SnackbarHostState> {
|
|||
|
||||
val LocalWindowSize = staticCompositionLocalOf<WindowSize> {
|
||||
error("No WindowSize provided")
|
||||
}
|
||||
|
||||
val LocalTangemShimmer = staticCompositionLocalOf<Shimmer> {
|
||||
error("No TangemShimmer provided")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue