Skip to content

Commit

Permalink
Add circular clipping for coin images
Browse files Browse the repository at this point in the history
  • Loading branch information
omurovch committed Jun 4, 2024
1 parent b635fd8 commit 16afc95
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package io.horizontalsystems.bankwallet.modules.coin.ui

import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -28,7 +30,7 @@ fun CoinScreenTitle(
url = coinIconUrl,
alternativeUrl = alternativeCoinIconUrl,
placeholder = iconPlaceholder,
modifier = Modifier.size(32.dp)
modifier = Modifier.size(32.dp).clip(CircleShape)
)

body_grey(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Divider
import androidx.compose.material.Icon
Expand Down Expand Up @@ -181,6 +182,7 @@ private fun CoinCell(
modifier = Modifier
.padding(end = 16.dp, top = 12.dp, bottom = 12.dp)
.size(32.dp)
.clip(CircleShape)
)
Column(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.runtime.Composable
Expand All @@ -29,6 +30,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -268,6 +270,7 @@ private fun MarketCoin(
modifier = Modifier
.padding(end = 16.dp)
.size(32.dp)
.clip(CircleShape)
)
Column(
modifier = Modifier.weight(1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.horizontalsystems.bankwallet.ui.compose.components

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -55,7 +56,7 @@ fun CoinImage(
url = coin?.imageUrl,
alternativeUrl = coin?.alternativeImageUrl,
placeholder = coin?.imagePlaceholder,
modifier = modifier,
modifier = modifier.clip(CircleShape),
colorFilter = colorFilter
)

Expand All @@ -68,7 +69,7 @@ fun CoinImage(
url = token?.coin?.imageUrl,
alternativeUrl = token?.coin?.alternativeImageUrl,
placeholder = token?.iconPlaceholder,
modifier = modifier,
modifier = modifier.clip(CircleShape),
colorFilter = colorFilter
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -98,6 +99,7 @@ fun MarketCoin(
modifier = Modifier
.padding(end = 16.dp)
.size(32.dp)
.clip(CircleShape)
)
Column(
modifier = Modifier.fillMaxWidth()
Expand Down

0 comments on commit 16afc95

Please sign in to comment.