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

DROID-2794 Widgets | Fix | Untitled objects (#1890)

This commit is contained in:
Konstantin Ivanov 2024-12-09 13:52:08 +01:00 committed by GitHub
parent 441a5118fb
commit 77c89dd434
Signed by: github
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 16 deletions

View file

@ -544,14 +544,8 @@ private fun GalleryWidgetItemCard(
.padding(start = 12.dp, top = 9.dp),
onTaskIconClicked = {}
)
val prettyPrintName = item.name.prettyPrintName
val name = if (prettyPrintName.isNullOrEmpty()) {
stringResource(id = R.string.untitled)
} else {
prettyPrintName
}
Text(
text = name,
text = item.name.prettyPrintName.ifEmpty { stringResource(id = R.string.untitled) },
maxLines = 2,
overflow = TextOverflow.Ellipsis,
style = Caption1Medium,
@ -566,14 +560,8 @@ private fun GalleryWidgetItemCard(
)
}
} else {
val prettyPrintName = item.name.prettyPrintName
val name = if (prettyPrintName.isNullOrEmpty()) {
stringResource(id = R.string.untitled)
} else {
prettyPrintName
}
Text(
text = name,
text = item.name.prettyPrintName.ifEmpty { stringResource(id = R.string.untitled) },
maxLines = 2,
overflow = TextOverflow.Ellipsis,
style = Caption1Medium,

View file

@ -161,13 +161,15 @@ fun CompactListWidgetList(
ListWidgetObjectIcon(
iconSize = 18.dp,
icon = element.objectIcon,
modifier = Modifier.align(Alignment.CenterVertically).padding(start = 0.dp, end = 4.dp),
modifier = Modifier
.align(Alignment.CenterVertically)
.padding(start = 0.dp, end = 4.dp),
onTaskIconClicked = { isChecked ->
onObjectCheckboxClicked(element.obj.id, isChecked)
}
)
Text(
text = element.name.prettyPrintName ?: stringResource(id = R.string.untitled),
text = element.name.prettyPrintName.ifEmpty { stringResource(id = R.string.untitled) },
modifier = Modifier
.padding(start = 8.dp)
.fillMaxWidth(),