mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
change (room avatar) : fix AvatarClusterPreview
This commit is contained in:
+10
-10
@@ -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(),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user