-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3963 from element-hq/feature/bma/copyCaption
Add timeline action item to copy caption
- Loading branch information
Showing
36 changed files
with
290 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...o/element/android/features/messages/impl/actionlist/model/TimelineItemActionComparator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* Please see LICENSE in the repository root for full details. | ||
*/ | ||
|
||
package io.element.android.features.messages.impl.actionlist.model | ||
|
||
class TimelineItemActionComparator : Comparator<TimelineItemAction> { | ||
// See order in https://www.figma.com/design/ux3tYoZV9WghC7hHT9Fhk0/Compound-iOS-Components?node-id=2946-2392 | ||
private val orderedList = listOf( | ||
TimelineItemAction.EndPoll, | ||
TimelineItemAction.ViewInTimeline, | ||
TimelineItemAction.Reply, | ||
TimelineItemAction.ReplyInThread, | ||
TimelineItemAction.Forward, | ||
TimelineItemAction.Pin, | ||
TimelineItemAction.Unpin, | ||
TimelineItemAction.CopyLink, | ||
TimelineItemAction.Edit, | ||
TimelineItemAction.CopyText, | ||
TimelineItemAction.AddCaption, | ||
TimelineItemAction.EditCaption, | ||
TimelineItemAction.CopyCaption, | ||
TimelineItemAction.RemoveCaption, | ||
TimelineItemAction.ViewSource, | ||
TimelineItemAction.ReportContent, | ||
TimelineItemAction.Redact, | ||
) | ||
|
||
override fun compare(o1: TimelineItemAction, o2: TimelineItemAction): Int { | ||
val index1 = orderedList.indexOf(o1) | ||
val index2 = orderedList.indexOf(o2) | ||
return index1.compareTo(index2) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.