From 4bb60e162841113fa95b0c4e48f2e7afa934e9b0 Mon Sep 17 00:00:00 2001 From: ByeongsuPark Date: Thu, 6 Oct 2022 23:43:40 +0900 Subject: [PATCH 1/2] Fix wrong mic button direction to cancel on RTL languages --- .../home/room/detail/composer/voice/DraggableStateProcessor.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/DraggableStateProcessor.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/DraggableStateProcessor.kt index 1355c89006..1ff937add5 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/DraggableStateProcessor.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/DraggableStateProcessor.kt @@ -21,6 +21,7 @@ import android.view.MotionEvent import im.vector.app.R import im.vector.app.core.utils.DimensionConverter import im.vector.app.features.home.room.detail.composer.voice.VoiceMessageRecorderView.DraggingState +import kotlin.math.absoluteValue class DraggableStateProcessor( resources: Resources, @@ -46,7 +47,7 @@ class DraggableStateProcessor( fun process(event: MotionEvent, draggingState: DraggingState): DraggingState { val currentX = event.rawX val currentY = event.rawY - val distanceX = firstX - currentX + val distanceX = (firstX - currentX).absoluteValue val distanceY = firstY - currentY return draggingState.nextDragState(currentX, currentY, distanceX, distanceY).also { lastDistanceX = distanceX From e9bde89fec2d5ff5b41280e81666dac8d6ae13d2 Mon Sep 17 00:00:00 2001 From: ByeongsuPark Date: Mon, 10 Oct 2022 16:44:01 +0900 Subject: [PATCH 2/2] Add changelog.d Signed-off-by: byeongsu@soongsil.ac.kr --- changelog.d/5968.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5968.bugfix diff --git a/changelog.d/5968.bugfix b/changelog.d/5968.bugfix new file mode 100644 index 0000000000..05cf5cea60 --- /dev/null +++ b/changelog.d/5968.bugfix @@ -0,0 +1 @@ +Fix wrong mic button direction to cancel on RTL languages