Skip to content

Commit

Permalink
Merge branch 'develop' into fix-channel-list-blinking
Browse files Browse the repository at this point in the history
  • Loading branch information
andremion authored Dec 17, 2024
2 parents 2a42c03 + eac94b7 commit 5b63b64
Show file tree
Hide file tree
Showing 32 changed files with 978 additions and 396 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
### 🐞 Fixed

### ⬆️ Improved
- Add support for partial media access in `MediaAttachmentFragment` and `FileAttachmentFragment` for Android 14+. [#5524](https://github.com/GetStream/stream-chat-android/pull/5524)

### ✅ Added
- Add `ThreadListView` component for showing the list of threads for the user. [#5491](https://github.com/GetStream/stream-chat-android/pull/5491)
Expand All @@ -86,6 +87,7 @@
## stream-chat-android-compose
### 🐞 Fixed
- Fix keyboard not closing when opening the attachments picker from `MessagesScreen`. [#5506](https://github.com/GetStream/stream-chat-android/pull/5506)
- The `ChatTheme.downloadAttachmentUriGenerator` and `ChatTheme.downloadRequestInterceptor` properties are forwarded within the `MediaGalleryPreviewActivity` to be used when downloading attachments. [#5522](https://github.com/GetStream/stream-chat-android/pull/5522)

### ⬆️ Improved
- Add support for partial media access in `AttachmentsPickerImagesTabFactory` and `AttachmentsPickerFilesTabFactory` for Android 14+. [#5518](https://github.com/GetStream/stream-chat-android/pull/5518)
Expand Down
20 changes: 11 additions & 9 deletions stream-chat-android-compose/api/stream-chat-android-compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ public final class io/getstream/chat/android/compose/ui/attachments/AttachmentFa
public final class io/getstream/chat/android/compose/ui/attachments/StreamAttachmentFactories {
public static final field $stable I
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/attachments/StreamAttachmentFactories;
public final fun defaultFactories (Lkotlin/jvm/functions/Function0;ILio/getstream/chat/android/ui/common/utils/GiphyInfoType;Lio/getstream/chat/android/ui/common/utils/GiphySizingMode;Landroidx/compose/ui/layout/ContentScale;ZLkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ljava/util/List;)Ljava/util/List;
public static synthetic fun defaultFactories$default (Lio/getstream/chat/android/compose/ui/attachments/StreamAttachmentFactories;Lkotlin/jvm/functions/Function0;ILio/getstream/chat/android/ui/common/utils/GiphyInfoType;Lio/getstream/chat/android/ui/common/utils/GiphySizingMode;Landroidx/compose/ui/layout/ContentScale;ZLkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ljava/util/List;ILjava/lang/Object;)Ljava/util/List;
public final fun defaultFactories (Lkotlin/jvm/functions/Function0;ILio/getstream/chat/android/ui/common/utils/GiphyInfoType;Lio/getstream/chat/android/ui/common/utils/GiphySizingMode;Landroidx/compose/ui/layout/ContentScale;ZLkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function8;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ljava/util/List;)Ljava/util/List;
public static synthetic fun defaultFactories$default (Lio/getstream/chat/android/compose/ui/attachments/StreamAttachmentFactories;Lkotlin/jvm/functions/Function0;ILio/getstream/chat/android/ui/common/utils/GiphyInfoType;Lio/getstream/chat/android/ui/common/utils/GiphySizingMode;Landroidx/compose/ui/layout/ContentScale;ZLkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function8;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ljava/util/List;ILjava/lang/Object;)Ljava/util/List;
public final fun defaultQuotedFactories ()Ljava/util/List;
}

Expand Down Expand Up @@ -463,7 +463,7 @@ public final class io/getstream/chat/android/compose/ui/attachments/content/Link
}

public final class io/getstream/chat/android/compose/ui/attachments/content/MediaAttachmentContentKt {
public static final fun MediaAttachmentContent (Lio/getstream/chat/android/compose/state/messages/attachments/AttachmentState;Landroidx/compose/ui/Modifier;IZLkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
public static final fun MediaAttachmentContent (Lio/getstream/chat/android/compose/state/messages/attachments/AttachmentState;Landroidx/compose/ui/Modifier;IZLkotlin/jvm/functions/Function8;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
}

public final class io/getstream/chat/android/compose/ui/attachments/content/MediaAttachmentPreviewContentKt {
Expand Down Expand Up @@ -544,8 +544,8 @@ public final class io/getstream/chat/android/compose/ui/attachments/factory/Link
public final class io/getstream/chat/android/compose/ui/attachments/factory/MediaAttachmentFactory : io/getstream/chat/android/compose/ui/attachments/AttachmentFactory {
public static final field $stable I
public fun <init> ()V
public fun <init> (IZLkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)V
public synthetic fun <init> (IZLkotlin/jvm/functions/Function6;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (IZLkotlin/jvm/functions/Function8;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)V
public synthetic fun <init> (IZLkotlin/jvm/functions/Function8;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
}

public final class io/getstream/chat/android/compose/ui/attachments/factory/QuotedAttachmentFactory : io/getstream/chat/android/compose/ui/attachments/AttachmentFactory {
Expand Down Expand Up @@ -597,8 +597,8 @@ public final class io/getstream/chat/android/compose/ui/attachments/preview/Medi
}

public final class io/getstream/chat/android/compose/ui/attachments/preview/MediaGalleryPreviewActivity$Companion {
public final fun getIntent (Landroid/content/Context;Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;Z)Landroid/content/Intent;
public static synthetic fun getIntent$default (Lio/getstream/chat/android/compose/ui/attachments/preview/MediaGalleryPreviewActivity$Companion;Landroid/content/Context;Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;ZILjava/lang/Object;)Landroid/content/Intent;
public final fun getIntent (Landroid/content/Context;Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;Lio/getstream/chat/android/ui/common/helper/DownloadRequestInterceptor;Lio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;Z)Landroid/content/Intent;
public static synthetic fun getIntent$default (Lio/getstream/chat/android/compose/ui/attachments/preview/MediaGalleryPreviewActivity$Companion;Landroid/content/Context;Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;Lio/getstream/chat/android/ui/common/helper/DownloadRequestInterceptor;Lio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;ZILjava/lang/Object;)Landroid/content/Intent;
}

public final class io/getstream/chat/android/compose/ui/attachments/preview/MediaGalleryPreviewContract : androidx/activity/result/contract/ActivityResultContract {
Expand All @@ -612,8 +612,10 @@ public final class io/getstream/chat/android/compose/ui/attachments/preview/Medi

public final class io/getstream/chat/android/compose/ui/attachments/preview/MediaGalleryPreviewContract$Input {
public static final field $stable I
public fun <init> (Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;Z)V
public synthetic fun <init> (Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;Lio/getstream/chat/android/ui/common/helper/DownloadRequestInterceptor;Lio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;Z)V
public synthetic fun <init> (Lio/getstream/chat/android/models/Message;IZLio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;Lio/getstream/chat/android/ui/common/helper/DownloadRequestInterceptor;Lio/getstream/chat/android/ui/common/images/resizing/StreamCdnImageResizing;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun getDownloadAttachmentUriGenerator ()Lio/getstream/chat/android/ui/common/helper/DownloadAttachmentUriGenerator;
public final fun getDownloadRequestInterceptor ()Lio/getstream/chat/android/ui/common/helper/DownloadRequestInterceptor;
public final fun getInitialPosition ()I
public final fun getMessage ()Lio/getstream/chat/android/models/Message;
public final fun getSkipEnrichUrl ()Z
Expand Down
2 changes: 0 additions & 2 deletions stream-chat-android-compose/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
<ID>LongMethod:PollSwitchList.kt$@Composable public fun PollSwitchList( modifier: Modifier = Modifier, pollSwitchItems: List&lt;PollSwitchItem>, onSwitchesChanged: (List&lt;PollSwitchItem>) -> Unit, itemHeightSize: Dp = ChatTheme.dimens.pollOptionInputHeight, itemInnerPadding: PaddingValues = PaddingValues(horizontal = 16.dp, vertical = 16.dp), )</ID>
<ID>LongMethod:StreamTypography.kt$StreamTypography.Companion$public fun defaultTypography(fontFamily: FontFamily? = null): StreamTypography</ID>
<ID>LongParameterList:AudioRecordAttachmentContent.kt$( modifier: Modifier = Modifier, attachment: Attachment, playerState: AudioPlayerState, size: ComponentSize, padding: ComponentPadding, playbackToggleStyle: (isPlaying: Boolean) -> IconContainerStyle, timerStyle: TextContainerStyle, waveformSliderStyle: WaveformSliderLayoutStyle, onPlayToggleClick: (Attachment) -> Unit = {}, onThumbDragStart: (Attachment) -> Unit = {}, onThumbDragStop: (Attachment, Float) -> Unit = { _, _ -> }, tailContent: @Composable (isPlaying: Boolean) -> Unit = {}, )</ID>
<ID>LongParameterList:MediaAttachmentContent.kt$( attachment: Attachment, message: Message, skipEnrichUrl: Boolean, onMediaGalleryPreviewResult: (MediaGalleryPreviewResult?) -> Unit = {}, onLongItemClick: (Message) -> Unit, onContentItemClick: ( mediaGalleryPreviewLauncher: ManagedActivityResultLauncher&lt;MediaGalleryPreviewContract.Input, MediaGalleryPreviewResult?>, message: Message, attachmentPosition: Int, videoThumbnailsEnabled: Boolean, streamCdnImageResizing: StreamCdnImageResizing, skipEnrichUrl: Boolean, ) -> Unit, overlayContent: @Composable (attachmentType: String?) -> Unit, )</ID>
<ID>LongParameterList:MediaAttachmentContent.kt$( mediaGalleryPreviewLauncher: ManagedActivityResultLauncher&lt;MediaGalleryPreviewContract.Input, MediaGalleryPreviewResult?>, message: Message, attachmentPosition: Int, videoThumbnailsEnabled: Boolean, streamCdnImageResizing: StreamCdnImageResizing, skipEnrichUrl: Boolean, )</ID>
<ID>LongParameterList:MediaGalleryPreviewActivityAttachmentState.kt$MediaGalleryPreviewActivityAttachmentState$( val name: String?, val thumbUrl: String?, val imageUrl: String?, val assetUrl: String?, val originalWidth: Int?, val originalHeight: Int?, val type: String?, )</ID>
<ID>LongParameterList:MessagesScreen.kt$( listViewModel: MessageListViewModel, composerViewModel: MessageComposerViewModel, selectedMessageState: SelectedMessageState?, selectedMessage: Message, skipPushNotification: Boolean, skipEnrichUrl: Boolean, )</ID>
<ID>LongParameterList:PollMessageContent.kt$( modifier: Modifier = Modifier, poll: Poll, option: Option, voteCount: Int, totalVoteCount: Int, users: List&lt;User>, checkedCount: Int, checked: Boolean, onCastVote: () -> Unit, onRemoveVote: () -> Unit, )</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import io.getstream.chat.android.compose.ui.theme.StreamDimens
import io.getstream.chat.android.compose.viewmodel.messages.AudioPlayerViewModelFactory
import io.getstream.chat.android.models.Attachment
import io.getstream.chat.android.models.Message
import io.getstream.chat.android.ui.common.helper.DownloadAttachmentUriGenerator
import io.getstream.chat.android.ui.common.helper.DownloadRequestInterceptor
import io.getstream.chat.android.ui.common.images.resizing.StreamCdnImageResizing
import io.getstream.chat.android.ui.common.utils.GiphyInfoType
import io.getstream.chat.android.ui.common.utils.GiphySizingMode
Expand Down Expand Up @@ -101,6 +103,8 @@ public object StreamAttachmentFactories {
message: Message,
attachmentPosition: Int,
videoThumbnailsEnabled: Boolean,
downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator,
downloadRequestInterceptor: DownloadRequestInterceptor,
streamCdnImageResizing: StreamCdnImageResizing,
skipEnrichUrl: Boolean,
) -> Unit = ::onMediaAttachmentContentItemClick,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ import io.getstream.chat.android.models.Attachment
import io.getstream.chat.android.models.AttachmentType
import io.getstream.chat.android.models.Message
import io.getstream.chat.android.models.SyncStatus
import io.getstream.chat.android.ui.common.helper.DownloadAttachmentUriGenerator
import io.getstream.chat.android.ui.common.helper.DownloadRequestInterceptor
import io.getstream.chat.android.ui.common.images.resizing.StreamCdnImageResizing
import io.getstream.chat.android.ui.common.images.resizing.applyStreamCdnImageResizingIfEnabled
import io.getstream.chat.android.ui.common.utils.extensions.imagePreviewUrl
Expand Down Expand Up @@ -111,6 +113,8 @@ public fun MediaAttachmentContent(
message: Message,
attachmentPosition: Int,
videoThumbnailsEnabled: Boolean,
downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator,
downloadRequestInterceptor: DownloadRequestInterceptor,
streamCdnImageResizing: StreamCdnImageResizing,
skipEnrichUrl: Boolean,
) -> Unit = ::onMediaAttachmentContentItemClick,
Expand Down Expand Up @@ -182,6 +186,7 @@ public fun MediaAttachmentContent(
* @param overlayContent Represents the content overlaid above attachment previews.
* Usually used to display a play button over video previews.
*/
@Suppress("LongParameterList")
@Composable
internal fun SingleMediaAttachment(
attachment: Attachment,
Expand All @@ -194,6 +199,8 @@ internal fun SingleMediaAttachment(
message: Message,
attachmentPosition: Int,
videoThumbnailsEnabled: Boolean,
downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator,
downloadRequestInterceptor: DownloadRequestInterceptor,
streamCdnImageResizing: StreamCdnImageResizing,
skipEnrichUrl: Boolean,
) -> Unit,
Expand Down Expand Up @@ -276,6 +283,8 @@ internal fun RowScope.MultipleMediaAttachments(
message: Message,
attachmentPosition: Int,
videoThumbnailsEnabled: Boolean,
downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator,
downloadRequestInterceptor: DownloadRequestInterceptor,
streamCdnImageResizing: StreamCdnImageResizing,
skipEnrichUrl: Boolean,
) -> Unit,
Expand Down Expand Up @@ -392,6 +401,8 @@ internal fun MediaAttachmentContentItem(
message: Message,
attachmentPosition: Int,
videoThumbnailsEnabled: Boolean,
downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator,
downloadRequestInterceptor: DownloadRequestInterceptor,
streamCdnImageResizing: StreamCdnImageResizing,
skipEnrichUrl: Boolean,
) -> Unit,
Expand Down Expand Up @@ -445,6 +456,9 @@ internal fun MediaAttachmentContentItem(
val areVideosEnabled = ChatTheme.videoThumbnailsEnabled
val streamCdnImageResizing = ChatTheme.streamCdnImageResizing

val downloadAttachmentUriGenerator = ChatTheme.streamDownloadAttachmentUriGenerator
val downloadRequestInterceptor = ChatTheme.streamDownloadRequestInterceptor

Box(
modifier = modifier
.background(Color.Black)
Expand All @@ -460,6 +474,8 @@ internal fun MediaAttachmentContentItem(
message,
attachmentPosition,
areVideosEnabled,
downloadAttachmentUriGenerator,
downloadRequestInterceptor,
streamCdnImageResizing,
skipEnrichUrl,
)
Expand Down Expand Up @@ -596,11 +612,14 @@ private const val EqualDimensionsRatio = 1f
* a link attachment. Used when updating the message from the gallery by doing actions
* such as deleting an attachment.
*/
@Suppress("LongParameterList")
internal fun onMediaAttachmentContentItemClick(
mediaGalleryPreviewLauncher: ManagedActivityResultLauncher<MediaGalleryPreviewContract.Input, MediaGalleryPreviewResult?>,
message: Message,
attachmentPosition: Int,
videoThumbnailsEnabled: Boolean,
downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator,
downloadRequestInterceptor: DownloadRequestInterceptor,
streamCdnImageResizing: StreamCdnImageResizing,
skipEnrichUrl: Boolean,
) {
Expand All @@ -609,6 +628,8 @@ internal fun onMediaAttachmentContentItemClick(
message = message,
initialPosition = attachmentPosition,
videoThumbnailsEnabled = videoThumbnailsEnabled,
downloadAttachmentUriGenerator = downloadAttachmentUriGenerator,
downloadRequestInterceptor = downloadRequestInterceptor,
streamCdnImageResizing = streamCdnImageResizing,
skipEnrichUrl = skipEnrichUrl,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import io.getstream.chat.android.compose.ui.attachments.content.onMediaAttachmen
import io.getstream.chat.android.compose.ui.attachments.preview.MediaGalleryPreviewContract.Input
import io.getstream.chat.android.models.AttachmentType
import io.getstream.chat.android.models.Message
import io.getstream.chat.android.ui.common.helper.DownloadAttachmentUriGenerator
import io.getstream.chat.android.ui.common.helper.DownloadRequestInterceptor
import io.getstream.chat.android.ui.common.images.resizing.StreamCdnImageResizing

/**
Expand All @@ -64,6 +66,8 @@ public class MediaAttachmentFactory(
message: Message,
attachmentPosition: Int,
videoThumbnailsEnabled: Boolean,
downloadAttachmentUriGenerator: DownloadAttachmentUriGenerator,
downloadRequestInterceptor: DownloadRequestInterceptor,
streamCdnImageResizing: StreamCdnImageResizing,
skipEnrichUrl: Boolean,
) -> Unit = ::onMediaAttachmentContentItemClick,
Expand Down
Loading

0 comments on commit 5b63b64

Please sign in to comment.