mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Fix wrong mic button direction to cancel on RTL languages
This commit is contained in:
parent
9335242ce1
commit
4bb60e1628
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue