From ed5faca5d2eb10e4fb30aaab40d8ed0d42a66bfe Mon Sep 17 00:00:00 2001 From: Valere Date: Sun, 18 Aug 2019 17:46:17 -0400 Subject: [PATCH 1/2] Slide-in reply icon is distorted --- CHANGES.md | 2 +- .../room/detail/RoomMessageTouchHelperCallback.kt | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 682c176b98..eae3bd53f2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,7 @@ Other changes: - Bugfix: - - + - Slide-in reply icon is distorted (#423) Translations: - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomMessageTouchHelperCallback.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomMessageTouchHelperCallback.kt index d30bad2f53..a7e617c05f 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomMessageTouchHelperCallback.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomMessageTouchHelperCallback.kt @@ -191,12 +191,13 @@ class RoomMessageTouchHelperCallback(private val context: Context, } val y = (itemView.top + itemView.measuredHeight / 2).toFloat() - //magic numbers? + val hw = imageDrawable.intrinsicWidth / 2f + val hh = imageDrawable.intrinsicHeight / 2f imageDrawable.setBounds( - (x - convertToPx(12) * scale).toInt(), - (y - convertToPx(11) * scale).toInt(), - (x + convertToPx(12) * scale).toInt(), - (y + convertToPx(10) * scale).toInt() + (x - hw * scale).toInt(), + (y - hh * scale).toInt(), + (x + hw * scale).toInt(), + (y + hh * scale).toInt() ) imageDrawable.draw(canvas) imageDrawable.alpha = 255 From 7966ebef0359fb3cc26ebdf3c822cfa41e8517a9 Mon Sep 17 00:00:00 2001 From: Valere Date: Sun, 18 Aug 2019 15:12:59 -0400 Subject: [PATCH 2/2] Date change message repeats for each redaction until a normal message --- CHANGES.md | 2 +- .../detail/timeline/helper/TimelineDisplayableEvents.kt | 3 ++- .../detail/timeline/util/MessageInformationDataFactory.kt | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 682c176b98..d7533ee3d1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,7 @@ Other changes: - Bugfix: - - + - Date change message repeats for each redaction until a normal message (#358) Translations: - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/TimelineDisplayableEvents.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/TimelineDisplayableEvents.kt index fa0a71bde2..7307e0674d 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/TimelineDisplayableEvents.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/helper/TimelineDisplayableEvents.kt @@ -56,7 +56,8 @@ fun TimelineEvent.isDisplayable(showHiddenEvent: Boolean): Boolean { return false } if (root.content.isNullOrEmpty()) { - return false + //redacted events have empty content but are displayable + return root.unsignedData?.redactedEvent != null } //Edits should be filtered out! if (EventType.MESSAGE == root.type diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/util/MessageInformationDataFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/util/MessageInformationDataFactory.kt index a00dd3fa9f..46887cad77 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/util/MessageInformationDataFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/util/MessageInformationDataFactory.kt @@ -50,10 +50,10 @@ class MessageInformationDataFactory @Inject constructor(private val session: Ses val showInformation = addDaySeparator - || event.senderAvatar != nextEvent?.senderAvatar - || event.getDisambiguatedDisplayName() != nextEvent?.getDisambiguatedDisplayName() - || (nextEvent.root.getClearType() != EventType.MESSAGE && nextEvent.root.getClearType() != EventType.ENCRYPTED) - || isNextMessageReceivedMoreThanOneHourAgo + || event.senderAvatar != nextEvent?.senderAvatar + || event.getDisambiguatedDisplayName() != nextEvent?.getDisambiguatedDisplayName() + || (nextEvent.root.getClearType() != EventType.MESSAGE && nextEvent.root.getClearType() != EventType.ENCRYPTED) + || isNextMessageReceivedMoreThanOneHourAgo val time = dateFormatter.formatMessageHour(date) val avatarUrl = event.senderAvatar