Skip to content

Commit

Permalink
Fix assets row non-fungibles icon offset
Browse files Browse the repository at this point in the history
  • Loading branch information
micbakos-rdx committed May 19, 2023
1 parent c63671d commit c089c65
Showing 1 changed file with 35 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ fun AccountAssetsRow(
maxVisibleFungibles: Int = 5
) {
AssetsContent(
modifier = modifier.fillMaxWidth()
modifier = modifier
.fillMaxWidth()
.height(height = iconSize + bordersSize * 2)
.placeholder(
visible = isLoading,
Expand Down Expand Up @@ -139,7 +140,13 @@ private fun AssetsContent(
}
}

val nonFungibleSectionOffset = iconsOverlap * (sortedFungibles.size - 1) + iconSize
val nonFungibleSectionOffset = if (remainingFungiblesCount > 0) {
iconSize
} else {
0.dp
} + iconsOverlap * (sortedFungibles.size - 1)


if (remainingFungiblesCount > 0) {
CounterBox(
modifier = Modifier
Expand Down Expand Up @@ -229,6 +236,17 @@ fun AssetsContentRowPreview() {
) {
AccountAssetsRow(resources = null, isLoading = true)

val otherFungible = Resource.FungibleResource(
resourceAddress = "resource_address",
amount = BigDecimal.valueOf(237659),
nameMetadataItem = NameMetadataItem("AWE"),
symbolMetadataItem = SymbolMetadataItem("AWE"),
iconUrlMetadataItem = IconUrlMetadataItem(
url = Uri.parse(
"https://c4.wallpaperflare.com/wallpaper/817/534/563/ave-bosque-fantasia-fenix-wallpaper-preview.jpg"
)
)
)
AccountAssetsRow(
resources = Resources(
fungibleResources = listOf(
Expand All @@ -238,19 +256,23 @@ fun AssetsContentRowPreview() {
nameMetadataItem = NameMetadataItem("Radix"),
symbolMetadataItem = SymbolMetadataItem("XRD")
),
Resource.FungibleResource(
otherFungible,
otherFungible,
otherFungible,
otherFungible,
otherFungible,
otherFungible,
otherFungible,
otherFungible
),
nonFungibleResources = listOf(
Resource.NonFungibleResource(
resourceAddress = "resource_address",
amount = BigDecimal.valueOf(237659),
amount = 1000,
nameMetadataItem = NameMetadataItem("AWE"),
symbolMetadataItem = SymbolMetadataItem("AWE"),
iconUrlMetadataItem = IconUrlMetadataItem(
url = Uri.parse(
"https://c4.wallpaperflare.com/wallpaper/817/534/563/ave-bosque-fantasia-fenix-wallpaper-preview.jpg"
)
)
),
),
nonFungibleResources = listOf()
items = listOf()
)
)
),
isLoading = false
)
Expand Down

0 comments on commit c089c65

Please sign in to comment.