change (room avatar) : fix AvatarClusterPreview
This commit is contained in:
parent
da371797d3
commit
21129d0c0b
1 changed files with 10 additions and 10 deletions
|
|
@ -78,10 +78,10 @@ fun AvatarCluster(
|
||||||
}
|
}
|
||||||
Box(
|
Box(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
.size(size.dp)
|
.size(size.dp)
|
||||||
.semantics {
|
.semantics {
|
||||||
this.contentDescription = contentDescription.orEmpty()
|
this.contentDescription = contentDescription.orEmpty()
|
||||||
},
|
},
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
limitedAvatars.forEachIndexed { index, heroAvatar ->
|
limitedAvatars.forEachIndexed { index, heroAvatar ->
|
||||||
|
|
@ -89,11 +89,11 @@ fun AvatarCluster(
|
||||||
val yOffset = (offsetRadius * sin(angle * index.toDouble() + angleOffset)).dp
|
val yOffset = (offsetRadius * sin(angle * index.toDouble() + angleOffset)).dp
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.size(heroAvatarSize)
|
.size(heroAvatarSize)
|
||||||
.offset(
|
.offset(
|
||||||
x = xOffset,
|
x = xOffset,
|
||||||
y = yOffset,
|
y = yOffset,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Avatar(
|
Avatar(
|
||||||
avatarData = heroAvatar,
|
avatarData = heroAvatar,
|
||||||
|
|
@ -113,7 +113,7 @@ internal fun AvatarClusterPreview() = ElementThemedPreview {
|
||||||
Row(
|
Row(
|
||||||
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
horizontalArrangement = Arrangement.spacedBy(8.dp)
|
||||||
) {
|
) {
|
||||||
repeat(6) { ngOfAvatars ->
|
for (ngOfAvatars in 1..5) {
|
||||||
AvatarCluster(
|
AvatarCluster(
|
||||||
avatars = List(ngOfAvatars) { anAvatarData(it) }.toPersistentList(),
|
avatars = List(ngOfAvatars) { anAvatarData(it) }.toPersistentList(),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue