From 5862711cad0471654081bd922539d4684ff3cb1b Mon Sep 17 00:00:00 2001 From: kanat <> Date: Mon, 10 Jul 2023 17:32:20 -0700 Subject: [PATCH] [i74] added changelog --- CHANGELOG.md | 38 +++++++++++++++++++ .../chat/android/client/audio/AudioPlayer.kt | 5 ++- .../android/client/audio/WaveformExtractor.kt | 3 ++ .../ui/common/utils/DurationFormatter.kt | 2 + ...aultMessageComposerCenterOverlapContent.kt | 3 +- 5 files changed, 48 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5682506e0c..eb1b115a219 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ - Added `AttachmentsVerifier` to verify if the uploaded attachments are valid. [#4852](https://github.com/GetStream/stream-chat-android/pull/4852) - Added `ChannelClient.fetchCurrentUser` to fetch current user from backend. [#4860](https://github.com/GetStream/stream-chat-android/pull/4860) - Added `FetchCurrentUserListener` interface used to perform actions as side effects when the `ChatCliet.fetchCurrentUser()` method is used to fetch the current user from the backend. [#4860](https://github.com/GetStream/stream-chat-android/pull/4860) +- Added `AudioPlayer` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) ### ⚠️ Changed - Changed `newMessageIntent` lambda's signature of `NotificationHandlerFactory.createNotificationHandler()`. It receives the whole `Message`/`Channel` entity to help you create a more complex navigation intent. @@ -79,6 +80,8 @@ ### ✅ Added - Added `showDateSeparatorInEmptyThread: Boolean` to `MessageListController`. It is used to regulate whether date separators appear in empty threads. [#4742](https://github.com/GetStream/stream-chat-android/pull/4742) +- Added `StreamMediaRecorder` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- Added `AudioRecordingController` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) ### ⚠️ Changed @@ -100,6 +103,10 @@ * `streamUiMessageComposerAttachmentsPickerMediaMode` - Added Typing Users list to `ChannelItem`. [#4868](https://github.com/GetStream/stream-chat-android/pull/4868) - Added typing indicator on `ChannelLitsView`. [#4868](https://github.com/GetStream/stream-chat-android/pull/4868) +- Added `AudioRecordAttachmentPreviewFactory` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- Added `DefaultMessageComposerOverlappingContent` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- Added new custom views (`AudioRecordPlayerView`, `AudioWavesSeekBar`, `WaveformView`) as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- Added `AudioRecordsGroupView` in addition to `MediaAttachmentsGroupView` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) ### ⚠️ Changed - Replaced the method parameter `replyMessageId: String` with `replyTo: Message` inside `ReplyMessageClickListener.onReplyClick()`. The new parameter now contains the complete message to which the reply was made. [#4639](https://github.com/GetStream/stream-chat-android/pull/4639) @@ -107,6 +114,34 @@ - Added the parameter `parentMessageId: String?` to the class `MessageListViewModel.ShowMessage`. If the message you want to scroll to is a thread message, pass in its parent message ID, otherwise you can pass in `null`. [#4639](https://github.com/GetStream/stream-chat-android/pull/4639) - 🚨 Breaking change: Removed `ChatUI.showThreadSeparatorInEmptyThread`. It has been replaced by `MessageListController.showDateSeparatorInEmptyThread`. If you are using our `ViewModel` factory, `MessageListViewModelFactory.showDateSeparatorInEmptyThread` will pass the parameter through to the `MessageListController` contained by `MessageListViewMode`. [#4742](https://github.com/GetStream/stream-chat-android/pull/4742) - Create new `bind()` method on `BaseChannelListItemViewHolder` that takes as parameter `ChannelItem`. [#4868](https://github.com/GetStream/stream-chat-android/pull/4868) +- Added `MessageComposerView.setCenterOverlapContent` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- `FileAttachmentsView` supports new audio recording view type as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- Added audio recording style customization into `MessageComposerViewStyle` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) + * `audioRecordingButtonVisible` + * `audioRecordingHoldToRecordText` + * `audioRecordingHoldToRecordTextColor` + * `audioRecordingHoldToRecordBackgroundDrawable` + * `audioRecordingHoldToRecordBackgroundDrawableTint` + * `audioRecordingSlideToCancelText` + * `audioRecordingMicIconDrawable` + * `audioRecordingMicIconDrawableTint` + * `audioRecordingLockIconDrawable` + * `audioRecordingLockIconDrawableTint` + * `audioRecordingLockedIconDrawable` + * `audioRecordingLockedIconDrawableTint` +- Added audio recording xml attrs for `MessageComposerView` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) + * `streamUiMessageComposerAudioRecordingButtonVisible` + * `streamUiMessageComposerAudioRecordingHoldToRecordText` + * `streamUiMessageComposerAudioRecordingHoldToRecordTextColor` + * `streamUiMessageComposerAudioRecordingHoldToRecordBackgroundDrawable` + * `streamUiMessageComposerAudioRecordingHoldToRecordBackgroundDrawableTint` + * `streamUiMessageComposerAudioRecordingSlideToCancelText` + * `streamUiMessageComposerAudioRecordingMicIconDrawable` + * `streamUiMessageComposerAudioRecordingMicIconDrawableTint` + * `streamUiMessageComposerAudioRecordingLockIconDrawable` + * `streamUiMessageComposerAudioRecordingLockIconDrawableTint` + * `streamUiMessageComposerAudioRecordingLockedIconDrawable` + * `streamUiMessageComposerAudioRecordingLockedIconDrawableTint` ### ❌ Removed @@ -126,6 +161,9 @@ - Add `ThreadMessagesStart` that allows to control if the stack of thread messages starts at the bottom or the top. [#4807](https://github.com/GetStream/stream-chat-android/pull/4807) - Add `PickerMediaMode` that allows control if the camera recorder and/or take picture feature is allowed or not. [#4812](https://github.com/GetStream/stream-chat-android/pull/4812) - Added `MessageTheme` to customize the message components into `ChatTheme`. [#4856](https://github.com/GetStream/stream-chat-android/pull/4856) +- Added `StatefulStreamMediaRecorder` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- Added `AudioRecordAttachmentFactory` as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) +- Added new components (`RunningWaveForm`, `AudioWaveVSeekbar`, `AudioRecordAttachmentContent`, `AudioRecordGroupContent`) as a part of `async-voice-messaging` feature. [#4828](https://github.com/GetStream/stream-chat-android/pull/4828) ### ⚠️ Changed - 🚨 Breaking change: Renamed `onHeaderActionClick` to `onHeaderTitleClick` in `MessagesScreen`. Change made in order to better reflect the handler's behavior. [#4535](https://github.com/GetStream/stream-chat-android/pull/4535) diff --git a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/AudioPlayer.kt b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/AudioPlayer.kt index d7c5fc05f48..b69687b9648 100644 --- a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/AudioPlayer.kt +++ b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/AudioPlayer.kt @@ -16,10 +16,13 @@ package io.getstream.chat.android.client.audio -@Suppress("TooManyFunctions") +import io.getstream.chat.android.core.internal.InternalStreamChatApi + /** * Audio player used to play audio messages. */ +@Suppress("TooManyFunctions") +@InternalStreamChatApi public interface AudioPlayer { /** diff --git a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/WaveformExtractor.kt b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/WaveformExtractor.kt index 4c1a3a71864..3c4f70372ec 100644 --- a/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/WaveformExtractor.kt +++ b/stream-chat-android-client/src/main/java/io/getstream/chat/android/client/audio/WaveformExtractor.kt @@ -23,12 +23,14 @@ import android.media.MediaExtractor import android.media.MediaFormat import android.net.Uri import android.os.Build +import io.getstream.chat.android.core.internal.InternalStreamChatApi import io.getstream.log.taggedLogger import java.nio.ByteBuffer import java.util.concurrent.CountDownLatch import kotlin.math.pow import kotlin.math.sqrt +@InternalStreamChatApi public class WaveformExtractor( private val context: Context, private val key: String, @@ -258,6 +260,7 @@ public class WaveformExtractor( public fun MediaCodec.BufferInfo.isEof(): Boolean = flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM != 0 +@InternalStreamChatApi public fun interface ExtractorCallBack { public fun onProgress(extractor: WaveformExtractor, value: Float) } diff --git a/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/DurationFormatter.kt b/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/DurationFormatter.kt index d775c96fca4..d7ac5721148 100644 --- a/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/DurationFormatter.kt +++ b/stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/DurationFormatter.kt @@ -16,11 +16,13 @@ package io.getstream.chat.android.ui.common.utils +import io.getstream.chat.android.core.internal.InternalStreamChatApi import kotlin.time.DurationUnit import kotlin.time.toDuration private const val TIME_DIVIDER = 60 +@InternalStreamChatApi public object DurationFormatter { /** diff --git a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerCenterOverlapContent.kt b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerCenterOverlapContent.kt index db5fc3e96df..40d607258f3 100644 --- a/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerCenterOverlapContent.kt +++ b/stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerCenterOverlapContent.kt @@ -58,11 +58,10 @@ import io.getstream.chat.android.ui.utils.extensions.applyTint import io.getstream.chat.android.ui.utils.extensions.displayMetrics import io.getstream.chat.android.ui.utils.extensions.dpToPx import io.getstream.log.taggedLogger -import org.w3c.dom.Text private const val TAG = "OverlappingContent" -@OptIn(InternalStreamChatApi::class) +@InternalStreamChatApi public class DefaultMessageComposerOverlappingContent : ConstraintLayout, MessageComposerContent { public constructor(context: Context) : super(context)