-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: epic typing indicator sender (WPB-4590) #2315
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c9fe84d
chore: clear indicators and send wip
yamilmedina 4d1e7ee
chore: clear indicators and send wip
yamilmedina c36d07d
chore: fix displaying issues and setup for sending events
yamilmedina b60fe90
chore: wip
yamilmedina 3275d17
Merge branch 'develop' into feat/epic-typing-indicator-sender
yamilmedina a8fbb3a
chore: kalium ref
yamilmedina 687eff9
fix: wire send stop on sending message
yamilmedina 02dc76b
fix: wire send stop on sending message
yamilmedina 66b70d9
fix: wire send stop on sending message
yamilmedina abc2d70
fix: animation improv
yamilmedina 3cc9eab
feat: add missing usecase and move di to proper module
yamilmedina 567334b
fix: detekt
yamilmedina eb282f6
fix: tests
yamilmedina 8e60132
fix: tests
yamilmedina 42b7bce
fix: tests
yamilmedina 33acf3f
fix: tests
yamilmedina e0279f3
Merge branch 'develop' into feat/epic-typing-indicator-sender
yamilmedina 503cccf
feat: clear orphaned events on navigation
yamilmedina 133b25e
feat: clear orphaned events on navigation
yamilmedina 375ca3a
feat: adjustments
yamilmedina 5e741d2
feat: adjustments pr
yamilmedina File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
*/ | ||
package com.wire.android.ui.home.conversations | ||
|
||
import androidx.compose.animation.core.FastOutLinearInEasing | ||
import androidx.compose.animation.core.FastOutSlowInEasing | ||
import androidx.compose.animation.core.InfiniteTransition | ||
import androidx.compose.animation.core.RepeatMode | ||
|
@@ -25,6 +26,7 @@ import androidx.compose.animation.core.infiniteRepeatable | |
import androidx.compose.animation.core.rememberInfiniteTransition | ||
import androidx.compose.animation.core.tween | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxHeight | ||
|
@@ -44,6 +46,7 @@ import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.alpha | ||
import androidx.compose.ui.res.pluralStringResource | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextOverflow | ||
|
@@ -113,20 +116,15 @@ fun UsersTypingIndicator(usersTyping: List<UIParticipant>) { | |
@Suppress("MagicNumber") | ||
@Composable | ||
private fun UsersTypingAvatarPreviews(usersTyping: List<UIParticipant>, maxPreviewsDisplay: Int = MAX_PREVIEWS_DISPLAY) { | ||
usersTyping.take(maxPreviewsDisplay).forEachIndexed { index, user -> | ||
val isSingleUser = usersTyping.size == 1 || maxPreviewsDisplay == 1 | ||
UserProfileAvatar( | ||
avatarData = user.avatarData, | ||
size = dimensions().spacing16x, | ||
padding = dimensions().spacing2x, | ||
showStatusIndicator = false, | ||
modifier = if (isSingleUser) Modifier | ||
else { | ||
Modifier.offset( | ||
x = if (index == 0) dimensions().spacing8x else -(dimensions().spacing6x) | ||
) | ||
} | ||
) | ||
Row(horizontalArrangement = Arrangement.spacedBy((-14).dp)) { | ||
usersTyping.take(maxPreviewsDisplay).forEach { user -> | ||
UserProfileAvatar( | ||
avatarData = user.avatarData, | ||
size = dimensions().spacing16x, | ||
padding = dimensions().spacing2x, | ||
showStatusIndicator = false, | ||
) | ||
} | ||
} | ||
} | ||
|
||
|
@@ -137,20 +135,31 @@ private fun HorizontalBouncingWritingPen( | |
) { | ||
Row(modifier = Modifier.fillMaxHeight()) { | ||
val position by infiniteTransition.animateFloat( | ||
initialValue = -5f, targetValue = -1f, | ||
initialValue = -10f, targetValue = -2f, | ||
animationSpec = infiniteRepeatable( | ||
animation = tween(1_000, easing = FastOutSlowInEasing), | ||
animation = tween(1_500, easing = FastOutSlowInEasing), | ||
repeatMode = RepeatMode.Reverse | ||
), | ||
label = infiniteTransition.label | ||
) | ||
|
||
val iconAlpha: Float by infiniteTransition.animateFloat( | ||
initialValue = 0.1f, | ||
targetValue = 1f, | ||
animationSpec = infiniteRepeatable( | ||
animation = tween(durationMillis = 1_500, easing = FastOutLinearInEasing), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same than above |
||
repeatMode = RepeatMode.Reverse, | ||
), | ||
label = infiniteTransition.label | ||
) | ||
|
||
Icon( | ||
imageVector = Icons.Default.MoreHoriz, | ||
contentDescription = null, | ||
tint = colorsScheme().secondaryText, | ||
modifier = Modifier | ||
.size(dimensions().spacing12x) | ||
.alpha(iconAlpha) | ||
.offset(y = -dimensions().spacing2x) | ||
.align(Alignment.Bottom) | ||
) | ||
|
@@ -237,6 +246,21 @@ fun PreviewUsersTypingMoreThanOne() { | |
readReceiptDate = null, | ||
botService = null, | ||
isDefederated = false | ||
), | ||
UIParticipant( | ||
id = QualifiedID("alice", "wire.com"), | ||
name = "Patty", | ||
handle = "patty", | ||
isSelf = false, | ||
isService = false, | ||
avatarData = UserAvatarData(), | ||
membership = Membership.None, | ||
connectionState = null, | ||
unavailable = false, | ||
isDeleted = false, | ||
readReceiptDate = null, | ||
botService = null, | ||
isDefederated = false | ||
) | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to extract these values to some
Dimens
variable for easier concurrent modification?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I'll take a look on how we are doing for some animations,
I tried to look for dimensions that fit, but didn't find anything so far