Skip to content

Commit

Permalink
Merge pull request #265 from radixdlt/bugfix/ABW-1535-bugfixes
Browse files Browse the repository at this point in the history
[ABW-1535] UI-bugfixes related to the Assets refactor
  • Loading branch information
micbakos-rdx committed May 23, 2023
2 parents 58cd367 + 960e88f commit 3f4a121
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fun NonFungibleResourcesContent(
}
items(
nft.items,
key = { item -> item.globalAddress(nftAddress = item.localId) }
key = { item -> item.globalAddress(nftAddress = nft.resourceAddress) }
) { item ->
AnimatedVisibility(
visible = !collapsed,
Expand Down
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,12 @@ 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 +235,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 +255,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 3f4a121

Please sign in to comment.