mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Keep jump to unread button position stationary
This commit is contained in:
+15
-13
@@ -339,7 +339,7 @@ private fun BoxScope.TimelineScrollHelper(
|
|||||||
lazyListState.firstVisibleItemIndex < 3 && isLive
|
lazyListState.firstVisibleItemIndex < 3 && isLive
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val isJumpToUnreadVisible by remember {
|
val isJumpToUnreadVisible by remember(readMarkerIndex, forceJumpToReadMarkerVisibility) {
|
||||||
derivedStateOf {
|
derivedStateOf {
|
||||||
if (forceJumpToReadMarkerVisibility) return@derivedStateOf true
|
if (forceJumpToReadMarkerVisibility) return@derivedStateOf true
|
||||||
val markerIndex = readMarkerIndex ?: return@derivedStateOf false
|
val markerIndex = readMarkerIndex ?: return@derivedStateOf false
|
||||||
@@ -418,28 +418,30 @@ private fun BoxScope.TimelineScrollHelper(
|
|||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.BottomEnd)
|
.align(Alignment.BottomEnd)
|
||||||
.padding(end = 24.dp, bottom = 24.dp)
|
.padding(end = 24.dp, bottom = 16.dp)
|
||||||
) {
|
) {
|
||||||
JumpToPositionButton(
|
JumpToPositionButton(
|
||||||
icon = CompoundIcons.ChevronUp(),
|
icon = CompoundIcons.ChevronUp(),
|
||||||
contentDescription = stringResource(id = CommonStrings.a11y_jump_to_unread_messages),
|
contentDescription = stringResource(id = CommonStrings.a11y_jump_to_unread_messages),
|
||||||
modifier = Modifier.padding(bottom = if (isJumpToBottomVisible) 12.dp else 0.dp),
|
modifier = Modifier.padding(bottom = 12.dp),
|
||||||
isVisible = isJumpToUnreadVisible,
|
isVisible = isJumpToUnreadVisible,
|
||||||
hasUnread = true,
|
hasUnread = true,
|
||||||
onClick = ::jumpToReadMarker,
|
onClick = ::jumpToReadMarker,
|
||||||
onMarkAsRead = onMarkAllAsRead,
|
onMarkAsRead = onMarkAllAsRead,
|
||||||
testTag = TestTags.jumpToUnreadButton,
|
testTag = TestTags.jumpToUnreadButton,
|
||||||
)
|
)
|
||||||
JumpToPositionButton(
|
Box(modifier = Modifier.size(36.dp)) {
|
||||||
icon = CompoundIcons.ChevronDown(),
|
JumpToPositionButton(
|
||||||
contentDescription = stringResource(id = CommonStrings.a11y_jump_to_bottom),
|
icon = CompoundIcons.ChevronDown(),
|
||||||
isVisible = isJumpToBottomVisible,
|
contentDescription = stringResource(id = CommonStrings.a11y_jump_to_bottom),
|
||||||
hasUnread = displayJumpToUnread && newEventState is NewEventState.FromOther,
|
isVisible = isJumpToBottomVisible,
|
||||||
onClick = ::jumpToBottom,
|
hasUnread = displayJumpToUnread && newEventState is NewEventState.FromOther,
|
||||||
onMarkAsRead = onMarkAllAsRead,
|
onClick = ::jumpToBottom,
|
||||||
testTag = TestTags.jumpToBottomButton,
|
onMarkAsRead = onMarkAllAsRead,
|
||||||
dotAlignment = Alignment.BottomCenter,
|
testTag = TestTags.jumpToBottomButton,
|
||||||
)
|
dotAlignment = Alignment.BottomCenter,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user