Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
### 🐞 Fixed
- Fix poll results sheet cutting off the last option items. [#6043](https://github.com/GetStream/stream-chat-android/pull/6043)
- Fix poll dialogs layout on edge-to-edge devices by applying system bar insets. [#6043](https://github.com/GetStream/stream-chat-android/pull/6043)
- Fix audio recording content stuck in 'held' state. [#6078](https://github.com/GetStream/stream-chat-android/pull/6078)

### ⬆️ Improved
- Add stricter `ExoPlayer` cleanup logic to prevent keeping `AudioMix` partial wake locks. [#6075](https://github.com/GetStream/stream-chat-android/pull/6075)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ public open class DefaultMessageComposerOverlappingContent : ConstraintLayout, M
logger.w { "[onTouchEvent] rejected ACTION_DOWN (state is not Idle): $state" }
return false
}
if (action != MotionEvent.ACTION_DOWN && state !is RecordingState.Hold) {
// For other actions, require Hold state OR allow gesture-end actions during transition window
val isGestureEndAction = action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL
val isInRecordingTransition = (micPopup != null || lockPopup != null) && _state is RecordingState.Idle
val shouldAllowTransitionWindow = isGestureEndAction && isInRecordingTransition
if (action != MotionEvent.ACTION_DOWN && state !is RecordingState.Hold && !shouldAllowTransitionWindow) {
logger.w { "[onTouchEvent] rejected ${actionToString(action)} (state is not Hold): $state" }
return false
}
Expand Down Expand Up @@ -536,6 +540,9 @@ public open class DefaultMessageComposerOverlappingContent : ConstraintLayout, M

MotionEvent.ACTION_CANCEL -> {
logger.d { "[onTouchEvent] ACTION_CANCEL" }
if (isInRecordingTransition) {
resetUI()
}
recordButtonCancelListener?.invoke()
return true
}
Expand All @@ -547,6 +554,9 @@ public open class DefaultMessageComposerOverlappingContent : ConstraintLayout, M
if (duration > HOLD_TIMEOUT_MS) {
recordButtonReleaseListener?.invoke()
} else {
if (isInRecordingTransition) {
resetUI()
}
showHoldPopup()
recordButtonCancelListener?.invoke()
}
Expand Down
Loading