Skip to content

Commit 5b56ae1

Browse files
authored
Merge pull request #7319 from ByeongsuPark/feature/bspark/bugfix-wrong-mic-direction-rtl
Fix the wrong mic button direction to cancel on RTL languages
2 parents ea9874a + e9bde89 commit 5b56ae1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog.d/5968.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix wrong mic button direction to cancel on RTL languages

vector/src/main/java/im/vector/app/features/home/room/detail/composer/voice/DraggableStateProcessor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import android.view.MotionEvent
2121
import im.vector.app.R
2222
import im.vector.app.core.utils.DimensionConverter
2323
import im.vector.app.features.home.room.detail.composer.voice.VoiceMessageRecorderView.DraggingState
24+
import kotlin.math.absoluteValue
2425

2526
class DraggableStateProcessor(
2627
resources: Resources,
@@ -46,7 +47,7 @@ class DraggableStateProcessor(
4647
fun process(event: MotionEvent, draggingState: DraggingState): DraggingState {
4748
val currentX = event.rawX
4849
val currentY = event.rawY
49-
val distanceX = firstX - currentX
50+
val distanceX = (firstX - currentX).absoluteValue
5051
val distanceY = firstY - currentY
5152
return draggingState.nextDragState(currentX, currentY, distanceX, distanceY).also {
5253
lastDistanceX = distanceX

0 commit comments

Comments
 (0)