Skip to content

Commit

Permalink
fix: disable conversation mute icon + UI fixes [WPB-3897][WPB-3658] (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gongracr authored Oct 17, 2023
1 parent 5794fe0 commit 15e4e80
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 63 deletions.
6 changes: 3 additions & 3 deletions app/src/main/kotlin/com/wire/android/ui/common/StatusBox.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ import com.wire.android.util.ui.PreviewMultipleThemes
fun StatusBox(
statusText: String,
modifier: Modifier = Modifier,
textColor: Color = MaterialTheme.wireColorScheme.labelText,
badgeColor: Color = MaterialTheme.wireColorScheme.surface,
textColor: Color = MaterialTheme.wireColorScheme.secondaryText,
badgeColor: Color = MaterialTheme.wireColorScheme.surfaceVariant,
withBorder: Boolean = true,
) {
Box(
Expand All @@ -61,7 +61,7 @@ fun StatusBox(
BorderStroke(
width = 1.dp,
color = if (withBorder) {
MaterialTheme.wireColorScheme.divider
MaterialTheme.wireColorScheme.outline
} else {
badgeColor
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ private fun QuotedMessageContent(
)
.border(
width = 1.dp,
color = MaterialTheme.wireColorScheme.divider,
color = MaterialTheme.wireColorScheme.outline,
shape = quoteOutlineShape
)
.padding(dimensions().spacing4x)
Expand Down Expand Up @@ -254,7 +254,7 @@ private fun QuotedMessageTopRow(
)
}
senderName?.let {
Text(text = senderName, style = typography().label02, color = colorsScheme().secondaryText)
Text(text = senderName, style = typography().label02, color = colorsScheme().onSurfaceVariant)
}
}
}
Expand Down Expand Up @@ -381,7 +381,7 @@ private fun QuotedImage(
)
.border(
width = 1.dp,
color = MaterialTheme.wireColorScheme.divider,
color = MaterialTheme.wireColorScheme.outline,
shape = quoteOutlineShape
)
.padding(dimensions().spacing4x)
Expand Down Expand Up @@ -434,7 +434,7 @@ private fun AutosizeContainer(
}.clip(RoundedCornerShape(dimensions().spacing8x))
.border(
width = 1.dp,
color = MaterialTheme.wireColorScheme.secondaryButtonDisabledOutline,
color = MaterialTheme.wireColorScheme.outline,
shape = RoundedCornerShape(dimensions().spacing8x)
),
alignment = Alignment.Center,
Expand Down Expand Up @@ -482,7 +482,7 @@ private fun MainContentText(text: String, fontStyle: FontStyle = FontStyle.Norma
style = typography().subline01,
maxLines = TEXT_QUOTE_MAX_LINES,
overflow = TextOverflow.Ellipsis,
color = colorsScheme().secondaryText,
color = colorsScheme().onSurfaceVariant,
fontStyle = fontStyle
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal fun MessageAsset(
modifier = Modifier
.padding(top = dimensions().spacing4x)
.background(
color = MaterialTheme.wireColorScheme.onPrimary,
color = MaterialTheme.wireColorScheme.surfaceVariant,
shape = RoundedCornerShape(dimensions().messageAssetBorderRadius)
)
.border(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ fun ConversationRouterHomeBridge(
isFromArchive = conversationsSource.isArchive(),
hasNoConversations = hasNoConversations,
onEditConversation = onEditConversationItem,
onOpenConversationNotificationsSettings = onEditNotifications,
onOpenConversation = onOpenConversation,
onOpenUserProfile = onOpenUserProfile,
onJoinedCall = onJoinedCall,
Expand Down Expand Up @@ -251,7 +250,6 @@ fun ConversationRouterHomeBridge(
onOpenConversation = onOpenConversation,
onEditConversation = onEditConversationItem,
onOpenUserProfile = onOpenUserProfile,
onOpenConversationNotificationsSettings = onEditNotifications,
onJoinCall = { viewModel.joinOngoingCall(it, onJoinedCall) },
onPermanentPermissionDecline = viewModel::showCallingPermissionDialog
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ fun AllConversationScreenContent(
isFromArchive: Boolean = false,
viewModel: ConversationListViewModel = hiltViewModel(),
onEditConversation: (ConversationItem) -> Unit,
onOpenConversationNotificationsSettings: (ConversationItem) -> Unit,
onOpenConversation: (ConversationId) -> Unit,
onOpenUserProfile: (UserId) -> Unit,
onJoinedCall: (ConversationId) -> Unit,
Expand Down Expand Up @@ -114,7 +113,6 @@ fun AllConversationScreenContent(
onOpenConversation = onOpenConversation,
onEditConversation = onEditConversation,
onOpenUserProfile = onOpenUserProfile,
onOpenConversationNotificationsSettings = onOpenConversationNotificationsSettings,
onJoinCall = {
callConversationIdToJoin.value = it
viewModel.joinOngoingCall(it, onJoinedCall)
Expand Down Expand Up @@ -168,7 +166,6 @@ fun PreviewAllConversationScreen() {
conversations = persistentMapOf(),
hasNoConversations = false,
onEditConversation = {},
onOpenConversationNotificationsSettings = {},
onOpenConversation = {},
onOpenUserProfile = {},
onJoinedCall = {},
Expand All @@ -183,7 +180,6 @@ fun ConversationListEmptyStateScreenPreview() {
conversations = persistentMapOf(),
hasNoConversations = true,
onEditConversation = {},
onOpenConversationNotificationsSettings = {},
onOpenConversation = {},
onOpenUserProfile = {},
onJoinedCall = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ fun CallContent(
openConversation = onCallItemClick,
openMenu = onEditConversationItem,
openUserProfile = onOpenUserProfile,
openNotificationsOptions = openConversationNotificationsSettings,
joinCall = { },
onPermanentPermissionDecline = {},
searchQuery = ""
Expand All @@ -119,7 +118,6 @@ fun CallContent(
openConversation = onCallItemClick,
openMenu = onEditConversationItem,
openUserProfile = onOpenUserProfile,
openNotificationsOptions = openConversationNotificationsSettings,
joinCall = { },
onPermanentPermissionDecline = {},
searchQuery = " "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ fun ConversationItemFactory(
openConversation: (ConversationId) -> Unit,
openMenu: (ConversationItem) -> Unit,
openUserProfile: (UserId) -> Unit,
openNotificationsOptions: (ConversationItem) -> Unit,
joinCall: (ConversationId) -> Unit,
onPermanentPermissionDecline: () -> Unit
) {
Expand Down Expand Up @@ -104,9 +103,6 @@ fun ConversationItemFactory(
}
},
onConversationItemClick = onConversationItemClick,
onMutedIconClick = {
openNotificationsOptions(conversation)
},
onJoinCallClick = {
joinCall(conversation.conversationId)
},
Expand All @@ -123,7 +119,6 @@ private fun GeneralConversationItem(
isSelectable: Boolean,
subTitle: @Composable () -> Unit = {},
onConversationItemClick: Clickable,
onMutedIconClick: () -> Unit,
onJoinCallClick: () -> Unit,
onPermanentPermissionDecline: () -> Unit
) {
Expand Down Expand Up @@ -163,7 +158,7 @@ private fun GeneralConversationItem(
horizontalArrangement = Arrangement.spacedBy(dimensions().spacing8x)
) {
if (mutedStatus != MutedConversationStatus.AllAllowed) {
MutedConversationBadge(onMutedIconClick)
MutedConversationBadge()
}
EventBadgeFactory(eventType = conversation.badgeEventType)
}
Expand Down Expand Up @@ -202,7 +197,7 @@ private fun GeneralConversationItem(
horizontalArrangement = Arrangement.spacedBy(dimensions().spacing8x)
) {
if (mutedStatus != MutedConversationStatus.AllAllowed) {
MutedConversationBadge(onMutedIconClick)
MutedConversationBadge()
}
EventBadgeFactory(eventType = conversation.badgeEventType)
}
Expand Down Expand Up @@ -255,7 +250,7 @@ fun PreviewGroupConversationItemWithUnreadCount() {
searchQuery = "",
isSelectableItem = false,
isChecked = false,
{}, {}, {}, {}, {}, {}, {}
{}, {}, {}, {}, {}, {},
)
}

Expand All @@ -278,7 +273,7 @@ fun PreviewGroupConversationItemWithNoBadges() {
searchQuery = "",
isSelectableItem = false,
isChecked = false,
{}, {}, {}, {}, {}, {}, {}
{}, {}, {}, {}, {}, {},
)
}

Expand All @@ -301,7 +296,7 @@ fun PreviewGroupConversationItemWithMutedBadgeAndUnreadMentionBadge() {
searchQuery = "",
isSelectableItem = false,
isChecked = false,
{}, {}, {}, {}, {}, {}, {}
{}, {}, {}, {}, {}, {},
)
}

Expand All @@ -325,7 +320,7 @@ fun PreviewGroupConversationItemWithOngoingCall() {
searchQuery = "",
isSelectableItem = false,
isChecked = false,
{}, {}, {}, {}, {}, {}, {}
{}, {}, {}, {}, {}, {},
)
}

Expand All @@ -344,7 +339,7 @@ fun PreviewConnectionConversationItemWithReceivedConnectionRequestBadge() {
searchQuery = "",
isSelectableItem = false,
isChecked = false,
{}, {}, {}, {}, {}, {}, {}
{}, {}, {}, {}, {}, {}
)
}

Expand All @@ -363,7 +358,7 @@ fun PreviewConnectionConversationItemWithSentConnectRequestBadge() {
searchQuery = "",
isSelectableItem = false,
isChecked = false,
{}, {}, {}, {}, {}, {}, {}
{}, {}, {}, {}, {}, {}
)
}

Expand All @@ -386,6 +381,6 @@ fun PreviewPrivateConversationItemWithBlockedBadge() {
searchQuery = "",
isSelectableItem = false,
isChecked = false,
{}, {}, {}, {}, {}, {}, {}
{}, {}, {}, {}, {}, {}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fun ConversationList(
onOpenConversation: (ConversationId) -> Unit,
onEditConversation: (ConversationItem) -> Unit,
onOpenUserProfile: (UserId) -> Unit,
onOpenConversationNotificationsSettings: (ConversationItem) -> Unit,
onJoinCall: (ConversationId) -> Unit,
onPermanentPermissionDecline: () -> Unit
) {
Expand Down Expand Up @@ -93,7 +92,6 @@ fun ConversationList(
openConversation = onOpenConversation,
openMenu = onEditConversation,
openUserProfile = onOpenUserProfile,
openNotificationsOptions = onOpenConversationNotificationsSettings,
joinCall = onJoinCall,
onPermanentPermissionDecline = onPermanentPermissionDecline
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,57 @@

package com.wire.android.ui.home.conversationslist.common

import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp
import com.wire.android.R
import com.wire.android.ui.common.button.WireSecondaryButton
import com.wire.android.ui.common.colorsScheme
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.theme.wireColorScheme
import com.wire.android.util.ui.PreviewMultipleThemes

@Composable
fun MutedConversationBadge(onClick: () -> Unit) {
Box(modifier = Modifier
.width(dimensions().spacing24x)
.height(dimensions().spacing20x)) {
WireSecondaryButton(
onClick = onClick,
leadingIcon = {
Icon(
painter = painterResource(id = R.drawable.ic_mute),
contentDescription = stringResource(R.string.content_description_muted_conversation),
modifier = Modifier.size(dimensions().spacing12x),
tint = colorsScheme().onSecondaryButtonEnabled
)
},
fillMaxWidth = false,
minSize = DpSize(width = dimensions().spacing24x, height = dimensions().spacing20x),
minClickableSize = DpSize(width = dimensions().spacing24x, height = dimensions().spacing20x),
shape = RoundedCornerShape(size = dimensions().spacing6x),
contentPadding = PaddingValues(dimensions().spacing0x),
fun MutedConversationBadge() {
Box(
modifier = Modifier
.width(dimensions().spacing24x)
.height(dimensions().spacing20x)
.padding(PaddingValues(dimensions().spacing0x))
.clip(shape = RoundedCornerShape(size = dimensions().spacing6x))
.clickable(enabled = false, onClick = {})
.border(
width = 1.dp,
color = MaterialTheme.wireColorScheme.secondaryButtonDisabledOutline,
shape = RoundedCornerShape(dimensions().spacing6x)
),
contentAlignment = Alignment.Center
) {
Icon(
painter = painterResource(id = R.drawable.ic_mute),
contentDescription = stringResource(R.string.content_description_muted_conversation),
modifier = Modifier.size(dimensions().spacing12x),
tint = colorsScheme().onSecondaryButtonEnabled
)
}
}

@Preview
@PreviewMultipleThemes
@Composable
fun PreviewMutedConversationBadge() {
MutedConversationBadge {}
MutedConversationBadge()
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ private fun MentionContent(
openConversation = onMentionItemClick,
openMenu = onEditConversationItem,
openUserProfile = onOpenUserProfile,
openNotificationsOptions = openConversationNotificationsSettings,
joinCall = {},
onPermanentPermissionDecline = {},
searchQuery = ""
Expand All @@ -119,7 +118,6 @@ private fun MentionContent(
openConversation = onMentionItemClick,
openMenu = onEditConversationItem,
openUserProfile = onOpenUserProfile,
openNotificationsOptions = openConversationNotificationsSettings,
joinCall = {},
onPermanentPermissionDecline = {},
searchQuery = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ fun SearchConversationScreen(
onOpenConversation: (ConversationId) -> Unit,
onEditConversation: (ConversationItem) -> Unit,
onOpenUserProfile: (UserId) -> Unit,
onOpenConversationNotificationsSettings: (ConversationItem) -> Unit,
onJoinCall: (ConversationId) -> Unit,
onPermanentPermissionDecline: () -> Unit
) {
Expand All @@ -70,7 +69,6 @@ fun SearchConversationScreen(
onOpenConversation = onOpenConversation,
onEditConversation = onEditConversation,
onOpenUserProfile = onOpenUserProfile,
onOpenConversationNotificationsSettings = onOpenConversationNotificationsSettings,
onJoinCall = onJoinCall,
onPermanentPermissionDecline = onPermanentPermissionDecline
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ private fun ImportMediaContent(
onOpenConversation = onConversationClicked,
onEditConversation = {},
onOpenUserProfile = {},
onOpenConversationNotificationsSettings = {},
onJoinCall = {},
onPermanentPermissionDecline = {}
)
Expand Down
2 changes: 1 addition & 1 deletion kalium
Submodule kalium updated 24 files
+100 βˆ’13 .github/workflows/cherry-pick-rc-to-develop.yml
+1 βˆ’1 .github/workflows/label-pr.yml
+1 βˆ’1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/asset/Asset.kt
+4 βˆ’4 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/connection/ConnectionMapper.kt
+15 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageRepository.kt
+0 βˆ’222 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/publicuser/PublicUserMapper.kt
+4 βˆ’14 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/publicuser/SearchUserRepository.kt
+116 βˆ’113 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/user/UserMapper.kt
+19 βˆ’33 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/user/UserRepository.kt
+1 βˆ’6 logic/src/commonMain/kotlin/com/wire/kalium/logic/di/MapperProvider.kt
+51 βˆ’0 ...rc/commonMain/kotlin/com/wire/kalium/logic/feature/message/GetConversationMessagesFromSearchQueryUseCase.kt
+5 βˆ’0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt
+4 βˆ’3 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UploadUserAvatarUseCase.kt
+1 βˆ’3 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/connection/ConnectionMapperTest.kt
+71 βˆ’2 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/MessageRepositoryTest.kt
+9 βˆ’14 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/publicuser/SearchUserRepositoryTest.kt
+136 βˆ’0 ...ommonTest/kotlin/com/wire/kalium/logic/feature/message/GetConversationMessagesFromSearchQueryUseCaseTest.kt
+3 βˆ’3 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/UploadUserAvatarUseCaseTest.kt
+7 βˆ’0 persistence/src/commonMain/db_user/com/wire/kalium/persistence/Messages.sq
+7 βˆ’7 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/UserDAO.kt
+5 βˆ’0 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageDAO.kt
+11 βˆ’0 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageDAOImpl.kt
+1 βˆ’9 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/dao/UserDAOTest.kt
+66 βˆ’4 persistence/src/commonTest/kotlin/com/wire/kalium/persistence/dao/message/MessageDAOTest.kt

0 comments on commit 15e4e80

Please sign in to comment.