knock : display alias in knocked room item list
This commit is contained in:
parent
91574d3dfa
commit
b5b83660c2
2 changed files with 82 additions and 68 deletions
|
|
@ -12,6 +12,7 @@ import androidx.compose.foundation.combinedClickable
|
||||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Arrangement.Absolute.spacedBy
|
import androidx.compose.foundation.layout.Arrangement.Absolute.spacedBy
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.ColumnScope
|
import androidx.compose.foundation.layout.ColumnScope
|
||||||
import androidx.compose.foundation.layout.IntrinsicSize
|
import androidx.compose.foundation.layout.IntrinsicSize
|
||||||
|
|
@ -73,9 +74,10 @@ internal fun RoomSummaryRow(
|
||||||
eventSink: (RoomListEvents) -> Unit,
|
eventSink: (RoomListEvents) -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
|
Box(modifier = modifier) {
|
||||||
when (room.displayType) {
|
when (room.displayType) {
|
||||||
RoomSummaryDisplayType.PLACEHOLDER -> {
|
RoomSummaryDisplayType.PLACEHOLDER -> {
|
||||||
RoomSummaryPlaceholderRow(modifier = modifier)
|
RoomSummaryPlaceholderRow()
|
||||||
}
|
}
|
||||||
RoomSummaryDisplayType.INVITE -> {
|
RoomSummaryDisplayType.INVITE -> {
|
||||||
RoomSummaryScaffoldRow(
|
RoomSummaryScaffoldRow(
|
||||||
|
|
@ -84,7 +86,6 @@ internal fun RoomSummaryRow(
|
||||||
onLongClick = {
|
onLongClick = {
|
||||||
Timber.d("Long click on invite room")
|
Timber.d("Long click on invite room")
|
||||||
},
|
},
|
||||||
modifier = modifier
|
|
||||||
) {
|
) {
|
||||||
InviteNameAndIndicatorRow(name = room.name)
|
InviteNameAndIndicatorRow(name = room.name)
|
||||||
InviteSubtitle(isDm = room.isDm, inviteSender = room.inviteSender, canonicalAlias = room.canonicalAlias)
|
InviteSubtitle(isDm = room.isDm, inviteSender = room.inviteSender, canonicalAlias = room.canonicalAlias)
|
||||||
|
|
@ -113,7 +114,6 @@ internal fun RoomSummaryRow(
|
||||||
onLongClick = {
|
onLongClick = {
|
||||||
eventSink(RoomListEvents.ShowContextMenu(room))
|
eventSink(RoomListEvents.ShowContextMenu(room))
|
||||||
},
|
},
|
||||||
modifier = modifier
|
|
||||||
) {
|
) {
|
||||||
NameAndTimestampRow(
|
NameAndTimestampRow(
|
||||||
name = room.name,
|
name = room.name,
|
||||||
|
|
@ -130,25 +130,34 @@ internal fun RoomSummaryRow(
|
||||||
onLongClick = {
|
onLongClick = {
|
||||||
Timber.d("Long click on knocked room")
|
Timber.d("Long click on knocked room")
|
||||||
},
|
},
|
||||||
modifier = modifier
|
|
||||||
) {
|
) {
|
||||||
NameAndTimestampRow(
|
NameAndTimestampRow(
|
||||||
name = room.name,
|
name = room.name,
|
||||||
timestamp = room.timestamp,
|
timestamp = null,
|
||||||
isHighlighted = room.isHighlighted
|
isHighlighted = room.isHighlighted
|
||||||
)
|
)
|
||||||
|
if (room.canonicalAlias != null) {
|
||||||
|
Text(
|
||||||
|
text = room.canonicalAlias.value,
|
||||||
|
maxLines = 1,
|
||||||
|
overflow = TextOverflow.Ellipsis,
|
||||||
|
style = ElementTheme.typography.fontBodyMdRegular,
|
||||||
|
color = ElementTheme.colors.textSecondary,
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
|
}
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(id = R.string.screen_join_room_knock_sent_title),
|
text = stringResource(id = R.string.screen_join_room_knock_sent_title),
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis,
|
||||||
style = ElementTheme.typography.fontBodyMdRegular,
|
style = ElementTheme.typography.fontBodyMdRegular,
|
||||||
color = ElementTheme.colors.textSecondary,
|
color = ElementTheme.colors.textSecondary,
|
||||||
modifier = modifier,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,11 @@ open class RoomListRoomSummaryProvider : PreviewParameterProvider<RoomListRoomSu
|
||||||
aRoomListRoomSummary(
|
aRoomListRoomSummary(
|
||||||
name = "A knocked room",
|
name = "A knocked room",
|
||||||
displayType = RoomSummaryDisplayType.KNOCKED,
|
displayType = RoomSummaryDisplayType.KNOCKED,
|
||||||
|
),
|
||||||
|
aRoomListRoomSummary(
|
||||||
|
name = "A knocked room with alias",
|
||||||
|
canonicalAlias = RoomAlias("#knockable:matrix.org"),
|
||||||
|
displayType = RoomSummaryDisplayType.KNOCKED,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
).flatten()
|
).flatten()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue