mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Merge pull request #6694 from jennaharris7/feature/scroll-to-unread-messages
Timeline: jump-to-unread FAB and mark-as-read shortcut
This commit is contained in:
+4
@@ -8,7 +8,9 @@
|
||||
|
||||
package io.element.android.libraries.designsystem.atomic.atoms
|
||||
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
@@ -32,6 +34,7 @@ fun UnreadIndicatorAtom(
|
||||
color: Color = ElementTheme.colors.unreadIndicator,
|
||||
isVisible: Boolean = true,
|
||||
contentDescription: String? = null,
|
||||
border: BorderStroke? = null,
|
||||
) {
|
||||
Box(
|
||||
modifier = modifier
|
||||
@@ -41,6 +44,7 @@ fun UnreadIndicatorAtom(
|
||||
.size(size)
|
||||
.clip(CircleShape)
|
||||
.background(if (isVisible) color else Color.Transparent)
|
||||
.then(if (border != null) Modifier.border(border, CircleShape) else Modifier)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -115,6 +115,14 @@ enum class FeatureFlags(
|
||||
defaultValue = { false },
|
||||
isFinished = false,
|
||||
),
|
||||
JumpToUnread(
|
||||
key = "feature.jump_to_unread",
|
||||
title = "Jump to unread messages",
|
||||
description = "Show a button to jump to the read marker, plus a count badge on the scroll-to-bottom button " +
|
||||
"when new messages arrive while scrolled away.",
|
||||
defaultValue = { false },
|
||||
isFinished = false,
|
||||
),
|
||||
SlashCommand(
|
||||
key = "feature.slash_command",
|
||||
title = "Parse slash commands in the message composer",
|
||||
|
||||
@@ -98,6 +98,12 @@ object TestTags {
|
||||
*/
|
||||
val floatingActionButton = TestTag("floating-action-button")
|
||||
|
||||
/**
|
||||
* Timeline jump-to-position buttons (long-press exposes "Mark as read").
|
||||
*/
|
||||
val jumpToUnreadButton = TestTag("jump-to-unread-button")
|
||||
val jumpToBottomButton = TestTag("jump-to-bottom-button")
|
||||
|
||||
/**
|
||||
* Timeline.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (c) 2026 Element Creations Ltd.
|
||||
~
|
||||
~ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
~ Please see LICENSE files in the repository root for full details.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<string name="action_mark_as_read">"Mark as read"</string>
|
||||
<string name="a11y_jump_to_unread_messages">"Jump to first unread message"</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user