mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-01 19:56:47 +01:00
Fix flickering lock view.
This commit is contained in:
parent
78653eb1d9
commit
bf9a22c1b0
@ -220,6 +220,9 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
RecordingState.STARTED -> {
|
RecordingState.STARTED -> {
|
||||||
showRecordingViews()
|
showRecordingViews()
|
||||||
|
val translationAmount = distanceX.coerceAtMost(distanceToCancel)
|
||||||
|
views.voiceMessageMicButton.translationX = -translationAmount * rtlXMultiplier
|
||||||
|
views.voiceMessageSlideToCancel.translationX = -translationAmount / 2 * rtlXMultiplier
|
||||||
}
|
}
|
||||||
RecordingState.NONE -> Timber.d("VoiceMessageRecorderView shouldn't be in NONE state while moving.")
|
RecordingState.NONE -> Timber.d("VoiceMessageRecorderView shouldn't be in NONE state while moving.")
|
||||||
RecordingState.PLAYBACK -> Timber.d("VoiceMessageRecorderView shouldn't be in PLAYBACK state while moving.")
|
RecordingState.PLAYBACK -> Timber.d("VoiceMessageRecorderView shouldn't be in PLAYBACK state while moving.")
|
||||||
@ -235,7 +238,7 @@ class VoiceMessageRecorderView @JvmOverloads constructor(
|
|||||||
if (recordingState == RecordingState.STARTED) {
|
if (recordingState == RecordingState.STARTED) {
|
||||||
// Determine if cancelling or locking for the first move action.
|
// Determine if cancelling or locking for the first move action.
|
||||||
if (((currentX < firstX && rtlXMultiplier == 1) || (currentX > firstX && rtlXMultiplier == -1))
|
if (((currentX < firstX && rtlXMultiplier == 1) || (currentX > firstX && rtlXMultiplier == -1))
|
||||||
&& distanceX > distanceY) {
|
&& distanceX > distanceY && distanceX > lastDistanceX) {
|
||||||
recordingState = RecordingState.CANCELLING
|
recordingState = RecordingState.CANCELLING
|
||||||
} else if (currentY < firstY && distanceY > distanceX) {
|
} else if (currentY < firstY && distanceY > distanceX) {
|
||||||
recordingState = RecordingState.LOCKING
|
recordingState = RecordingState.LOCKING
|
||||||
|
Loading…
x
Reference in New Issue
Block a user