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

Highlighting and tapping on user mentions #5408

Merged
merged 22 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
afe8a65
Support tapping User mentions
IsaacNewton111 Sep 13, 2024
18c6bf5
Merge branch 'develop' of https://github.com/GetStream/stream-chat-an…
IsaacNewton111 Sep 13, 2024
99855da
reformat code
IsaacNewton111 Sep 15, 2024
77d2d86
reformat code
IsaacNewton111 Sep 18, 2024
6e35fe7
Merge branch 'develop' into develop
VIPlearner Sep 18, 2024
c49b870
Merge remote-tracking branch 'refs/remotes/upstream/develop' into dev…
IsaacNewton111 Sep 20, 2024
4838d1c
fix apiDump
IsaacNewton111 Sep 20, 2024
7b469cc
Merge branch 'develop' into develop
aleksandar-apostolov Sep 20, 2024
018b1c5
Merge branch 'develop' into develop
VIPlearner Sep 24, 2024
9276083
Merge branch 'develop' into develop
aleksandar-apostolov Sep 27, 2024
9fd0764
rename onTapUserMention to onUserMentionCLick
IsaacNewton111 Sep 27, 2024
471f6f5
Merge branch 'develop' of https://github.com/VIPlearner/stream-chat-a…
IsaacNewton111 Sep 27, 2024
70aac71
Merge branch 'develop' into develop
aleksandar-apostolov Oct 1, 2024
1907ddb
Merge branch 'develop' into develop
VIPlearner Oct 1, 2024
4b3bb2b
Merge branch 'develop' into develop
VIPlearner Oct 3, 2024
fa8b43d
Merge branch 'develop' into develop
aleksandar-apostolov Oct 7, 2024
d5e2522
Merge branch 'develop' into develop
VIPlearner Oct 8, 2024
c2bc261
Merge branch 'develop' into develop
aleksandar-apostolov Oct 14, 2024
148d088
Merge branch 'develop' into develop
kanat Oct 15, 2024
32ba6dc
merge develop into develop
VIPlearner Oct 17, 2024
72df0c9
Merge branch 'develop' of https://github.com/VIPlearner/stream-chat-a…
VIPlearner Oct 17, 2024
c22b630
fix issues with build
VIPlearner Oct 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -139,63 +139,74 @@ class MessagesActivity : BaseConnectedActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

setContent {
val isInDarkMode = isSystemInDarkTheme()
val colors = if (isInDarkMode) StreamColors.defaultDarkColors() else StreamColors.defaultColors()
val typography = StreamTypography.defaultTypography()
val shapes = StreamShapes.defaultShapes()
val messageComposerTheme = MessageComposerTheme.defaultTheme(isInDarkMode, typography, shapes, colors)
ChatTheme(
isInDarkMode = isInDarkMode,
colors = colors,
shapes = shapes,
typography = typography,
dateFormatter = ChatApp.dateFormatter,
autoTranslationEnabled = ChatApp.autoTranslationEnabled,
isComposerLinkPreviewEnabled = ChatApp.isComposerLinkPreviewEnabled,
allowUIAutomationTest = true,
messageComposerTheme = messageComposerTheme.let {
it.copy(
attachmentCancelIcon = it.attachmentCancelIcon.copy(
painter = painterResource(id = R.drawable.stream_compose_ic_clear),
tint = colors.overlayDark,
backgroundColor = colors.appBackground,
),
audioRecording = it.audioRecording.copy(
enabled = true,
showRecordButtonOverSend = false,
),
)
},
attachmentPickerTheme = AttachmentPickerTheme.defaultTheme(colors).copy(
backgroundOverlay = colors.overlayDark,
backgroundSecondary = colors.inputBackground,
backgroundPrimary = colors.barsBackground,
),
reactionOptionsTheme = ReactionOptionsTheme.defaultTheme(),
messageOptionsTheme = MessageOptionsTheme.defaultTheme(
optionVisibility = MessageOptionItemVisibility(),
),
) {
Column {
if (BuildConfig.DEBUG) {
MembersList(viewModel = membersViewModel)
}
MessagesScreen(
viewModelFactory = factory,
reactionSorting = ReactionSortingByLastReactionAt,
onBackPressed = { finish() },
onHeaderTitleClick = ::openChannelInfo,
onUserAvatarClick = { user ->
Log.i("MessagesActivity", "user avatar clicked: ${user.id}")
},
)
}
SetupChatTheme()
}
}

@Composable
private fun SetupChatTheme() {
val isInDarkMode = isSystemInDarkTheme()
val colors = if (isInDarkMode) StreamColors.defaultDarkColors() else StreamColors.defaultColors()
val typography = StreamTypography.defaultTypography()
val shapes = StreamShapes.defaultShapes()
val messageComposerTheme = MessageComposerTheme.defaultTheme(isInDarkMode, typography, shapes, colors)
ChatTheme(
isInDarkMode = isInDarkMode,
colors = colors,
shapes = shapes,
typography = typography,
dateFormatter = ChatApp.dateFormatter,
autoTranslationEnabled = ChatApp.autoTranslationEnabled,
isComposerLinkPreviewEnabled = ChatApp.isComposerLinkPreviewEnabled,
allowUIAutomationTest = true,
messageComposerTheme = messageComposerTheme.let {
it.copy(
attachmentCancelIcon = it.attachmentCancelIcon.copy(
painter = painterResource(id = R.drawable.stream_compose_ic_clear),
tint = colors.overlayDark,
backgroundColor = colors.appBackground,
),
audioRecording = it.audioRecording.copy(
enabled = true,
showRecordButtonOverSend = false,
),
)
},
attachmentPickerTheme = AttachmentPickerTheme.defaultTheme(colors).copy(
backgroundOverlay = colors.overlayDark,
backgroundSecondary = colors.inputBackground,
backgroundPrimary = colors.barsBackground,
),
reactionOptionsTheme = ReactionOptionsTheme.defaultTheme(),
messageOptionsTheme = MessageOptionsTheme.defaultTheme(
optionVisibility = MessageOptionItemVisibility(),
),
) {
SetupContent()
}
}

// MyCustomUi()
@Composable
private fun SetupContent() {
Column {
if (BuildConfig.DEBUG) {
MembersList(viewModel = membersViewModel)
}
MessagesScreen(
viewModelFactory = factory,
reactionSorting = ReactionSortingByLastReactionAt,
onBackPressed = { finish() },
onHeaderTitleClick = ::openChannelInfo,
onUserAvatarClick = { user ->
Log.i("MessagesActivity", "user avatar clicked: ${user.id}")
},
onUserMentionClick = { user ->
Log.i("MessagesActivity", "user mention tapped: ${user.id}")
},
)
}
// MyCustomUi()
}

private fun openChannelInfo(channel: Channel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ public final class io/getstream/chat/android/compose/ui/components/messages/Mess
}

public final class io/getstream/chat/android/compose/ui/components/messages/MessageContentKt {
public static final fun MessageContent (Lio/getstream/chat/android/models/Message;Lio/getstream/chat/android/models/User;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;III)V
public static final fun MessageContent (Lio/getstream/chat/android/models/Message;Lio/getstream/chat/android/models/User;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;III)V
}

public final class io/getstream/chat/android/compose/ui/components/messages/MessageFooterKt {
Expand All @@ -1188,7 +1188,7 @@ public final class io/getstream/chat/android/compose/ui/components/messages/Mess
}

public final class io/getstream/chat/android/compose/ui/components/messages/MessageTextKt {
public static final fun MessageText (Lio/getstream/chat/android/models/Message;Lio/getstream/chat/android/models/User;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V
public static final fun MessageText (Lio/getstream/chat/android/models/Message;Lio/getstream/chat/android/models/User;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V
}

public final class io/getstream/chat/android/compose/ui/components/messages/MessageThreadFooterKt {
Expand Down Expand Up @@ -1481,7 +1481,7 @@ public final class io/getstream/chat/android/compose/ui/messages/MessagesScreenK
public static final fun MessageDialogs (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Landroidx/compose/runtime/Composer;I)V
public static final fun MessageMenus (Landroidx/compose/foundation/layout/BoxScope;Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Lio/getstream/chat/android/compose/viewmodel/messages/MessageComposerViewModel;ZZLandroidx/compose/runtime/Composer;I)V
public static final fun MessageModerationDialog (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Lio/getstream/chat/android/compose/viewmodel/messages/MessageComposerViewModel;ZZLandroidx/compose/runtime/Composer;I)V
public static final fun MessagesScreen (Lio/getstream/chat/android/compose/viewmodel/messages/MessagesViewModelFactory;ZLio/getstream/chat/android/models/ReactionSorting;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;ZZLio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;III)V
public static final fun MessagesScreen (Lio/getstream/chat/android/compose/viewmodel/messages/MessagesViewModelFactory;ZLio/getstream/chat/android/models/ReactionSorting;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ZZLio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;III)V
public static final fun PollDialogs (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Landroidx/compose/runtime/Composer;I)V
}

Expand Down Expand Up @@ -1880,17 +1880,17 @@ public final class io/getstream/chat/android/compose/ui/messages/list/Composable
}

public final class io/getstream/chat/android/compose/ui/messages/list/MessageContainerKt {
public static final fun MessageContainer (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListItemState;Lio/getstream/chat/android/models/ReactionSorting;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;IIII)V
public static final fun MessageContainer (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListItemState;Lio/getstream/chat/android/models/ReactionSorting;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;IIII)V
}

public final class io/getstream/chat/android/compose/ui/messages/list/MessageItemKt {
public static final field HighlightFadeOutDurationMillis I
public static final fun MessageItem (Lio/getstream/chat/android/ui/common/state/messages/list/MessageItemState;Lio/getstream/chat/android/models/ReactionSorting;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;IIII)V
public static final fun MessageItem (Lio/getstream/chat/android/ui/common/state/messages/list/MessageItemState;Lio/getstream/chat/android/models/ReactionSorting;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;IIII)V
}

public final class io/getstream/chat/android/compose/ui/messages/list/MessageListKt {
public static final fun MessageList (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Lio/getstream/chat/android/models/ReactionSorting;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Lio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;IIII)V
public static final fun MessageList (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lio/getstream/chat/android/models/ReactionSorting;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;IIIII)V
public static final fun MessageList (Lio/getstream/chat/android/compose/viewmodel/messages/MessageListViewModel;Lio/getstream/chat/android/models/ReactionSorting;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Lio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;IIIII)V
public static final fun MessageList (Lio/getstream/chat/android/ui/common/state/messages/list/MessageListState;Lio/getstream/chat/android/compose/ui/messages/list/ThreadMessagesStart;Lio/getstream/chat/android/models/ReactionSorting;Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/PaddingValues;Lio/getstream/chat/android/compose/ui/messages/list/MessagesLazyListState;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;IIIIII)V
}

public final class io/getstream/chat/android/compose/ui/messages/list/MessagesKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public fun InputField(
textColor = theme.textStyle.color,
textFontStyle = typography.body.fontStyle,
linkColor = colors.primaryAccent,
mentionsColor = colors.primaryAccent,
)
TransformedText(styledText, OffsetMapping.Identity)
},
Expand Down
Loading
Loading