Updated on 2026-08-14
This commit is contained in:
parent
ff55704d32
commit
9e2eb5710b
82 changed files with 1150 additions and 401 deletions
|
|
@ -3,6 +3,7 @@ package com.tangem.core.ui.components.inputrow
|
|||
import android.content.res.Configuration
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.Icon
|
||||
|
|
@ -15,6 +16,7 @@ import androidx.compose.ui.draw.clip
|
|||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.graphics.vector.rememberVectorPainter
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.tangem.core.ui.R
|
||||
|
|
@ -35,7 +37,7 @@ import com.tangem.core.ui.res.TangemThemePreview
|
|||
* @param modifier modifier
|
||||
* @param caption caption text
|
||||
* @param imageUrl icon to load
|
||||
* @param iconRes icon resource
|
||||
* @param iconResVector icon resource
|
||||
* @param subtitleColor subtitle text color
|
||||
* @param captionColor caption text color
|
||||
* @param iconTint icon tint
|
||||
|
|
@ -47,12 +49,13 @@ import com.tangem.core.ui.res.TangemThemePreview
|
|||
*/
|
||||
@Suppress("LongMethod")
|
||||
@Composable
|
||||
internal fun InputRowImageBase(
|
||||
fun InputRowImageBase(
|
||||
subtitle: TextReference,
|
||||
modifier: Modifier = Modifier,
|
||||
caption: TextReference? = null,
|
||||
imageUrl: String? = null,
|
||||
@DrawableRes iconRes: Int? = null,
|
||||
@DrawableRes iconResVector: Int? = null,
|
||||
@DrawableRes iconResWebp: Int? = null,
|
||||
subtitleColor: Color = TangemTheme.colors.text.primary1,
|
||||
captionColor: Color = TangemTheme.colors.text.tertiary,
|
||||
iconTint: Color = TangemTheme.colors.icon.informative,
|
||||
|
|
@ -76,7 +79,7 @@ internal fun InputRowImageBase(
|
|||
.clip(TangemTheme.shapes.roundedCornersXLarge),
|
||||
)
|
||||
SpacerW12()
|
||||
} else if (iconRes != null) {
|
||||
} else if (iconResVector != null) {
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier
|
||||
|
|
@ -85,13 +88,20 @@ internal fun InputRowImageBase(
|
|||
.background(iconTint.copy(alpha = 0.08f)),
|
||||
) {
|
||||
Icon(
|
||||
painter = rememberVectorPainter(image = ImageVector.vectorResource(id = iconRes)),
|
||||
painter = rememberVectorPainter(image = ImageVector.vectorResource(id = iconResVector)),
|
||||
tint = iconTint,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(TangemTheme.dimens.size18),
|
||||
)
|
||||
}
|
||||
SpacerW12()
|
||||
} else if (iconResWebp != null) {
|
||||
Image(
|
||||
painter = painterResource(iconResWebp),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(TangemTheme.dimens.size36),
|
||||
)
|
||||
SpacerW12()
|
||||
}
|
||||
Column {
|
||||
Row {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ fun InputRowImageInfo(
|
|||
subtitle = subtitle,
|
||||
caption = caption,
|
||||
imageUrl = imageUrl,
|
||||
iconRes = iconRes,
|
||||
iconResVector = iconRes,
|
||||
iconTint = iconTint,
|
||||
subtitleColor = subtitleColor,
|
||||
captionColor = captionColor,
|
||||
|
|
|
|||
BIN
core/ui/src/main/res/drawable/img_visa_36.webp
Normal file
BIN
core/ui/src/main/res/drawable/img_visa_36.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue