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:
parent
73a5237495
commit
faa9621703
1 changed files with 17 additions and 1 deletions
|
@ -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)
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue