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

feat: show connecting indicator if user has bad/lost connection during a call (WPB-1125) #2101

Merged
merged 10 commits into from
Aug 25, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.ContentAlpha
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -92,9 +93,9 @@ fun ParticipantTile(
onSelfUserVideoPreviewCreated: (view: View) -> Unit,
onClearSelfUserVideoPreview: () -> Unit
) {
val alpha = if (participantTitleState.hasEstablishedAudio) 1f else 0.6f
val alpha = if (participantTitleState.hasEstablishedAudio) ContentAlpha.high else ContentAlpha.medium
Surface(
modifier = modifier.alpha(alpha),
modifier = modifier,
color = colorsScheme().callingParticipantTileBackgroundColor,
shape = RoundedCornerShape(dimensions().corner6x),
) {
Expand All @@ -109,6 +110,7 @@ fun ParticipantTile(
AvatarTile(
modifier = Modifier
.fillMaxSize()
.alpha(alpha)
.constrainAs(avatar) { },
avatar = UserAvatarData(participantTitleState.avatar),
avatarSize = avatarSize
Expand Down Expand Up @@ -286,6 +288,7 @@ private fun UsernameTile(
hasEstablishedAudio: Boolean
) {
val color = if (isSpeaking) MaterialTheme.wireColorScheme.primary else Color.Black
val nameLabelColor = if (hasEstablishedAudio) Color.White else colorsScheme().secondaryText
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: maybe we should move all these hard-coded to the theme colors as well, they would just be the same for both light and dark mode, but it would ensure we have all colors in one place so if we decide to change one of them we wouldn't need to look for them in the whole project

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, not that simple by just changing the color in the file.. we need to check the whole project in all cases I would say especially for white and black


ConstraintLayout(modifier = modifier) {
val (nameLabel, connectingLabel) = createRefs()
Expand All @@ -305,7 +308,7 @@ private fun UsernameTile(
color = color
) {
Text(
color = Color.White,
color = nameLabelColor,
style = MaterialTheme.wireTypography.label01,
modifier = Modifier.padding(dimensions().spacing4x),
text = name,
Expand Down
Loading