mirror of
https://github.com/Steffo99/twom.git
synced 2024-11-25 09:34:25 +00:00
Wrap RoomListItem
in a Box
to have the DropdownMenu
display correctly
This commit is contained in:
parent
395709cc28
commit
6abfb78ad6
1 changed files with 44 additions and 40 deletions
|
@ -71,48 +71,52 @@ fun RoomListItem(
|
||||||
Log.d("Main", "Successfully left room `$roomId`!")
|
Log.d("Main", "Successfully left room `$roomId`!")
|
||||||
}
|
}
|
||||||
|
|
||||||
ListItem(
|
Box {
|
||||||
modifier = Modifier.combinedClickable(
|
|
||||||
onClick = { openRoom() },
|
|
||||||
onLongClick = { expanded = true }
|
|
||||||
),
|
|
||||||
headlineContent = {
|
|
||||||
Text(roomSummary.displayName)
|
|
||||||
},
|
|
||||||
leadingContent = {
|
|
||||||
Box(
|
|
||||||
modifier = Modifier
|
|
||||||
.size(40.dp)
|
|
||||||
.clip(MaterialTheme.shapes.medium)
|
|
||||||
) {
|
|
||||||
AvatarURL(
|
|
||||||
// FIXME: URL can appearently be set before the image is available on the homeserver
|
|
||||||
url = roomSummary.avatarUrl,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
supportingContent = {
|
|
||||||
// TODO: Display rsvpComment instead of alias
|
|
||||||
val canonicalAlias = roomSummary.canonicalAlias
|
|
||||||
if (canonicalAlias != null) {
|
|
||||||
Text(canonicalAlias)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
)
|
|
||||||
|
|
||||||
DropdownMenu(
|
ListItem(
|
||||||
expanded = expanded,
|
modifier = Modifier.combinedClickable(
|
||||||
onDismissRequest = { expanded = false },
|
onClick = { openRoom() },
|
||||||
) {
|
onLongClick = { expanded = true }
|
||||||
// TODO: Align me to the right
|
),
|
||||||
DropdownMenuItem(
|
headlineContent = {
|
||||||
text = {
|
Text(roomSummary.displayName)
|
||||||
Text(stringResource(id = R.string.main_room_leave_label))
|
},
|
||||||
|
leadingContent = {
|
||||||
|
Box(
|
||||||
|
modifier = Modifier
|
||||||
|
.size(40.dp)
|
||||||
|
.clip(MaterialTheme.shapes.medium)
|
||||||
|
) {
|
||||||
|
AvatarURL(
|
||||||
|
// FIXME: URL can appearently be set before the image is available on the homeserver
|
||||||
|
url = roomSummary.avatarUrl,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
supportingContent = {
|
||||||
|
// TODO: Display rsvpComment instead of alias
|
||||||
|
val canonicalAlias = roomSummary.canonicalAlias
|
||||||
|
if (canonicalAlias != null) {
|
||||||
|
Text(canonicalAlias)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onClick = {
|
|
||||||
expanded = false
|
|
||||||
scope.launch { leaveRoom() }
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
DropdownMenu(
|
||||||
|
expanded = expanded,
|
||||||
|
onDismissRequest = { expanded = false },
|
||||||
|
) {
|
||||||
|
// TODO: Align me to the right
|
||||||
|
DropdownMenuItem(
|
||||||
|
text = {
|
||||||
|
Text(stringResource(id = R.string.main_room_leave_label))
|
||||||
|
},
|
||||||
|
onClick = {
|
||||||
|
expanded = false
|
||||||
|
scope.launch { leaveRoom() }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue