Read receipt: Cleanup
This commit is contained in:
parent
8c7809e316
commit
c25e01fe39
5 changed files with 15 additions and 10 deletions
|
|
@ -71,7 +71,7 @@ import io.element.android.features.messages.impl.timeline.components.customreact
|
|||
import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryEvents
|
||||
import io.element.android.features.messages.impl.timeline.components.reactionsummary.ReactionSummaryView
|
||||
import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheetEvents
|
||||
import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheetView
|
||||
import io.element.android.features.messages.impl.timeline.components.receipt.bottomsheet.ReadReceiptBottomSheet
|
||||
import io.element.android.features.messages.impl.timeline.components.retrysendmenu.RetrySendMenuEvents
|
||||
import io.element.android.features.messages.impl.timeline.components.retrysendmenu.RetrySendMessageMenu
|
||||
import io.element.android.features.messages.impl.timeline.model.TimelineItem
|
||||
|
|
@ -252,7 +252,7 @@ fun MessagesView(
|
|||
|
||||
ReactionSummaryView(state = state.reactionSummaryState)
|
||||
RetrySendMessageMenu(state = state.retrySendMenuState)
|
||||
ReadReceiptBottomSheetView(state = state.readReceiptBottomSheetState)
|
||||
ReadReceiptBottomSheet(state = state.readReceiptBottomSheetState)
|
||||
ReinviteDialog(state = state)
|
||||
|
||||
// Since the textfield is now based on an Android view, this is no longer done automatically.
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ private fun ReadReceiptsAvatars(
|
|||
receipts
|
||||
.take(TimelineConfig.maxReadReceiptToDisplay)
|
||||
.reversed()
|
||||
.forEachIndexed { index, it ->
|
||||
.forEachIndexed { index, readReceiptData ->
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(end = (12.dp + avatarStrokeSize * 2) * index)
|
||||
|
|
@ -159,7 +159,7 @@ private fun ReadReceiptsAvatars(
|
|||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
Avatar(
|
||||
avatarData = it.avatarData,
|
||||
avatarData = readReceiptData.avatarData,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import kotlinx.coroutines.launch
|
|||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
internal fun ReadReceiptBottomSheetView(
|
||||
internal fun ReadReceiptBottomSheet(
|
||||
state: ReadReceiptBottomSheetState,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
|
|
@ -62,7 +62,7 @@ internal fun ReadReceiptBottomSheetView(
|
|||
}
|
||||
}
|
||||
) {
|
||||
ReadReceiptBottomSheetContents(
|
||||
ReadReceiptBottomSheetContent(
|
||||
state = state,
|
||||
)
|
||||
// FIXME remove after https://issuetracker.google.com/issues/275849044
|
||||
|
|
@ -72,7 +72,7 @@ internal fun ReadReceiptBottomSheetView(
|
|||
}
|
||||
|
||||
@Composable
|
||||
private fun ColumnScope.ReadReceiptBottomSheetContents(
|
||||
private fun ColumnScope.ReadReceiptBottomSheetContent(
|
||||
state: ReadReceiptBottomSheetState,
|
||||
) {
|
||||
val receipts = state.selectedEvent?.readReceiptState?.receipts().orEmpty()
|
||||
|
|
@ -97,10 +97,10 @@ private fun ColumnScope.ReadReceiptBottomSheetContents(
|
|||
|
||||
@PreviewsDayNight
|
||||
@Composable
|
||||
internal fun ReadReceiptBottomSheetViewPreview(@PreviewParameter(ReadReceiptBottomSheetStateProvider::class) state: ReadReceiptBottomSheetState) = ElementPreview {
|
||||
internal fun ReadReceiptBottomSheetPreview(@PreviewParameter(ReadReceiptBottomSheetStateProvider::class) state: ReadReceiptBottomSheetState) = ElementPreview {
|
||||
// TODO restore RetrySendMessageMenuBottomSheet once the issue with bottom sheet not being previewable is fixed
|
||||
Column {
|
||||
ReadReceiptBottomSheetContents(
|
||||
ReadReceiptBottomSheetContent(
|
||||
state = state
|
||||
)
|
||||
}
|
||||
|
|
@ -21,7 +21,9 @@ import kotlinx.collections.immutable.ImmutableList
|
|||
import kotlinx.collections.immutable.persistentListOf
|
||||
|
||||
sealed interface TimelineItemReadReceipts {
|
||||
/** Value when the feature is disabled */
|
||||
/**
|
||||
* Value when the feature is disabled.
|
||||
*/
|
||||
data object Hidden : TimelineItemReadReceipts
|
||||
|
||||
data class ReadReceipts(
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@ style:
|
|||
active: false
|
||||
UnusedPrivateMember:
|
||||
active: true
|
||||
DestructuringDeclarationWithTooManyEntries:
|
||||
active: true
|
||||
maxDestructuringEntries: 5
|
||||
UnusedParameter:
|
||||
active: true
|
||||
UnnecessaryInnerClass:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue