Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[i211] Customize deleted message UI #5050

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,15 @@
### ⬆️ Improved

### ✅ Added
- Added `Message.moderationDetails` due to support of the new moderation API. [#5035](https://github.com/GetStream/stream-chat-android/pull/5035)
- Added `MessageModerationDetails` class.

### ⚠️ Changed

### ❌ Removed
- Removed `Message.syncDescription` due to removal of the old moderation API. [#5035](https://github.com/GetStream/stream-chat-android/pull/5035)
- Removed `MessageSyncContent` class and its subclasses.
- Removed `MessageSyncType` class.

## stream-chat-android-client
### 🐞 Fixed
- Fixed duplicate send message requests. [5039](https://github.com/GetStream/stream-chat-android/pull/5039)

### ⬆️ Improved
- Pass `message` with `result` in `SendMessageDebugger`. [#5037](https://github.com/GetStream/stream-chat-android/pull/5037)
- Use shortService instead of dataSync for our workmanager job. [#5041](https://github.com/GetStream/stream-chat-android/pull/5041)

### ✅ Added

Expand Down Expand Up @@ -57,23 +49,24 @@
### ⬆️ Improved

### ✅ Added
- Added `callback` param to `MessageComposerController.sendMessage` method. [#5038](https://github.com/GetStream/stream-chat-android/pull/5038)

### ⚠️ Changed

### ❌ Removed

## stream-chat-android-ui-components
### 🐞 Fixed
- Fixed channel title not being centered vertically when mo last message exists. [#5043](https://github.com/GetStream/stream-chat-android/pull/5043)

### ⬆️ Improved

### ✅ Added
- Added `callback` param to `MessageComposerViewModel.sendMessage` method. [#5038](https://github.com/GetStream/stream-chat-android/pull/5038)
- Added UI customizations for deleted message. [#5050](https://github.com/GetStream/stream-chat-android/pull/5050)
* `MessageListItemStyle.textStyleMessageDeletedMine`
* `MessageListItemStyle.messageDeletedBackgroundMine`
* `MessageListItemStyle.textStyleMessageDeletedTheirs`
* `MessageListItemStyle.messageDeletedBackgroundTheirs`

### ⚠️ Changed
- Supported new moderation API. [#5035](https://github.com/GetStream/stream-chat-android/pull/5035)

### ❌ Removed

Expand All @@ -83,10 +76,8 @@
### ⬆️ Improved

### ✅ Added
- Added `callback` param to `MessageComposerViewModel.sendMessage` method. [#5038](https://github.com/GetStream/stream-chat-android/pull/5038)

### ⚠️ Changed
- Supported new moderation API. [#5035](https://github.com/GetStream/stream-chat-android/pull/5035)

### ❌ Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,8 @@ public final class io/getstream/chat/android/ui/feature/messages/list/GiphyViewH
}

public final class io/getstream/chat/android/ui/feature/messages/list/MessageListItemStyle : io/getstream/chat/android/ui/helper/ViewStyle {
public fun <init> (Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;IIILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/view/ViewReactionsViewStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;IIFIFLio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;IIIFFZLandroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;II)V
public fun <init> (Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;IIILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/view/ViewReactionsViewStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;IIFIFLio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;IIIFFZLandroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;II)V
public synthetic fun <init> (Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;IIILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/view/ViewReactionsViewStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;IIFIFLio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;IIIFFZLandroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;IIIILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ljava/lang/Integer;
public final fun component10 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component11 ()Lio/getstream/chat/android/ui/font/TextStyle;
Expand All @@ -1613,33 +1614,37 @@ public final class io/getstream/chat/android/ui/feature/messages/list/MessageLis
public final fun component24 ()Landroid/graphics/drawable/Drawable;
public final fun component25 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component26 ()I
public final fun component27 ()I
public final fun component28 ()F
public final fun component29 ()I
public final fun component27 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component28 ()I
public final fun component29 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component3 ()Ljava/lang/Integer;
public final fun component30 ()F
public final fun component31 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component32 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component33 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component34 ()Landroid/graphics/drawable/Drawable;
public final fun component35 ()I
public final fun component36 ()I
public final fun component37 ()I
public final fun component38 ()F
public final fun component39 ()F
public final fun component30 ()I
public final fun component31 ()I
public final fun component32 ()F
public final fun component33 ()I
public final fun component34 ()F
public final fun component35 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component36 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component37 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component38 ()Landroid/graphics/drawable/Drawable;
public final fun component39 ()I
public final fun component4 ()Ljava/lang/Integer;
public final fun component40 ()Z
public final fun component41 ()Landroid/graphics/drawable/Drawable;
public final fun component42 ()Landroid/graphics/drawable/Drawable;
public final fun component43 ()I
public final fun component44 ()I
public final fun component40 ()I
public final fun component41 ()I
public final fun component42 ()F
public final fun component43 ()F
public final fun component44 ()Z
public final fun component45 ()Landroid/graphics/drawable/Drawable;
public final fun component46 ()Landroid/graphics/drawable/Drawable;
public final fun component47 ()I
public final fun component48 ()I
public final fun component5 ()I
public final fun component6 ()I
public final fun component7 ()I
public final fun component8 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun component9 ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun copy (Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;IIILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/view/ViewReactionsViewStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;IIFIFLio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;IIIFFZLandroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;II)Lio/getstream/chat/android/ui/feature/messages/list/MessageListItemStyle;
public static synthetic fun copy$default (Lio/getstream/chat/android/ui/feature/messages/list/MessageListItemStyle;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;IIILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/view/ViewReactionsViewStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;IIFIFLio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;IIIFFZLandroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;IIIILjava/lang/Object;)Lio/getstream/chat/android/ui/feature/messages/list/MessageListItemStyle;
public final fun copy (Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;IIILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/view/ViewReactionsViewStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;IIFIFLio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;IIIFFZLandroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;II)Lio/getstream/chat/android/ui/feature/messages/list/MessageListItemStyle;
public static synthetic fun copy$default (Lio/getstream/chat/android/ui/feature/messages/list/MessageListItemStyle;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;IIILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/view/ViewReactionsViewStyle;Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Lio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;ILio/getstream/chat/android/ui/font/TextStyle;IIFIFLio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Lio/getstream/chat/android/ui/font/TextStyle;Landroid/graphics/drawable/Drawable;IIIFFZLandroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;IIIILjava/lang/Object;)Lio/getstream/chat/android/ui/feature/messages/list/MessageListItemStyle;
public fun equals (Ljava/lang/Object;)Z
public final fun getDateSeparatorBackgroundColor ()I
public final fun getEditReactionsViewStyle ()Lio/getstream/chat/android/ui/feature/messages/list/reactions/edit/EditReactionsViewStyle;
Expand All @@ -1654,6 +1659,8 @@ public final class io/getstream/chat/android/ui/feature/messages/list/MessageLis
public final fun getMessageBackgroundColorMine ()Ljava/lang/Integer;
public final fun getMessageBackgroundColorTheirs ()Ljava/lang/Integer;
public final fun getMessageDeletedBackground ()I
public final fun getMessageDeletedBackgroundMine ()I
public final fun getMessageDeletedBackgroundTheirs ()I
public final fun getMessageEndMargin ()I
public final fun getMessageLinkBackgroundColorMine ()I
public final fun getMessageLinkBackgroundColorTheirs ()I
Expand Down Expand Up @@ -1681,6 +1688,8 @@ public final class io/getstream/chat/android/ui/feature/messages/list/MessageLis
public final fun getTextStyleLinkTitle ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun getTextStyleMessageDate ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun getTextStyleMessageDeleted ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun getTextStyleMessageDeletedMine ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun getTextStyleMessageDeletedTheirs ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun getTextStyleMine ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun getTextStyleSystemMessage ()Lio/getstream/chat/android/ui/font/TextStyle;
public final fun getTextStyleTheirs ()Lio/getstream/chat/android/ui/font/TextStyle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ import io.getstream.chat.android.ui.utils.extensions.getDrawableCompat
* @property iconOnlyVisibleToYou Icon for message's pending status. Default value is [R.drawable.stream_ui_ic_icon_eye_off].
* @property textStyleMessageDeleted Appearance for message deleted text.
* @property messageDeletedBackground Background color for deleted message. Default value is [R.color.stream_ui_grey_whisper].
* @property textStyleMessageDeletedMine Appearance for mine message deleted text. Default value is [textStyleMessageDeleted].
* @property messageDeletedBackgroundMine Background color for mine deleted message. Default value is [messageDeletedBackground].
* @property textStyleMessageDeletedTheirs Appearance for theirs message deleted text. Default value is [textStyleMessageDeleted].
* @property messageDeletedBackgroundTheirs Background color for theirs deleted message. Default value is [messageDeletedBackground].
* @property messageStrokeColorMine Stroke color for message sent by the current user. Default value is [MESSAGE_STROKE_COLOR_MINE].
* @property messageStrokeWidthMine Stroke width for message sent by the current user. Default value is [MESSAGE_STROKE_WIDTH_MINE].
* @property messageStrokeColorTheirs Stroke color for message sent by other user. Default value is [MESSAGE_STROKE_COLOR_THEIRS].
Expand Down Expand Up @@ -116,6 +120,10 @@ public data class MessageListItemStyle(
public val iconOnlyVisibleToYou: Drawable,
public val textStyleMessageDeleted: TextStyle,
@ColorInt public val messageDeletedBackground: Int,
public val textStyleMessageDeletedMine: TextStyle = textStyleMessageDeleted,
@ColorInt public val messageDeletedBackgroundMine: Int = messageDeletedBackground,
public val textStyleMessageDeletedTheirs: TextStyle = textStyleMessageDeleted,
@ColorInt public val messageDeletedBackgroundTheirs: Int = messageDeletedBackground,
@ColorInt public val messageStrokeColorMine: Int,
@Px public val messageStrokeWidthMine: Float,
@ColorInt public val messageStrokeColorTheirs: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ internal class MessageDeletedViewHolder(

if (diff?.deleted == false) return

binding.deleteLabel.setTextStyle(style.textStyleMessageDeleted)
binding.deleteLabel.setTextStyle(
when (data.isTheirs) {
true -> style.textStyleMessageDeletedTheirs
else -> style.textStyleMessageDeletedMine
},
)

binding.messageContainer.updateLayoutParams<ConstraintLayout.LayoutParams> {
horizontalBias = if (data.isTheirs) 0f else 1f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ public open class MessageBackgroundFactoryImpl(private val style: MessageListIte
return shapeAppearanceModel(context, DEFAULT_CORNER_RADIUS, 0F, data.isMine, data.isBottomPosition())
.let(::MaterialShapeDrawable)
.apply {
setTint(style.messageDeletedBackground)
setTint(
when (data.isTheirs) {
true -> style.messageDeletedBackgroundTheirs
else -> style.messageDeletedBackgroundMine
},
)
}
}

Expand Down