1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-2619 Widgets | Fix | Draw circle profile icon in tree widget

This commit is contained in:
Evgenii Kozlov 2024-07-02 19:17:38 +02:00
parent 73a5237495
commit faa9621703

View file

@ -11,6 +11,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
@ -62,7 +63,7 @@ fun TreeWidgetObjectIcon(
}
}
is ObjectIcon.Profile.Image -> {
UriImage(
UriCircleImage(
uri = icon.hash,
modifier = modifier.padding(start = paddingStart, end = paddingEnd)
)
@ -115,4 +116,19 @@ fun UriImage(
.height(18.dp)
.width(18.dp)
)
}
@Composable
fun UriCircleImage(
uri: String,
modifier: Modifier
) {
Image(
painter = rememberAsyncImagePainter(uri),
contentDescription = "Icon from URI",
modifier = modifier
.height(18.dp)
.width(18.dp)
.clip(CircleShape)
)
}