Skip to content

Commit

Permalink
[PBE-6196] expose audio recording components (#5433)
Browse files Browse the repository at this point in the history
* [PBE-6196] expose audio recording components

* add CHANGELOG

* fix detekt

---------

Co-authored-by: Aleksandar Apostolov <apostolov.alexandar@gmail.com>
  • Loading branch information
kanat and aleksandar-apostolov authored Oct 7, 2024
1 parent 6ac1831 commit 8ff6882
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
- Added `ChannelListViewModel.refresh` method to refresh the channel list. [#5425](https://github.com/GetStream/stream-chat-android/pull/5425)

### ⚠️ Changed
- Exposed `DefaultMessageComposerRecordingContent` and `DefaultAudioRecordButton` components. [#5433](https://github.com/GetStream/stream-chat-android/pull/5433)

### ❌ Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,11 @@ public final class io/getstream/chat/android/compose/ui/messages/composer/intern
public final fun getLambda-2$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/messages/composer/internal/DefaultMessageComposerRecordingContentKt {
public static final fun DefaultAudioRecordButton (Lio/getstream/chat/android/ui/common/state/messages/composer/RecordingState;Lio/getstream/chat/android/compose/ui/messages/composer/actions/AudioRecordingActions;JJJLandroidx/compose/runtime/Composer;II)V
public static final fun DefaultMessageComposerRecordingContent (Lio/getstream/chat/android/ui/common/state/messages/composer/MessageComposerState;Lio/getstream/chat/android/compose/ui/messages/composer/actions/AudioRecordingActions;Landroidx/compose/runtime/Composer;II)V
}

public final class io/getstream/chat/android/compose/ui/messages/header/ComposableSingletons$MessageListHeaderKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/messages/header/ComposableSingletons$MessageListHeaderKt;
public static field lambda-1 Lkotlin/jvm/functions/Function2;
Expand Down
2 changes: 1 addition & 1 deletion stream-chat-android-compose/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ID>LongMethod:AttachmentsPicker.kt$@Composable public fun AttachmentsPicker( attachmentsPickerViewModel: AttachmentsPickerViewModel, onAttachmentsSelected: (List&lt;Attachment>) -> Unit, onTabClick: (Int, AttachmentsPickerMode) -> Unit, onAttachmentPickerAction: (AttachmentPickerAction) -> Unit = {}, onDismiss: () -> Unit, modifier: Modifier = Modifier, tabFactories: List&lt;AttachmentsPickerTabFactory> = ChatTheme.attachmentsPickerTabFactories, shape: Shape = ChatTheme.shapes.bottomSheet, )</ID>
<ID>LongMethod:AttachmentsPickerPollTabFactory.kt$AttachmentsPickerPollTabFactory$@Composable override fun PickerTabContent( onAttachmentPickerAction: (AttachmentPickerAction) -> Unit, attachments: List&lt;AttachmentPickerItemState>, onAttachmentsChanged: (List&lt;AttachmentPickerItemState>) -> Unit, onAttachmentItemSelected: (AttachmentPickerItemState) -> Unit, onAttachmentsSubmitted: (List&lt;AttachmentMetaData>) -> Unit, )</ID>
<ID>LongMethod:AudioRecordingTheme.kt$AudioRecordingTheme.Companion$@Composable public fun defaultTheme( isInDarkMode: Boolean = isSystemInDarkTheme(), typography: StreamTypography = StreamTypography.defaultTypography(), colors: StreamColors = when (isInDarkMode) { true -> StreamColors.defaultDarkColors() else -> StreamColors.defaultColors() }, ): AudioRecordingTheme</ID>
<ID>LongMethod:DefaultMessageComposerRecordingContent.kt$@Composable @OptIn(ExperimentalPermissionsApi::class) internal fun DefaultAudioRecordButton( state: RecordingState, recordingActions: AudioRecordingActions = AudioRecordingActions.None, holdToRecordThreshold: Long = HOLD_TO_RECORD_THRESHOLD, holdToRecordDismissTimeout: Long = HOLD_TO_RECORD_DISMISS_TIMEOUT, permissionRationaleDismissTimeout: Long = PERMISSION_RATIONALE_DISMISS_TIMEOUT, )</ID>
<ID>LongMethod:DefaultMessageComposerRecordingContent.kt$@Composable @OptIn(ExperimentalPermissionsApi::class) public fun DefaultAudioRecordButton( state: RecordingState, recordingActions: AudioRecordingActions = AudioRecordingActions.None, holdToRecordThreshold: Long = HOLD_TO_RECORD_THRESHOLD, holdToRecordDismissTimeout: Long = HOLD_TO_RECORD_DISMISS_TIMEOUT, permissionRationaleDismissTimeout: Long = PERMISSION_RATIONALE_DISMISS_TIMEOUT, )</ID>
<ID>LongMethod:DefaultMessageComposerRecordingContent.kt$@Composable private fun DefaultMessageComposerRecordingContent( modifier: Modifier = Modifier, durationInMs: Int = 0, waveformVisible: Boolean = true, waveformThumbVisible: Boolean = false, waveformData: List&lt;Float>, waveformPlaying: Boolean = false, waveformProgress: Float = 0f, slideToCancelVisible: Boolean = true, holdControlsVisible: Boolean = false, holdControlsLocked: Boolean = false, holdControlsOffset: IntOffset = IntOffset.Zero, recordingControlsVisible: Boolean = true, recordingStopControlVisible: Boolean = true, recordingActions: AudioRecordingActions = AudioRecordingActions.None, )</ID>
<ID>LongMethod:DefaultMessageComposerRecordingContent.kt$@Composable private fun RecordingContent( modifier: Modifier = Modifier, durationInMs: Int = 0, waveformVisible: Boolean = true, waveformThumbVisible: Boolean = false, waveformData: List&lt;Float>, waveformPlaying: Boolean = false, waveformProgress: Float = 0f, slideToCancelVisible: Boolean = true, slideToCancelProgress: Float = 0f, holdControlsOffset: IntOffset = IntOffset.Zero, onToggleRecordingPlayback: () -> Unit, onSliderDragStart: (Float) -> Unit, onSliderDragStop: (Float) -> Unit, )</ID>
<ID>LongMethod:DefaultMessageComposerRecordingContent.kt$@Composable private fun RecordingControlButtons( isStopControlVisible: Boolean, onDeleteRecording: () -> Unit, onStopRecording: () -> Unit, onCompleteRecording: (Boolean) -> Unit, )</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private const val PERMISSION_RATIONALE_DISMISS_TIMEOUT = 1000L
*/
@Composable
@OptIn(ExperimentalPermissionsApi::class)
internal fun DefaultAudioRecordButton(
public fun DefaultAudioRecordButton(
state: RecordingState,
recordingActions: AudioRecordingActions = AudioRecordingActions.None,
holdToRecordThreshold: Long = HOLD_TO_RECORD_THRESHOLD,
Expand Down Expand Up @@ -338,7 +338,7 @@ internal fun DefaultAudioRecordPermissionRationale(
* Default implementation of the audio recording content.
*/
@Composable
internal fun DefaultMessageComposerRecordingContent(
public fun DefaultMessageComposerRecordingContent(
messageComposerState: MessageComposerState,
recordingActions: AudioRecordingActions = AudioRecordingActions.None,
) {
Expand Down

0 comments on commit 8ff6882

Please sign in to comment.