diff --git a/app/src/main/java/com/rosetta/messenger/ui/chats/input/ChatDetailInput.kt b/app/src/main/java/com/rosetta/messenger/ui/chats/input/ChatDetailInput.kt index b219512..c31b1eb 100644 --- a/app/src/main/java/com/rosetta/messenger/ui/chats/input/ChatDetailInput.kt +++ b/app/src/main/java/com/rosetta/messenger/ui/chats/input/ChatDetailInput.kt @@ -2513,33 +2513,32 @@ fun MessageInputBar( val absDy = kotlin.math.abs(dy) if (absDx > maxAbsDx) maxAbsDx = absDx if (absDy > maxAbsDy) maxAbsDy = absDy - } else if ( - recordUiState == RecordUiState.RECORDING || - recordUiState == RecordUiState.LOCKED - ) { + } else if (recordUiState == RecordUiState.RECORDING) { + // Only RECORDING processes slide gestures + // LOCKED/PAUSED: no gesture processing (Telegram: return false) val dx = change.position.x - pressStartX val dy = change.position.y - pressStartY slideDx = dx slideDy = dy + lockProgress = ((-dy) / lockDragThresholdPx).coerceIn(0f, 1f) - if (recordUiState == RecordUiState.RECORDING) { - lockProgress = ((-dy) / lockDragThresholdPx).coerceIn(0f, 1f) - if (dx <= -cancelDragThresholdPx) { - inputJumpLog( - "gesture CANCEL dx=${dx.toInt()} threshold=${cancelDragThresholdPx.toInt()} mode=$recordMode" - ) - stopVoiceRecording(send = false) - setRecordUiState(RecordUiState.IDLE, "slide-cancel") - resetGestureState() - finished = true - } else if (dy <= -lockDragThresholdPx) { - view.performHapticFeedback(android.view.HapticFeedbackConstants.KEYBOARD_TAP) - lockProgress = 1f - setRecordUiState( - RecordUiState.LOCKED, - "slide-lock dy=${dy.toInt()}" - ) - } + if (dx <= -cancelDragThresholdPx) { + inputJumpLog( + "gesture CANCEL dx=${dx.toInt()} threshold=${cancelDragThresholdPx.toInt()} mode=$recordMode" + ) + stopVoiceRecording(send = false) + setRecordUiState(RecordUiState.IDLE, "slide-cancel") + resetGestureState() + finished = true + } else if (dy <= -lockDragThresholdPx) { + view.performHapticFeedback(android.view.HapticFeedbackConstants.KEYBOARD_TAP) + lockProgress = 1f + slideDx = 0f // reset horizontal slide on lock + slideDy = 0f + setRecordUiState( + RecordUiState.LOCKED, + "slide-lock dy=${dy.toInt()}" + ) } } change.consume()