Updated on 2026-08-14
This commit is contained in:
commit
507169a2c3
492 changed files with 5734 additions and 12510 deletions
|
|
@ -0,0 +1,89 @@
|
|||
package com.tangem.core.ui.components
|
||||
|
||||
import androidx.compose.animation.core.AnimationSpec
|
||||
import androidx.compose.animation.core.animateDpAsState
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.systemBars
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Stable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.composed
|
||||
import androidx.compose.ui.draw.drawWithContent
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.geometry.Size
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
||||
@Composable
|
||||
fun Modifier.edgeFade(
|
||||
vararg positions: FadePosition,
|
||||
size: Dp,
|
||||
isVisible: Boolean = true,
|
||||
animationSpec: AnimationSpec<Dp>? = null,
|
||||
color: Color = TangemTheme.colors.background.secondary,
|
||||
): Modifier = composed {
|
||||
require(value = size > 0.dp) {
|
||||
"Size must be greater than '0'"
|
||||
}
|
||||
val animatedSize = animationSpec?.let {
|
||||
animateDpAsState(
|
||||
targetValue = if (isVisible) size else 0.dp,
|
||||
animationSpec = it,
|
||||
label = "Edge fade width",
|
||||
)
|
||||
}
|
||||
|
||||
drawWithContent {
|
||||
drawContent()
|
||||
|
||||
positions.forEach { side ->
|
||||
val (start, end) = this.size.getFadeOffsets(side)
|
||||
|
||||
val staticSizePx = if (isVisible) size.toPx() else 0f
|
||||
val sizePx = animatedSize?.value?.toPx() ?: staticSizePx
|
||||
|
||||
val fraction = when (side) {
|
||||
FadePosition.LEFT, FadePosition.RIGHT -> sizePx / this.size.width
|
||||
FadePosition.BOTTOM, FadePosition.TOP -> sizePx / this.size.height
|
||||
}
|
||||
|
||||
drawRect(
|
||||
brush = Brush.linearGradient(
|
||||
0f to color,
|
||||
fraction to Color.Transparent,
|
||||
start = start,
|
||||
end = end,
|
||||
),
|
||||
size = this.size,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Modifier.bottomFade(
|
||||
height: Dp = with(LocalDensity.current) { WindowInsets.systemBars.getBottom(this).toDp() } + 96.dp,
|
||||
color: Color = TangemTheme.colors.background.secondary,
|
||||
): Modifier = edgeFade(
|
||||
FadePosition.BOTTOM,
|
||||
size = height,
|
||||
color = color,
|
||||
)
|
||||
|
||||
enum class FadePosition {
|
||||
TOP, BOTTOM, LEFT, RIGHT;
|
||||
}
|
||||
|
||||
@Stable
|
||||
private fun Size.getFadeOffsets(position: FadePosition): Pair<Offset, Offset> {
|
||||
return when (position) {
|
||||
FadePosition.LEFT -> Offset.Zero to Offset(width, 0f)
|
||||
FadePosition.RIGHT -> Offset(width, y = 0f) to Offset.Zero
|
||||
FadePosition.BOTTOM -> Offset(x = 0f, height) to Offset.Zero
|
||||
FadePosition.TOP -> Offset.Zero to Offset(x = 0f, height)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.tangem.core.ui.components.audits
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.ReadOnlyComposable
|
||||
import androidx.compose.ui.Modifier
|
||||
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 com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
|
||||
/**
|
||||
* Audit label component
|
||||
*
|
||||
* @param state state
|
||||
* @param modifier modifier
|
||||
*
|
||||
* @see <a href="https://www.figma.com/design/14ISV23YB1yVW1uNVwqrKv/Android?node-id=3401-3635&t=kjnj9RhYUOwbO1hn-4">Figma</a>
|
||||
*
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
@Composable
|
||||
fun AuditLabel(state: AuditLabelUM, modifier: Modifier = Modifier) {
|
||||
AuditLabelInternal(
|
||||
textReference = state.text,
|
||||
textColor = getColorByType(state.type),
|
||||
backgroundColor = getColorByType(state.type).copy(alpha = 0.1f),
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AuditLabelInternal(
|
||||
textReference: TextReference,
|
||||
textColor: Color,
|
||||
backgroundColor: Color,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Box(
|
||||
modifier = modifier.background(
|
||||
color = backgroundColor,
|
||||
shape = TangemTheme.shapes.roundedCornersSmall2,
|
||||
),
|
||||
) {
|
||||
Text(
|
||||
text = textReference.resolveReference(),
|
||||
style = TangemTheme.typography.caption1,
|
||||
color = textColor,
|
||||
modifier = Modifier.padding(horizontal = TangemTheme.dimens.spacing4),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ReadOnlyComposable
|
||||
@Composable
|
||||
private fun getColorByType(type: AuditLabelUM.Type): Color {
|
||||
return when (type) {
|
||||
AuditLabelUM.Type.Prohibition -> TangemTheme.colors.text.warning
|
||||
AuditLabelUM.Type.Warning -> TangemTheme.colors.text.attention
|
||||
AuditLabelUM.Type.Permit -> TangemTheme.colors.text.accent
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun Preview_AuditLabel(@PreviewParameter(AuditLabelUMProvider::class) state: AuditLabelUM) {
|
||||
TangemThemePreview {
|
||||
AuditLabel(state = state)
|
||||
}
|
||||
}
|
||||
|
||||
private class AuditLabelUMProvider : CollectionPreviewParameterProvider<AuditLabelUM>(
|
||||
collection = AuditLabelUM.Type.entries.map { type ->
|
||||
AuditLabelUM(
|
||||
text = TextReference.Str(value = type.name),
|
||||
type = type,
|
||||
)
|
||||
},
|
||||
)
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.tangem.core.ui.components.audits
|
||||
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
|
||||
/**
|
||||
* Audit label component UI model
|
||||
*
|
||||
* @property text text reference
|
||||
* @property type type of label
|
||||
*
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
data class AuditLabelUM(val text: TextReference, val type: Type) {
|
||||
|
||||
enum class Type {
|
||||
|
||||
/** Red. Like, "risky" */
|
||||
Prohibition,
|
||||
|
||||
/** Yellow. Like, "caution" */
|
||||
Warning,
|
||||
|
||||
/** Blue. Like, "trusted" */
|
||||
Permit,
|
||||
}
|
||||
}
|
||||
|
|
@ -71,7 +71,7 @@ fun Notification(
|
|||
title = config.title,
|
||||
subtitle = config.subtitle,
|
||||
subtitleColor = subtitleColor,
|
||||
isClickableComponent = isEnabled && config.onClick != null,
|
||||
showArrowIcon = isEnabled && config.showArrowIcon,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ private fun MainContent(
|
|||
title: TextReference?,
|
||||
subtitle: TextReference,
|
||||
subtitleColor: Color,
|
||||
isClickableComponent: Boolean,
|
||||
showArrowIcon: Boolean,
|
||||
) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(
|
||||
|
|
@ -145,7 +145,7 @@ private fun MainContent(
|
|||
|
||||
TextsBlock(title = title, subtitle = subtitle, subtitleColor = subtitleColor)
|
||||
|
||||
if (isClickableComponent) {
|
||||
if (showArrowIcon) {
|
||||
SpacerWMax()
|
||||
|
||||
Icon(
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ data class NotificationConfig(
|
|||
val buttonsState: ButtonsState? = null,
|
||||
val onClick: (() -> Unit)? = null,
|
||||
val onCloseClick: (() -> Unit)? = null,
|
||||
val showArrowIcon: Boolean = onClick != null,
|
||||
) {
|
||||
|
||||
sealed class ButtonsState {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,13 @@ import androidx.compose.ui.tooling.preview.PreviewParameter
|
|||
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
|
||||
import androidx.compose.ui.unit.Constraints
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.audits.AuditLabelUM
|
||||
import com.tangem.core.ui.components.currency.icon.CurrencyIcon
|
||||
import com.tangem.core.ui.components.currency.icon.CurrencyIconState
|
||||
import com.tangem.core.ui.components.marketprice.PriceChangeType
|
||||
import com.tangem.core.ui.components.token.internal.*
|
||||
import com.tangem.core.ui.components.token.state.TokenItemState
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.rememberHapticFeedback
|
||||
import com.tangem.core.ui.res.TangemColorPalette
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
|
@ -122,7 +124,7 @@ fun TokenItem(
|
|||
)
|
||||
|
||||
TokenCryptoAmount(
|
||||
state = state.cryptoAmountState,
|
||||
state = state.subtitle2State,
|
||||
isBalanceHidden = isBalanceHidden,
|
||||
modifier = Modifier.layoutId(layoutId = LayoutId.CRYPTO_AMOUNT),
|
||||
)
|
||||
|
|
@ -461,7 +463,7 @@ private class TokenItemStateProvider : CollectionPreviewParameterProvider<TokenI
|
|||
text = "3213123123321312312312312312 $",
|
||||
hasStaked = true,
|
||||
),
|
||||
cryptoAmountState = TokenItemState.CryptoAmountState.Content(text = "5,4123123213123123123123123123 MATIC"),
|
||||
subtitle2State = TokenItemState.Subtitle2State.TextContent(text = "5,4123123213123123123123123123 MATIC"),
|
||||
subtitleState = TokenItemState.SubtitleState.CryptoPriceContent(
|
||||
price = "312 USD",
|
||||
priceChangePercent = "42.0%",
|
||||
|
|
@ -500,14 +502,33 @@ private class TokenItemStateProvider : CollectionPreviewParameterProvider<TokenI
|
|||
id = UUID.randomUUID().toString(),
|
||||
iconState = tokenIconState,
|
||||
titleState = TokenItemState.TitleState.Content(text = "Polygon"),
|
||||
cryptoAmountState = TokenItemState.CryptoAmountState.Content(text = "3 172,14 $"),
|
||||
subtitle2State = TokenItemState.Subtitle2State.TextContent(text = "3 172,14 $"),
|
||||
),
|
||||
TokenItemState.Content(
|
||||
id = UUID.randomUUID().toString(),
|
||||
iconState = tokenIconState,
|
||||
titleState = TokenItemState.TitleState.Content(text = "Polygon"),
|
||||
fiatAmountState = TokenItemState.FiatAmountState.Content(text = "321 $", hasStaked = false),
|
||||
cryptoAmountState = TokenItemState.CryptoAmountState.Content(text = "5,412 MATIC"),
|
||||
subtitle2State = TokenItemState.Subtitle2State.TextContent(text = "5,412 MATIC"),
|
||||
subtitleState = TokenItemState.SubtitleState.CryptoPriceContent(
|
||||
price = "312 USD",
|
||||
priceChangePercent = "2.0%",
|
||||
type = PriceChangeType.UP,
|
||||
),
|
||||
onItemClick = {},
|
||||
onItemLongClick = {},
|
||||
),
|
||||
TokenItemState.Content(
|
||||
id = UUID.randomUUID().toString(),
|
||||
iconState = tokenIconState,
|
||||
titleState = TokenItemState.TitleState.Content(text = "Polygon"),
|
||||
fiatAmountState = TokenItemState.FiatAmountState.Content(text = "321 $", hasStaked = false),
|
||||
subtitle2State = TokenItemState.Subtitle2State.LabelContent(
|
||||
auditLabelUM = AuditLabelUM(
|
||||
text = TextReference.Str(value = "Trusted"),
|
||||
type = AuditLabelUM.Type.Permit,
|
||||
),
|
||||
),
|
||||
subtitleState = TokenItemState.SubtitleState.CryptoPriceContent(
|
||||
price = "312 USD",
|
||||
priceChangePercent = "2.0%",
|
||||
|
|
@ -573,7 +594,7 @@ private class TokenItemStateProvider : CollectionPreviewParameterProvider<TokenI
|
|||
iconState = coinIconState,
|
||||
titleState = TokenItemState.TitleState.Content(text = "Polygon", hasPending = true),
|
||||
fiatAmountState = TokenItemState.FiatAmountState.Content(text = "321 $", hasStaked = true),
|
||||
cryptoAmountState = TokenItemState.CryptoAmountState.Content(text = "5,412 MATIC"),
|
||||
subtitle2State = TokenItemState.Subtitle2State.TextContent(text = "5,412 MATIC"),
|
||||
subtitleState = TokenItemState.SubtitleState.Unknown,
|
||||
onItemClick = {},
|
||||
onItemLongClick = {},
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@ import androidx.compose.ui.res.stringResource
|
|||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.RectangleShimmer
|
||||
import com.tangem.core.ui.components.audits.AuditLabel
|
||||
import com.tangem.core.ui.components.token.state.TokenItemState
|
||||
import com.tangem.core.ui.extensions.orMaskWithStars
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.components.token.state.TokenItemState.CryptoAmountState as TokenCryptoAmountState
|
||||
import com.tangem.core.ui.components.token.state.TokenItemState.Subtitle2State as TokenCryptoAmountState
|
||||
|
||||
@Composable
|
||||
internal fun TokenCryptoAmount(
|
||||
|
|
@ -21,12 +23,15 @@ internal fun TokenCryptoAmount(
|
|||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
when (state) {
|
||||
is TokenCryptoAmountState.Content -> {
|
||||
is TokenCryptoAmountState.TextContent -> {
|
||||
CryptoAmountText(
|
||||
amount = state.text.orMaskWithStars(isBalanceHidden),
|
||||
modifier = modifier,
|
||||
)
|
||||
}
|
||||
is TokenItemState.Subtitle2State.LabelContent -> {
|
||||
AuditLabel(state = state.auditLabelUM, modifier = modifier)
|
||||
}
|
||||
is TokenCryptoAmountState.Unreachable -> {
|
||||
CryptoAmountText(amount = stringResource(id = R.string.common_unreachable), modifier = modifier)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.core.ui.components.token.state
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import com.tangem.core.ui.components.audits.AuditLabelUM
|
||||
import com.tangem.core.ui.components.currency.icon.CurrencyIconState
|
||||
import com.tangem.core.ui.components.marketprice.PriceChangeType
|
||||
|
||||
|
|
@ -17,14 +18,17 @@ sealed class TokenItemState {
|
|||
/** Token title state (in one row with [fiatAmountState]) */
|
||||
abstract val titleState: TitleState
|
||||
|
||||
/** Token subtitle state (under [titleState] and in one row with [cryptoAmountState]) */
|
||||
/** Token subtitle state (under [titleState] and in one row with [subtitle2State]) */
|
||||
abstract val subtitleState: SubtitleState?
|
||||
|
||||
/** Token fiat amount state (in one row with [titleState]) */
|
||||
abstract val fiatAmountState: FiatAmountState?
|
||||
|
||||
/** Token crypto amount state (under [fiatAmountState] and in one row with [subtitleState]) */
|
||||
abstract val cryptoAmountState: CryptoAmountState?
|
||||
/**
|
||||
* Second subtitle state (under [fiatAmountState] and in one row with [subtitleState]).
|
||||
* Example, token crypto amount.
|
||||
*/
|
||||
abstract val subtitle2State: Subtitle2State?
|
||||
|
||||
/** Callback which will be called when an item is clicked */
|
||||
abstract val onItemClick: (() -> Unit)?
|
||||
|
|
@ -42,12 +46,12 @@ sealed class TokenItemState {
|
|||
*/
|
||||
data class Loading(
|
||||
override val id: String,
|
||||
override val iconState: CurrencyIconState,
|
||||
override val titleState: TitleState.Content,
|
||||
override val iconState: CurrencyIconState = CurrencyIconState.Loading,
|
||||
override val titleState: TitleState = TitleState.Loading,
|
||||
override val subtitleState: SubtitleState = SubtitleState.Loading,
|
||||
) : TokenItemState() {
|
||||
override val fiatAmountState: FiatAmountState = FiatAmountState.Loading
|
||||
override val cryptoAmountState: CryptoAmountState = CryptoAmountState.Loading
|
||||
override val subtitle2State: Subtitle2State = Subtitle2State.Loading
|
||||
override val onItemClick: (() -> Unit)? = null
|
||||
override val onItemLongClick: (() -> Unit)? = null
|
||||
}
|
||||
|
|
@ -62,7 +66,7 @@ sealed class TokenItemState {
|
|||
override val titleState: TitleState = TitleState.Locked
|
||||
override val subtitleState: SubtitleState = SubtitleState.Locked
|
||||
override val fiatAmountState: FiatAmountState = FiatAmountState.Locked
|
||||
override val cryptoAmountState: CryptoAmountState = CryptoAmountState.Locked
|
||||
override val subtitle2State: Subtitle2State = Subtitle2State.Locked
|
||||
override val onItemClick: (() -> Unit)? = null
|
||||
override val onItemLongClick: (() -> Unit)? = null
|
||||
}
|
||||
|
|
@ -75,7 +79,7 @@ sealed class TokenItemState {
|
|||
* @property titleState token title
|
||||
* @property subtitleState token subtitle
|
||||
* @property fiatAmountState token fiat amount
|
||||
* @property cryptoAmountState token crypto amount
|
||||
* @property subtitle2State token crypto amount
|
||||
* @property onItemClick callback which will be called when an item is clicked
|
||||
* @property onItemLongClick callback which will be called when an item is long clicked
|
||||
*/
|
||||
|
|
@ -85,7 +89,7 @@ sealed class TokenItemState {
|
|||
override val titleState: TitleState,
|
||||
override val subtitleState: SubtitleState,
|
||||
override val fiatAmountState: FiatAmountState,
|
||||
override val cryptoAmountState: CryptoAmountState.Content,
|
||||
override val subtitle2State: Subtitle2State,
|
||||
override val onItemClick: (() -> Unit)?,
|
||||
override val onItemLongClick: (() -> Unit)?,
|
||||
) : TokenItemState()
|
||||
|
|
@ -96,13 +100,13 @@ sealed class TokenItemState {
|
|||
* @property id unique id
|
||||
* @property iconState token icon state
|
||||
* @property titleState token title
|
||||
* @property cryptoAmountState token crypto amount
|
||||
* @property subtitle2State token crypto amount
|
||||
*/
|
||||
data class Draggable(
|
||||
override val id: String,
|
||||
override val iconState: CurrencyIconState,
|
||||
override val titleState: TitleState,
|
||||
override val cryptoAmountState: CryptoAmountState,
|
||||
override val subtitle2State: Subtitle2State,
|
||||
) : TokenItemState() {
|
||||
override val subtitleState: SubtitleState? = null
|
||||
override val fiatAmountState: FiatAmountState? = null
|
||||
|
|
@ -129,7 +133,7 @@ sealed class TokenItemState {
|
|||
override val onItemLongClick: (() -> Unit)?,
|
||||
) : TokenItemState() {
|
||||
override val fiatAmountState: FiatAmountState? = null
|
||||
override val cryptoAmountState: CryptoAmountState? = null
|
||||
override val subtitle2State: Subtitle2State? = null
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -149,7 +153,7 @@ sealed class TokenItemState {
|
|||
override val onItemLongClick: (() -> Unit)?,
|
||||
) : TokenItemState() {
|
||||
override val fiatAmountState: FiatAmountState? = null
|
||||
override val cryptoAmountState: CryptoAmountState? = null
|
||||
override val subtitle2State: Subtitle2State? = null
|
||||
override val onItemClick: (() -> Unit)? = null
|
||||
}
|
||||
|
||||
|
|
@ -194,13 +198,16 @@ sealed class TokenItemState {
|
|||
}
|
||||
|
||||
@Immutable
|
||||
sealed class CryptoAmountState {
|
||||
data class Content(val text: String) : CryptoAmountState()
|
||||
sealed class Subtitle2State {
|
||||
|
||||
data object Unreachable : CryptoAmountState()
|
||||
data class TextContent(val text: String) : Subtitle2State()
|
||||
|
||||
data object Loading : CryptoAmountState()
|
||||
data class LabelContent(val auditLabelUM: AuditLabelUM) : Subtitle2State()
|
||||
|
||||
data object Locked : CryptoAmountState()
|
||||
data object Unreachable : Subtitle2State()
|
||||
|
||||
data object Loading : Subtitle2State()
|
||||
|
||||
data object Locked : Subtitle2State()
|
||||
}
|
||||
}
|
||||
|
|
@ -76,6 +76,9 @@ fun getActiveIconRes(blockchainId: String): Int {
|
|||
"sei", "sei/test" -> R.drawable.img_sei_22
|
||||
"internet-computer" -> R.drawable.img_icp_22
|
||||
"sui", "sui/test" -> R.drawable.img_sui_22
|
||||
"energy-web-chain", "energy-web-chain/test" -> R.drawable.img_energy_web_22
|
||||
"energy-web-x", "energy-web-x/test" -> R.drawable.img_energy_web_22
|
||||
"core", "core/test" -> R.drawable.img_core_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -153,6 +156,9 @@ fun getActiveIconResByNetworkId(networkId: String): Int {
|
|||
"sei", "sei/test" -> R.drawable.img_sei_22
|
||||
"internet-computer" -> R.drawable.img_icp_22
|
||||
"sui", "sui/test" -> R.drawable.img_sui_22
|
||||
"energy-web-chain", "energy-web-chain/test" -> R.drawable.img_energy_web_22
|
||||
"energy-web-x", "energy-web-x/test" -> R.drawable.img_energy_web_22
|
||||
"core", "core/test" -> R.drawable.img_core_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -227,6 +233,9 @@ fun getActiveIconResByCoinId(coinId: String): Int {
|
|||
"sei", "sei/test" -> R.drawable.img_sei_22
|
||||
"internet-computer" -> R.drawable.img_icp_22
|
||||
"sui", "sui/test" -> R.drawable.img_sui_22
|
||||
"energy-web-chain", "energy-web-chain/test" -> R.drawable.img_energy_web_22
|
||||
"energy-web-x", "energy-web-x/test" -> R.drawable.img_energy_web_22
|
||||
"core", "core/test" -> R.drawable.img_core_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -304,6 +313,9 @@ fun getGreyedOutIconRes(blockchainId: String): Int {
|
|||
"sei", "sei/test" -> R.drawable.ic_sei_22
|
||||
"internet-computer" -> R.drawable.ic_icp_22
|
||||
"sui", "sui/test" -> R.drawable.ic_sui_22
|
||||
"energy-web-chain", "energy-web-chain/test" -> R.drawable.ic_energy_web_22
|
||||
"energy-web-x", "energy-web-x/test" -> R.drawable.ic_energy_web_22
|
||||
"core", "core/test" -> R.drawable.ic_core_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -381,6 +393,9 @@ fun getGreyedOutIconResByNetworkId(networkId: String): Int {
|
|||
"sei", "sei/test" -> R.drawable.ic_sei_22
|
||||
"internet-computer" -> R.drawable.ic_icp_22
|
||||
"sui", "sui/test" -> R.drawable.ic_sui_22
|
||||
"energy-web-chain", "energy-web-chain/test" -> R.drawable.ic_energy_web_22
|
||||
"energy-web-x", "energy-web-x/test" -> R.drawable.ic_energy_web_22
|
||||
"core", "core/test" -> R.drawable.ic_core_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ object DateTimeFormatters {
|
|||
.withLocale(Locale.getDefault())
|
||||
} else {
|
||||
DateTimeFormatterBuilder()
|
||||
.appendHourOfDay(1)
|
||||
.appendHourOfDay(2)
|
||||
.appendLiteral(':')
|
||||
.appendMinuteOfHour(2)
|
||||
.toFormatter()
|
||||
|
|
|
|||
10
core/ui/src/main/res/drawable/ic_core_22.xml
Normal file
10
core/ui/src/main/res/drawable/ic_core_22.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:pathData="M11,4.66L5.501,7.83V14.17L11,17.34L16.499,14.17V7.83L11,4.66ZM11.231,3.062C11.088,2.979 10.912,2.979 10.769,3.062L4.231,6.831C4.088,6.914 4,7.066 4,7.231V14.769C4,14.934 4.088,15.086 4.231,15.169L10.769,18.938C10.912,19.021 11.088,19.021 11.231,18.938L17.769,15.169C17.912,15.086 18,14.934 18,14.769V7.231C18,7.066 17.912,6.914 17.769,6.831L11.231,3.062ZM11,6.956L7.493,8.978V13.022L10.977,15.031C10.991,15.039 11,15.054 11,15.071V15.763C11,15.798 10.962,15.821 10.931,15.803L6.973,13.521C6.866,13.46 6.8,13.345 6.8,13.222V8.778C6.8,8.655 6.866,8.541 6.973,8.479L10.827,6.257C10.934,6.195 11.066,6.195 11.173,6.257L15.146,8.539C15.177,8.557 15.177,8.601 15.147,8.619C14.98,8.718 14.872,8.777 14.729,8.856L14.729,8.856L14.728,8.856C14.67,8.888 14.606,8.923 14.53,8.965C14.516,8.973 14.498,8.973 14.484,8.965L11,6.956ZM11.602,11.045C11.587,11.053 11.577,11.068 11.577,11.085V15.763C11.577,15.798 11.616,15.82 11.647,15.803L15.134,13.781C15.148,13.772 15.157,13.757 15.157,13.741V9.232C15.157,9.197 15.12,9.175 15.089,9.191L11.602,11.045Z"
|
||||
android:fillColor="#000000"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
9
core/ui/src/main/res/drawable/ic_energy_web_22.xml
Normal file
9
core/ui/src/main/res/drawable/ic_energy_web_22.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:pathData="M10.426,16.82C9.756,17.299 8.955,17.56 8.131,17.568C6.707,17.566 5.405,16.793 4.418,15.369C3.531,14.007 3.04,12.425 3,10.801C3,10.77 3.01,10.74 3.028,10.715C3.046,10.691 3.071,10.672 3.1,10.662L4.071,10.229C4.089,10.22 4.108,10.215 4.128,10.215C4.149,10.214 4.169,10.218 4.187,10.225C4.206,10.233 4.223,10.244 4.237,10.258C4.251,10.273 4.262,10.29 4.269,10.308C4.269,10.328 4.288,10.347 4.288,10.367C4.286,11.982 4.718,13.51 5.489,14.639C6.217,15.708 7.167,16.283 8.156,16.284C8.691,16.286 9.214,16.128 9.659,15.831C9.691,15.814 9.729,15.809 9.764,15.817C9.8,15.824 9.833,15.844 9.856,15.872C10.053,16.129 10.251,16.366 10.467,16.603C10.48,16.639 10.483,16.679 10.476,16.717C10.469,16.755 10.452,16.791 10.426,16.82ZM17.567,15.389C16.596,16.791 15.269,17.579 13.847,17.577C12.425,17.575 11.12,16.783 10.135,15.378C9.208,14.033 8.697,12.252 8.7,10.369C8.702,8.631 9.713,7.267 10.978,7.269C12.243,7.271 13.251,8.638 13.248,10.376C13.268,11.891 12.905,13.386 12.193,14.724C12.184,14.741 12.172,14.756 12.157,14.769C12.143,14.781 12.125,14.791 12.107,14.796C12.088,14.802 12.069,14.804 12.05,14.801C12.031,14.799 12.012,14.793 11.995,14.783C11.976,14.783 11.976,14.762 11.955,14.743C11.837,14.604 11.718,14.466 11.62,14.327C11.501,14.156 11.394,13.978 11.297,13.793C11.288,13.772 11.283,13.748 11.283,13.724C11.283,13.7 11.288,13.677 11.297,13.655C11.748,12.613 11.979,11.489 11.976,10.354C11.978,9.505 11.543,8.535 10.969,8.534C10.396,8.533 9.96,9.502 9.958,10.351C9.956,11.966 10.388,13.495 11.159,14.623C11.889,15.691 12.837,16.265 13.825,16.267C14.814,16.268 15.765,15.677 16.497,14.632C17.27,13.502 17.708,11.985 17.711,10.363C17.713,8.742 17.282,7.228 16.51,6.096C16.29,5.763 16.024,5.463 15.72,5.205C15.694,5.175 15.678,5.139 15.674,5.1C15.671,5.061 15.68,5.021 15.701,4.988C15.72,4.967 15.741,4.948 15.761,4.948L16.731,4.515C16.758,4.5 16.789,4.496 16.819,4.503C16.849,4.511 16.875,4.529 16.892,4.554C17.139,4.804 17.364,5.075 17.565,5.363C18.492,6.708 19.003,8.488 19,10.372C18.997,12.255 18.498,14.047 17.567,15.389Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
||||
20
core/ui/src/main/res/drawable/img_core_22.xml
Normal file
20
core/ui/src/main/res/drawable/img_core_22.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z"/>
|
||||
<path
|
||||
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M0,0h22v22h-22z"
|
||||
android:fillColor="#121212"/>
|
||||
<path
|
||||
android:pathData="M11,4.66L5.501,7.83V14.17L11,17.34L16.499,14.17V7.83L11,4.66ZM11.231,3.062C11.088,2.979 10.912,2.979 10.769,3.062L4.231,6.831C4.088,6.914 4,7.066 4,7.231V14.769C4,14.934 4.088,15.086 4.231,15.169L10.769,18.938C10.912,19.021 11.088,19.021 11.231,18.938L17.769,15.169C17.912,15.086 18,14.934 18,14.769V7.231C18,7.066 17.912,6.914 17.769,6.831L11.231,3.062ZM11,6.956L7.493,8.978V13.022L10.977,15.031C10.991,15.039 11,15.054 11,15.071V15.763C11,15.798 10.961,15.821 10.931,15.803L6.973,13.521C6.866,13.46 6.8,13.345 6.8,13.222V8.778C6.8,8.655 6.866,8.541 6.973,8.479L10.827,6.257C10.934,6.195 11.066,6.195 11.173,6.257L15.146,8.539C15.177,8.557 15.177,8.601 15.147,8.619C14.98,8.718 14.872,8.777 14.729,8.856L14.729,8.856L14.728,8.856C14.67,8.888 14.606,8.923 14.53,8.965C14.516,8.973 14.498,8.973 14.484,8.965L11,6.956ZM11.602,11.045C11.587,11.053 11.577,11.068 11.577,11.085V15.763C11.577,15.798 11.616,15.82 11.647,15.802L15.134,13.781C15.148,13.772 15.157,13.757 15.157,13.741V9.232C15.157,9.197 15.12,9.175 15.089,9.191L11.602,11.045Z"
|
||||
android:fillColor="#FF9211"
|
||||
android:fillType="evenOdd"/>
|
||||
</group>
|
||||
</vector>
|
||||
19
core/ui/src/main/res/drawable/img_energy_web_22.xml
Normal file
19
core/ui/src/main/res/drawable/img_energy_web_22.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z"/>
|
||||
<path
|
||||
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M0,0h22v22h-22z"
|
||||
android:fillColor="#A466FF"/>
|
||||
<path
|
||||
android:pathData="M10.426,16.82C9.756,17.299 8.955,17.56 8.131,17.568C6.707,17.566 5.405,16.793 4.418,15.369C3.531,14.007 3.04,12.425 3,10.801C3,10.77 3.01,10.74 3.028,10.715C3.046,10.691 3.071,10.672 3.1,10.662L4.071,10.229C4.089,10.22 4.108,10.215 4.128,10.215C4.149,10.214 4.169,10.218 4.187,10.225C4.206,10.233 4.223,10.244 4.237,10.258C4.251,10.273 4.262,10.29 4.269,10.308C4.269,10.328 4.288,10.347 4.288,10.367C4.286,11.982 4.718,13.51 5.489,14.639C6.217,15.708 7.167,16.283 8.156,16.284C8.691,16.286 9.214,16.128 9.659,15.831C9.691,15.814 9.729,15.809 9.764,15.817C9.8,15.824 9.833,15.844 9.856,15.872C10.053,16.129 10.251,16.366 10.467,16.603C10.48,16.639 10.483,16.679 10.476,16.717C10.469,16.755 10.452,16.791 10.426,16.82ZM17.567,15.389C16.596,16.791 15.269,17.579 13.847,17.577C12.425,17.575 11.12,16.783 10.135,15.378C9.208,14.033 8.697,12.252 8.7,10.369C8.702,8.631 9.713,7.267 10.978,7.269C12.243,7.271 13.251,8.638 13.248,10.376C13.268,11.891 12.905,13.386 12.193,14.724C12.184,14.741 12.172,14.756 12.157,14.769C12.143,14.781 12.125,14.791 12.107,14.796C12.088,14.802 12.069,14.804 12.05,14.801C12.031,14.799 12.012,14.793 11.995,14.783C11.976,14.783 11.976,14.762 11.955,14.743C11.837,14.604 11.718,14.466 11.62,14.327C11.501,14.156 11.394,13.978 11.297,13.793C11.288,13.772 11.283,13.748 11.283,13.724C11.283,13.7 11.288,13.677 11.297,13.655C11.748,12.613 11.979,11.489 11.976,10.354C11.978,9.505 11.543,8.535 10.969,8.534C10.396,8.533 9.96,9.502 9.958,10.351C9.956,11.966 10.388,13.495 11.159,14.623C11.889,15.691 12.837,16.265 13.825,16.267C14.814,16.268 15.765,15.677 16.497,14.632C17.27,13.502 17.708,11.985 17.711,10.363C17.713,8.742 17.282,7.228 16.51,6.096C16.29,5.763 16.024,5.463 15.72,5.205C15.694,5.175 15.678,5.139 15.674,5.1C15.671,5.061 15.68,5.021 15.701,4.988C15.72,4.967 15.741,4.948 15.761,4.948L16.731,4.515C16.758,4.5 16.789,4.496 16.819,4.503C16.849,4.511 16.875,4.529 16.892,4.554C17.139,4.804 17.364,5.075 17.565,5.363C18.492,6.708 19.003,8.488 19,10.372C18.997,12.255 18.498,14.047 17.567,15.389Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</group>
|
||||
</vector>
|
||||
Loading…
Add table
Add a link
Reference in a new issue