|
|
@ -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,78 +74,86 @@ internal fun RoomSummaryRow( |
|
|
|
eventSink: (RoomListEvents) -> Unit, |
|
|
|
eventSink: (RoomListEvents) -> Unit, |
|
|
|
modifier: Modifier = Modifier, |
|
|
|
modifier: Modifier = Modifier, |
|
|
|
) { |
|
|
|
) { |
|
|
|
when (room.displayType) { |
|
|
|
Box(modifier = modifier) { |
|
|
|
RoomSummaryDisplayType.PLACEHOLDER -> { |
|
|
|
when (room.displayType) { |
|
|
|
RoomSummaryPlaceholderRow(modifier = modifier) |
|
|
|
RoomSummaryDisplayType.PLACEHOLDER -> { |
|
|
|
} |
|
|
|
RoomSummaryPlaceholderRow() |
|
|
|
RoomSummaryDisplayType.INVITE -> { |
|
|
|
} |
|
|
|
RoomSummaryScaffoldRow( |
|
|
|
RoomSummaryDisplayType.INVITE -> { |
|
|
|
room = room, |
|
|
|
RoomSummaryScaffoldRow( |
|
|
|
onClick = onClick, |
|
|
|
room = room, |
|
|
|
onLongClick = { |
|
|
|
onClick = onClick, |
|
|
|
Timber.d("Long click on invite room") |
|
|
|
onLongClick = { |
|
|
|
}, |
|
|
|
Timber.d("Long click on invite room") |
|
|
|
modifier = modifier |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
InviteNameAndIndicatorRow(name = room.name) |
|
|
|
|
|
|
|
InviteSubtitle(isDm = room.isDm, inviteSender = room.inviteSender, canonicalAlias = room.canonicalAlias) |
|
|
|
|
|
|
|
if (!room.isDm && room.inviteSender != null) { |
|
|
|
|
|
|
|
Spacer(modifier = Modifier.height(4.dp)) |
|
|
|
|
|
|
|
InviteSenderView( |
|
|
|
|
|
|
|
modifier = Modifier.fillMaxWidth(), |
|
|
|
|
|
|
|
inviteSender = room.inviteSender, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Spacer(modifier = Modifier.height(12.dp)) |
|
|
|
|
|
|
|
InviteButtonsRow( |
|
|
|
|
|
|
|
onAcceptClick = { |
|
|
|
|
|
|
|
eventSink(RoomListEvents.AcceptInvite(room)) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
onDeclineClick = { |
|
|
|
) { |
|
|
|
eventSink(RoomListEvents.DeclineInvite(room)) |
|
|
|
InviteNameAndIndicatorRow(name = room.name) |
|
|
|
|
|
|
|
InviteSubtitle(isDm = room.isDm, inviteSender = room.inviteSender, canonicalAlias = room.canonicalAlias) |
|
|
|
|
|
|
|
if (!room.isDm && room.inviteSender != null) { |
|
|
|
|
|
|
|
Spacer(modifier = Modifier.height(4.dp)) |
|
|
|
|
|
|
|
InviteSenderView( |
|
|
|
|
|
|
|
modifier = Modifier.fillMaxWidth(), |
|
|
|
|
|
|
|
inviteSender = room.inviteSender, |
|
|
|
|
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
Spacer(modifier = Modifier.height(12.dp)) |
|
|
|
|
|
|
|
InviteButtonsRow( |
|
|
|
|
|
|
|
onAcceptClick = { |
|
|
|
|
|
|
|
eventSink(RoomListEvents.AcceptInvite(room)) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onDeclineClick = { |
|
|
|
|
|
|
|
eventSink(RoomListEvents.DeclineInvite(room)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
RoomSummaryDisplayType.ROOM -> { |
|
|
|
RoomSummaryDisplayType.ROOM -> { |
|
|
|
RoomSummaryScaffoldRow( |
|
|
|
RoomSummaryScaffoldRow( |
|
|
|
room = room, |
|
|
|
room = room, |
|
|
|
onClick = onClick, |
|
|
|
onClick = onClick, |
|
|
|
onLongClick = { |
|
|
|
onLongClick = { |
|
|
|
eventSink(RoomListEvents.ShowContextMenu(room)) |
|
|
|
eventSink(RoomListEvents.ShowContextMenu(room)) |
|
|
|
}, |
|
|
|
}, |
|
|
|
) { |
|
|
|
modifier = modifier |
|
|
|
NameAndTimestampRow( |
|
|
|
) { |
|
|
|
name = room.name, |
|
|
|
NameAndTimestampRow( |
|
|
|
timestamp = room.timestamp, |
|
|
|
name = room.name, |
|
|
|
isHighlighted = room.isHighlighted |
|
|
|
timestamp = room.timestamp, |
|
|
|
) |
|
|
|
isHighlighted = room.isHighlighted |
|
|
|
LastMessageAndIndicatorRow(room = room) |
|
|
|
) |
|
|
|
} |
|
|
|
LastMessageAndIndicatorRow(room = room) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
RoomSummaryDisplayType.KNOCKED -> { |
|
|
|
RoomSummaryDisplayType.KNOCKED -> { |
|
|
|
RoomSummaryScaffoldRow( |
|
|
|
RoomSummaryScaffoldRow( |
|
|
|
room = room, |
|
|
|
room = room, |
|
|
|
onClick = onClick, |
|
|
|
onClick = onClick, |
|
|
|
onLongClick = { |
|
|
|
onLongClick = { |
|
|
|
Timber.d("Long click on knocked room") |
|
|
|
Timber.d("Long click on knocked room") |
|
|
|
}, |
|
|
|
}, |
|
|
|
) { |
|
|
|
modifier = modifier |
|
|
|
NameAndTimestampRow( |
|
|
|
) { |
|
|
|
name = room.name, |
|
|
|
NameAndTimestampRow( |
|
|
|
timestamp = null, |
|
|
|
name = room.name, |
|
|
|
isHighlighted = room.isHighlighted |
|
|
|
timestamp = room.timestamp, |
|
|
|
) |
|
|
|
isHighlighted = room.isHighlighted |
|
|
|
if (room.canonicalAlias != null) { |
|
|
|
) |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
text = room.canonicalAlias.value, |
|
|
|
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, |
|
|
|
Spacer(modifier = Modifier.height(4.dp)) |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
text = stringResource(id = R.string.screen_join_room_knock_sent_title), |
|
|
|
|
|
|
|
maxLines = 1, |
|
|
|
|
|
|
|
overflow = TextOverflow.Ellipsis, |
|
|
|
|
|
|
|
style = ElementTheme.typography.fontBodyMdRegular, |
|
|
|
|
|
|
|
color = ElementTheme.colors.textSecondary, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|