@ -12,6 +12,7 @@ import androidx.compose.foundation.combinedClickable
@@ -12,6 +12,7 @@ import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
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.ColumnScope
import androidx.compose.foundation.layout.IntrinsicSize
@ -73,78 +74,86 @@ internal fun RoomSummaryRow(
@@ -73,78 +74,86 @@ internal fun RoomSummaryRow(
eventSink : ( RoomListEvents ) -> Unit ,
modifier : Modifier = Modifier ,
) {
when ( room . displayType ) {
RoomSummaryDisplayType . PLACEHOLDER -> {
RoomSummaryPlaceholderRow ( modifier = modifier )
}
RoomSummaryDisplayType . INVITE -> {
RoomSummaryScaffoldRow (
room = room ,
onClick = onClick ,
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 ) )
Box ( modifier = modifier ) {
when ( room . displayType ) {
RoomSummaryDisplayType . PLACEHOLDER -> {
RoomSummaryPlaceholderRow ( )
}
RoomSummaryDisplayType . INVITE -> {
RoomSummaryScaffoldRow (
room = room ,
onClick = onClick ,
onLongClick = {
Timber . d ( " Long click on invite 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 -> {
RoomSummaryScaffoldRow (
room = room ,
onClick = onClick ,
onLongClick = {
eventSink ( RoomListEvents . ShowContextMenu ( room ) )
} ,
modifier = modifier
) {
NameAndTimestampRow (
name = room . name ,
timestamp = room . timestamp ,
isHighlighted = room . isHighlighted
)
LastMessageAndIndicatorRow ( room = room )
RoomSummaryDisplayType . ROOM -> {
RoomSummaryScaffoldRow (
room = room ,
onClick = onClick ,
onLongClick = {
eventSink ( RoomListEvents . ShowContextMenu ( room ) )
} ,
) {
NameAndTimestampRow (
name = room . name ,
timestamp = room . timestamp ,
isHighlighted = room . isHighlighted
)
LastMessageAndIndicatorRow ( room = room )
}
}
}
RoomSummaryDisplayType . KNOCKED -> {
RoomSummaryScaffoldRow (
room = room ,
onClick = onClick ,
onLongClick = {
Timber . d ( " Long click on knocked room " )
} ,
modifier = modifier
) {
NameAndTimestampRow (
name = room . name ,
timestamp = room . timestamp ,
isHighlighted = room . isHighlighted
)
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 ,
modifier = modifier ,
)
RoomSummaryDisplayType . KNOCKED -> {
RoomSummaryScaffoldRow (
room = room ,
onClick = onClick ,
onLongClick = {
Timber . d ( " Long click on knocked room " )
} ,
) {
NameAndTimestampRow (
name = room . name ,
timestamp = null ,
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 = stringResource ( id = R . string . screen _join _room _knock _sent _title ) ,
maxLines = 1 ,
overflow = TextOverflow . Ellipsis ,
style = ElementTheme . typography . fontBodyMdRegular ,
color = ElementTheme . colors . textSecondary ,
)
}
}
}
}