From c2a2d9ae9f4dee7b1eece27962ec5b1788a5a73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Saleniuk?= <30429749+saleniuk@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:34:42 +0100 Subject: [PATCH] fix: resolve custom colors [WPB-11475] (#3656) --- app/build.gradle.kts | 4 + .../com/wire/android/ui/WireTestTheme.kt | 4 + .../ui/authentication/devices/DeviceItem.kt | 4 +- .../devices/remove/RemoveDeviceTopBar.kt | 2 +- .../login/email/LoginEmailScreen.kt | 2 +- .../authentication/login/email/ProxyScreen.kt | 2 +- .../controlbuttons/WireCallControlButton.kt | 16 +- .../participantsview/FloatingSelfUserTile.kt | 2 +- .../participantsview/ParticipantTile.kt | 19 +- .../participantsview/VerticalCallingPager.kt | 11 +- .../VerticalPagerIndicator.kt | 28 +- .../gridview/CallingGridView.kt | 9 +- .../wire/android/ui/common/BlockedLabel.kt | 2 +- .../ui/common/SettingUpWireScreenContent.kt | 2 +- .../android/ui/common/WireLabelledCheckbox.kt | 28 ++ .../wire/android/ui/common/WireRadioButton.kt | 16 + .../com/wire/android/ui/common/WireSwitch.kt | 43 +- .../banner/SecurityClassificationBanner.kt | 12 +- .../bottomsheet/RichMenuBottomSheetItem.kt | 2 +- .../common/textfield/WireTextFieldDefaults.kt | 2 +- .../wire/android/ui/edit/ReactionOption.kt | 2 +- .../home/conversations/ConversationScreen.kt | 6 +- .../details/GroupConversationDetailsScreen.kt | 14 +- .../PasswordProtectedLinkBanner.kt | 15 +- .../GeneratePasswordButton.kt | 2 +- .../options/GroupConversationOptions.kt | 4 +- .../GroupConversationParticipants.kt | 40 +- .../media/ConversationMediaScreen.kt | 2 +- .../conversations/media/ImageAssetsContent.kt | 2 +- .../media/preview/AssetTilePreview.kt | 2 +- .../conversations/messages/ReactionPill.kt | 2 +- .../messages/item/MessageContainerItem.kt | 2 +- .../messages/item/MessageItemComponents.kt | 4 +- .../messagetypes/asset/AssetMessageTypes.kt | 2 +- .../conversationslist/common/EventBadge.kt | 14 +- .../conversationslist/common/FolderHeader.kt | 6 +- .../filter/ConversationFilterSheetContent.kt | 2 +- .../home/messagecomposer/AdditionalOptions.kt | 2 +- .../messagecomposer/EnabledMessageComposer.kt | 8 +- .../home/messagecomposer/MessageComposer.kt | 6 +- .../recordaudio/RecordAudioButtons.kt | 43 +- .../MessageCompositionInputStateHolder.kt | 4 +- .../dialog/create/CreateBackupDialogs.kt | 20 +- .../dialog/restore/RestoreBackupDialogs.kt | 17 +- .../settings/privacy/PrivacySettingsScreen.kt | 6 +- .../EndToEndIdentityCertificateItem.kt | 7 +- .../ui/userprofile/common/UserProfileInfo.kt | 5 +- .../other/OtherUserConnectionStatusInfo.kt | 2 +- .../other/OtherUserProfileDetails.kt | 11 +- .../other/OtherUserProfileGroup.kt | 11 +- .../ui/userprofile/self/CreateTeamInfoCard.kt | 8 +- .../teammigration/TeamMigrationScreen.kt | 5 +- .../step1/TeamMigrationTeamPlanStepScreen.kt | 5 +- .../com/wire/android/ui/common/ThemeExt.kt | 12 + .../common/bottomsheet/MenuBottomSheetItem.kt | 2 +- .../bottomsheet/ModalSheetHeaderItem.kt | 2 +- .../ui/common/button/WireCheckBoxDefaults.kt | 14 +- .../progress/WireLinearProgressIndicator.kt | 31 +- .../kotlin/com/wire/android/ui/theme/Theme.kt | 15 + .../wire/android/ui/theme/WireColorPalette.kt | 3 - .../wire/android/ui/theme/WireColorScheme.kt | 370 +++++------------- .../android/ui/theme/WireFixedColorScheme.kt | 49 +++ .../feature/sketch/DrawingToolPicker.kt | 3 +- 63 files changed, 482 insertions(+), 510 deletions(-) create mode 100644 core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireFixedColorScheme.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 523e3f0ebcc..52065cb0462 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -123,6 +123,10 @@ android { getByName("androidTest") { java.srcDirs("src/androidTest/kotlin") } + create("screenshotTest") { + java.srcDirs("src/screenshotTest/kotlin") + res.srcDirs("src/main/res") + } } } diff --git a/app/src/androidTest/kotlin/com/wire/android/ui/WireTestTheme.kt b/app/src/androidTest/kotlin/com/wire/android/ui/WireTestTheme.kt index 003403eb847..eeb5ca1fb16 100644 --- a/app/src/androidTest/kotlin/com/wire/android/ui/WireTestTheme.kt +++ b/app/src/androidTest/kotlin/com/wire/android/ui/WireTestTheme.kt @@ -22,10 +22,12 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import com.wire.android.ui.common.snackbar.LocalSnackbarHostState +import com.wire.android.ui.theme.DefaultWireFixedColorScheme import com.wire.android.ui.theme.WireColorScheme import com.wire.android.ui.theme.WireColorSchemeTypes import com.wire.android.ui.theme.WireDimensions import com.wire.android.ui.theme.WireDimensionsTypes +import com.wire.android.ui.theme.WireFixedColorScheme import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.WireTypography import com.wire.android.ui.theme.WireTypographyTypes @@ -33,6 +35,7 @@ import com.wire.android.ui.theme.WireTypographyTypes @Composable fun WireTestTheme( wireColorScheme: WireColorScheme = WireColorSchemeTypes.currentTheme, + wireFixedColorScheme: WireFixedColorScheme = DefaultWireFixedColorScheme, wireTypography: WireTypography = WireTypographyTypes.currentScreenSize, wireDimensions: WireDimensions = WireDimensionsTypes.currentScreenSize.currentOrientation, content: @Composable () -> Unit @@ -41,6 +44,7 @@ fun WireTestTheme( CompositionLocalProvider(LocalSnackbarHostState provides snackbarHostState) { WireTheme( wireColorScheme, + wireFixedColorScheme, wireTypography, wireDimensions, content diff --git a/app/src/main/kotlin/com/wire/android/ui/authentication/devices/DeviceItem.kt b/app/src/main/kotlin/com/wire/android/ui/authentication/devices/DeviceItem.kt index b0a7d95a2b4..2a4f0de0186 100644 --- a/app/src/main/kotlin/com/wire/android/ui/authentication/devices/DeviceItem.kt +++ b/app/src/main/kotlin/com/wire/android/ui/authentication/devices/DeviceItem.kt @@ -247,7 +247,7 @@ private fun MLSDetails( device.mlsClientIdentity?.let { identity -> Text( style = MaterialTheme.wireTypography.subline01, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, maxLines = 1, overflow = TextOverflow.Ellipsis, text = stringResource( @@ -289,7 +289,7 @@ private fun ProteusDetails( } Text( style = MaterialTheme.wireTypography.subline01, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, text = proteusDetails, minLines = 2, modifier = Modifier diff --git a/app/src/main/kotlin/com/wire/android/ui/authentication/devices/remove/RemoveDeviceTopBar.kt b/app/src/main/kotlin/com/wire/android/ui/authentication/devices/remove/RemoveDeviceTopBar.kt index 315fa95ba77..261216cf5cf 100644 --- a/app/src/main/kotlin/com/wire/android/ui/authentication/devices/remove/RemoveDeviceTopBar.kt +++ b/app/src/main/kotlin/com/wire/android/ui/authentication/devices/remove/RemoveDeviceTopBar.kt @@ -55,7 +55,7 @@ fun RemoveDeviceTopBar(elevation: Dp, onBackButtonClicked: () -> Unit, modifier: Text( text = stringResource(id = R.string.remove_device_label), style = MaterialTheme.wireTypography.title03, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, modifier = Modifier.padding( horizontal = MaterialTheme.wireDimensions.removeDeviceHorizontalPadding, vertical = MaterialTheme.wireDimensions.removeDeviceLabelVerticalPadding diff --git a/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/LoginEmailScreen.kt b/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/LoginEmailScreen.kt index f15601748b7..76daa1ce17b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/LoginEmailScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/LoginEmailScreen.kt @@ -150,7 +150,7 @@ private fun LoginEmailContent( Text( text = stringResource(R.string.label_wire_credentials), style = MaterialTheme.wireTypography.title03.copy( - color = colorsScheme().labelText + color = colorsScheme().secondaryText ), modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/ProxyScreen.kt b/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/ProxyScreen.kt index 87d628b16bd..d8f3cad1b89 100644 --- a/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/ProxyScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/authentication/login/email/ProxyScreen.kt @@ -63,7 +63,7 @@ fun ProxyScreen( Text( text = stringResource(R.string.label_proxy_credentials), style = MaterialTheme.wireTypography.title03.copy( - color = colorsScheme().labelText + color = colorsScheme().secondaryText ), modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/WireCallControlButton.kt b/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/WireCallControlButton.kt index aa97dd9a813..3f438a43087 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/WireCallControlButton.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/WireCallControlButton.kt @@ -48,14 +48,14 @@ fun WireCallControlButton( shape = CircleShape, colors = with(colorsScheme()) { wireSecondaryButtonColors().copy( - selected = callingControlButtonActive, - selectedOutline = callingControlButtonActiveOutline, - onSelected = onCallingControlButtonActive, - selectedRipple = onCallingControlButtonActive, - enabled = callingControlButtonInactive, - enabledOutline = callingControlButtonInactiveOutline, - onEnabled = onCallingControlButtonInactive, - enabledRipple = onCallingControlButtonInactive, + selected = inverseSurface, + selectedOutline = inverseSurface, + onSelected = inverseOnSurface, + selectedRipple = inverseOnSurface, + enabled = secondaryButtonEnabled, + enabledOutline = secondaryButtonEnabledOutline, + onEnabled = onSecondaryButtonEnabled, + enabledRipple = secondaryButtonRipple, ) }, contentDescription = contentDescription, diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/FloatingSelfUserTile.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/FloatingSelfUserTile.kt index bdeff579d17..32dea7ebfb5 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/FloatingSelfUserTile.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/FloatingSelfUserTile.kt @@ -118,7 +118,7 @@ fun FloatingSelfUserTile( } Card( - border = BorderStroke(1.dp, colorsScheme().uncheckedColor), + border = BorderStroke(1.dp, colorsScheme().onSecondaryButtonDisabled), shape = RoundedCornerShape(dimensions().corner6x), modifier = modifier .height(selfVideoTileHeight) diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt index d93fb20fd0b..34dfecc6af2 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/ParticipantTile.kt @@ -77,10 +77,10 @@ import com.wire.android.ui.calling.model.UICallParticipant import com.wire.android.ui.common.avatar.UserProfileAvatar import com.wire.android.ui.common.avatar.UserProfileAvatarType import com.wire.android.ui.common.colorsScheme +import com.wire.android.ui.common.darkColorsScheme import com.wire.android.ui.common.dimensions import com.wire.android.ui.home.conversationslist.model.Membership import com.wire.android.ui.theme.WireTheme -import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireTypography import com.wire.android.util.ui.PreviewMultipleThemes import com.wire.kalium.logic.data.id.QualifiedID @@ -104,7 +104,7 @@ fun ParticipantTile( Surface( modifier = modifier .thenIf(participantTitleState.isSpeaking, activeSpeakerBorderModifier), - color = colorsScheme().callingParticipantTileBackgroundColor, + color = darkColorsScheme().surfaceContainer, shape = RoundedCornerShape(if (participantTitleState.isSpeaking) dimensions().corner8x else dimensions().corner3x), ) { ConstraintLayout { @@ -273,7 +273,7 @@ private fun CameraPreview( if (isCameraOn) { isCameraStopped = false val context = LocalContext.current - val backgroundColor = colorsScheme().callingParticipantTileBackgroundColor.value.toInt() + val backgroundColor = darkColorsScheme().surfaceContainer.value.toInt() val videoPreview = remember { CameraPreviewBuilder(context) .setBackgroundColor(backgroundColor) @@ -308,8 +308,7 @@ private fun OthersVideoRenderer( var offsetY by remember { mutableStateOf(0f) } val context = LocalContext.current - val rendererFillColor = - (colorsScheme().callingParticipantTileBackgroundColor.value shr 32).toLong() + val rendererFillColor = (darkColorsScheme().surfaceContainer.value shr 32).toLong() if (isCameraOn || isSharingScreen) { val videoRenderer = remember { @@ -391,12 +390,12 @@ private fun UsernameTile( modifier: Modifier = Modifier, ) { val color = - if (isSpeaking) colorsScheme().primary else colorsScheme().callingParticipantNameBackground + if (isSpeaking) colorsScheme().primary else darkColorsScheme().surfaceContainerLowest val nameLabelColor = when { isSpeaking -> colorsScheme().onPrimary - hasEstablishedAudio -> colorsScheme().callingParticipantNameText - else -> colorsScheme().callingParticipantNameConnectingText + hasEstablishedAudio -> darkColorsScheme().onSurface + else -> darkColorsScheme().secondaryText } Surface( @@ -418,7 +417,7 @@ private fun UsernameTile( ) if (!hasEstablishedAudio) { Text( - color = colorsScheme().callingParticipantError, + color = darkColorsScheme().error, style = MaterialTheme.wireTypography.label01, text = stringResource(id = R.string.participant_tile_call_connecting_label), maxLines = 1, @@ -445,7 +444,7 @@ private fun MicrophoneTile( .padding(dimensions().spacing3x) .size(dimensions().spacing16x), imageVector = ImageVector.vectorResource(id = R.drawable.ic_participant_muted), - tint = MaterialTheme.wireColorScheme.callingParticipantError, + tint = darkColorsScheme().error, contentDescription = stringResource(R.string.content_description_calling_participant_muted) ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalCallingPager.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalCallingPager.kt index 3db3a4b43b4..9aa4550af2c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalCallingPager.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalCallingPager.kt @@ -46,7 +46,6 @@ import com.wire.android.ui.calling.ongoing.buildPreviewParticipantsList import com.wire.android.ui.calling.ongoing.fullscreen.SelectedParticipant import com.wire.android.ui.calling.ongoing.participantsview.gridview.GroupCallGrid import com.wire.android.ui.calling.ongoing.participantsview.horizentalview.CallingHorizontalView -import com.wire.android.ui.common.colorsScheme import com.wire.android.ui.common.dimensions import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireDimensions @@ -120,6 +119,7 @@ fun VerticalCallingPager( onSelfClearVideoPreview = onSelfClearVideoPreview, onDoubleTap = onDoubleTap, currentUserId = currentUserId, + isInPictureInPictureMode = isInPictureInPictureMode, ) } @@ -139,15 +139,10 @@ fun VerticalCallingPager( modifier = Modifier .align(Alignment.CenterEnd) .padding(end = MaterialTheme.wireDimensions.spacing12x), - color = colorsScheme().callingPagerIndicatorBackground, ) { VerticalPagerIndicator( modifier = Modifier.padding(dimensions().spacing4x), pagerState = pagerState, - activeColor = colorsScheme().callingActiveIndicator, - inactiveColor = colorsScheme().callingInActiveIndicator, - inactiveBorderColor = colorsScheme().callingInActiveBorderIndicator, - inactiveBorderWidth = dimensions().spacing2x, indicatorHeight = dimensions().spacing12x, indicatorWidth = dimensions().spacing12x, spacing = dimensions().spacing6x, @@ -183,7 +178,7 @@ private fun PreviewVerticalCallingPager(participants: List) { requestVideoStreams = {}, onDoubleTap = { }, isInPictureInPictureMode = false, - currentUserId = UserId("id", "domain") + currentUserId = participants[0].id, ) } @@ -200,5 +195,5 @@ fun PreviewVerticalCallingPagerHorizontalView() = WireTheme { @PreviewMultipleThemes @Composable fun PreviewVerticalCallingPagerGrid() = WireTheme { - PreviewVerticalCallingPager(participants = buildPreviewParticipantsList(MAX_TILES_PER_PAGE)) + PreviewVerticalCallingPager(participants = buildPreviewParticipantsList(MAX_TILES_PER_PAGE + 1)) } diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalPagerIndicator.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalPagerIndicator.kt index 883b35fbdb2..7f0810374e3 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalPagerIndicator.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/VerticalPagerIndicator.kt @@ -18,7 +18,6 @@ package com.wire.android.ui.calling.ongoing.participantsview -import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement @@ -36,28 +35,28 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.IntOffset -import androidx.compose.ui.unit.dp import com.wire.android.ui.common.colorsScheme import com.wire.android.ui.common.dimensions +import com.wire.android.ui.theme.WireTheme +import com.wire.android.util.ui.PreviewMultipleThemes /** * Updating VerticalPagerIndicator from com.google.accompanist.pager to have the ability to add a border to the pager indicator */ -@OptIn(ExperimentalFoundationApi::class) @Composable fun VerticalPagerIndicator( pagerState: PagerState, modifier: Modifier = Modifier, activeColor: Color = colorsScheme().primary, inactiveColor: Color = colorsScheme().surface, - inactiveBorderColor: Color = colorsScheme().uncheckedColor, - inactiveBorderWidth: Dp = 1.dp, - indicatorHeight: Dp = 8.dp, - indicatorWidth: Dp = indicatorHeight, - spacing: Dp = indicatorHeight, + inactiveBorderColor: Color = colorsScheme().onSecondaryButtonDisabled, + backgroundColor: Color = colorsScheme().surfaceContainerHighest, + inactiveBorderWidth: Dp = dimensions().spacing1x, + indicatorHeight: Dp = dimensions().spacing12x, + indicatorWidth: Dp = dimensions().spacing12x, + spacing: Dp = dimensions().spacing6x, indicatorShape: Shape = CircleShape, ) { @@ -65,8 +64,10 @@ fun VerticalPagerIndicator( val spacingPx = LocalDensity.current.run { spacing.roundToPx() } Box( - modifier = modifier, - contentAlignment = Alignment.TopCenter + modifier = Modifier + .background(backgroundColor) + .then(modifier), + contentAlignment = Alignment.TopCenter, ) { Column( verticalArrangement = Arrangement.spacedBy(spacing), @@ -106,10 +107,9 @@ fun VerticalPagerIndicator( } } -@OptIn(ExperimentalFoundationApi::class) -@Preview +@PreviewMultipleThemes @Composable -fun PreviewVerticalPagerIndicator() { +fun PreviewVerticalPagerIndicator() = WireTheme { VerticalPagerIndicator( modifier = Modifier.padding(dimensions().spacing4x), pagerState = rememberPagerState(pageCount = { 3 }) diff --git a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt index 6b26f6025db..c1208dcf50e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt +++ b/app/src/main/kotlin/com/wire/android/ui/calling/ongoing/participantsview/gridview/CallingGridView.kt @@ -34,7 +34,6 @@ import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.times -import com.wire.android.ui.LocalActivity import com.wire.android.ui.calling.model.UICallParticipant import com.wire.android.ui.calling.ongoing.buildPreviewParticipantsList import com.wire.android.ui.calling.ongoing.fullscreen.SelectedParticipant @@ -58,9 +57,8 @@ fun GroupCallGrid( modifier: Modifier = Modifier, contentPadding: Dp = dimensions().spacing4x, spacedBy: Dp = dimensions().spacing2x, + isInPictureInPictureMode: Boolean, ) { - val activity = LocalActivity.current - // We need the number of tiles rows needed to calculate their height val numberOfTilesRows = remember(participants.size) { tilesRowsCount(participants.size) @@ -104,7 +102,7 @@ fun GroupCallGrid( .height(tileHeight) .animateItem(), participantTitleState = participant, - isOnPiPMode = activity.isInPictureInPictureMode, + isOnPiPMode = isInPictureInPictureMode, isSelfUser = isSelfUser, isSelfUserMuted = isSelfUserMuted, isSelfUserCameraOn = isSelfUserCameraOn, @@ -141,7 +139,8 @@ private fun PreviewGroupCallGrid(participants: List, modifier onSelfVideoPreviewCreated = {}, onSelfClearVideoPreview = {}, onDoubleTap = { }, - currentUserId = UserId("id", "domain") + currentUserId = UserId("id", "domain"), + isInPictureInPictureMode = false, ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/common/BlockedLabel.kt b/app/src/main/kotlin/com/wire/android/ui/common/BlockedLabel.kt index 8eab85cc824..a6377e67f4f 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/BlockedLabel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/BlockedLabel.kt @@ -45,7 +45,7 @@ fun BlockedLabel(modifier: Modifier = Modifier) { ) { Text( text = stringResource(id = R.string.label_user_blocked), - color = colorsScheme().labelText, + color = colorsScheme().secondaryText, style = MaterialTheme.wireTypography.label03.copy(textAlign = TextAlign.Center), maxLines = 1, overflow = TextOverflow.Ellipsis, diff --git a/app/src/main/kotlin/com/wire/android/ui/common/SettingUpWireScreenContent.kt b/app/src/main/kotlin/com/wire/android/ui/common/SettingUpWireScreenContent.kt index fa9f244d1e8..b502c1e4294 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/SettingUpWireScreenContent.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/SettingUpWireScreenContent.kt @@ -93,7 +93,7 @@ fun SettingUpWireScreenContent( ) ) AnimatedVisibility(visible = type is SettingUpWireScreenType.Progress) { - WireCircularProgressIndicator(progressColor = MaterialTheme.wireColorScheme.badge) + WireCircularProgressIndicator(progressColor = MaterialTheme.wireColorScheme.onBackground) } AnimatedVisibility(visible = title?.isNotEmpty() == true) { Text( diff --git a/app/src/main/kotlin/com/wire/android/ui/common/WireLabelledCheckbox.kt b/app/src/main/kotlin/com/wire/android/ui/common/WireLabelledCheckbox.kt index 2bad16190c6..4576a436043 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/WireLabelledCheckbox.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/WireLabelledCheckbox.kt @@ -19,6 +19,7 @@ package com.wire.android.ui.common import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -34,8 +35,10 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.style.TextOverflow import com.wire.android.ui.common.button.wireCheckBoxColors +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.theme.wireTypography +import com.wire.android.util.ui.PreviewMultipleThemes @Composable fun WireLabelledCheckbox( @@ -67,6 +70,7 @@ fun WireLabelledCheckbox( Checkbox( checked = checked, enabled = checkboxEnabled, + colors = wireCheckBoxColors(), onCheckedChange = null // null since we are handling the click on parent ) @@ -86,12 +90,36 @@ fun WireLabelledCheckbox( fun WireCheckbox( checked: Boolean, onCheckedChange: ((Boolean) -> Unit)?, + enabled: Boolean = true, modifier: Modifier = Modifier, ) { Checkbox( checked = checked, + enabled = enabled, onCheckedChange = onCheckedChange, colors = wireCheckBoxColors(), modifier = modifier, ) } + +@PreviewMultipleThemes +@Composable +fun PreviewWireLabelledCheckboxes() = WireTheme { + Column { + WireLabelledCheckbox(label = "checked", checked = true, checkboxEnabled = true, onCheckClicked = {}) + WireLabelledCheckbox(label = "not checked", checked = false, checkboxEnabled = true, onCheckClicked = {}) + WireLabelledCheckbox(label = "checked disabled", checked = true, checkboxEnabled = false, onCheckClicked = {}) + WireLabelledCheckbox(label = "not checked disabled", checked = false, checkboxEnabled = false, onCheckClicked = {}) + } +} + +@PreviewMultipleThemes +@Composable +fun PreviewWireCheckboxes() = WireTheme { + Column { + WireCheckbox(checked = true, enabled = true, onCheckedChange = {}) + WireCheckbox(checked = false, enabled = true, onCheckedChange = {}) + WireCheckbox(checked = true, enabled = false, onCheckedChange = {}) + WireCheckbox(checked = false, enabled = false, onCheckedChange = {}) + } +} diff --git a/app/src/main/kotlin/com/wire/android/ui/common/WireRadioButton.kt b/app/src/main/kotlin/com/wire/android/ui/common/WireRadioButton.kt index f2933780724..6fda2199d04 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/WireRadioButton.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/WireRadioButton.kt @@ -18,21 +18,37 @@ package com.wire.android.ui.common +import androidx.compose.foundation.layout.Column import androidx.compose.material3.RadioButton import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import com.wire.android.ui.common.button.wireRadioButtonColors +import com.wire.android.ui.theme.WireTheme +import com.wire.android.util.ui.PreviewMultipleThemes @Composable fun WireRadioButton( checked: Boolean, onButtonChecked: (() -> Unit), + enabled: Boolean = true, modifier: Modifier = Modifier ) { RadioButton( modifier = modifier, selected = checked, + enabled = enabled, onClick = onButtonChecked, colors = wireRadioButtonColors() ) } + +@PreviewMultipleThemes +@Composable +fun PreviewWireRadioButtons() = WireTheme { + Column { + WireRadioButton(checked = true, enabled = true, onButtonChecked = {}) + WireRadioButton(checked = false, enabled = true, onButtonChecked = {}) + WireRadioButton(checked = true, enabled = false, onButtonChecked = {}) + WireRadioButton(checked = false, enabled = false, onButtonChecked = {}) + } +} diff --git a/app/src/main/kotlin/com/wire/android/ui/common/WireSwitch.kt b/app/src/main/kotlin/com/wire/android/ui/common/WireSwitch.kt index d7aed59b7b9..0a5fedf563a 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/WireSwitch.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/WireSwitch.kt @@ -31,9 +31,10 @@ import androidx.compose.ui.draw.scale import androidx.compose.ui.graphics.Color import androidx.compose.ui.semantics.onClick import androidx.compose.ui.semantics.semantics -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireColorScheme +import com.wire.android.util.ui.PreviewMultipleThemes @Composable fun WireSwitch( @@ -61,22 +62,22 @@ fun WireSwitch( @Composable fun wireSwitchColors( - checkedThumbColor: Color = MaterialTheme.wireColorScheme.switchEnabledThumb, - checkedTrackColor: Color = MaterialTheme.wireColorScheme.switchEnabledChecked, + checkedThumbColor: Color = MaterialTheme.wireColorScheme.surface, + checkedTrackColor: Color = MaterialTheme.wireColorScheme.positive, checkedBorderColor: Color = Color.Transparent, - checkedIconColor: Color = MaterialTheme.wireColorScheme.switchEnabledChecked, - uncheckedThumbColor: Color = MaterialTheme.wireColorScheme.switchEnabledThumb, - uncheckedTrackColor: Color = MaterialTheme.wireColorScheme.switchEnabledUnchecked, + checkedIconColor: Color = MaterialTheme.wireColorScheme.onSurface, + uncheckedThumbColor: Color = MaterialTheme.wireColorScheme.surface, + uncheckedTrackColor: Color = MaterialTheme.wireColorScheme.onPrimaryButtonDisabled, uncheckedBorderColor: Color = Color.Transparent, - uncheckedIconColor: Color = MaterialTheme.wireColorScheme.switchEnabledUnchecked, - disabledCheckedThumbColor: Color = MaterialTheme.wireColorScheme.switchDisabledThumb, - disabledCheckedTrackColor: Color = MaterialTheme.wireColorScheme.switchDisabledChecked, + uncheckedIconColor: Color = MaterialTheme.wireColorScheme.onPrimaryButtonDisabled, + disabledCheckedThumbColor: Color = MaterialTheme.wireColorScheme.onPrimaryButtonDisabled, + disabledCheckedTrackColor: Color = MaterialTheme.wireColorScheme.primaryButtonDisabled, disabledCheckedBorderColor: Color = Color.Transparent, - disabledCheckedIconColor: Color = MaterialTheme.wireColorScheme.switchDisabledChecked, - disabledUncheckedThumbColor: Color = MaterialTheme.wireColorScheme.switchDisabledThumb, - disabledUncheckedTrackColor: Color = MaterialTheme.wireColorScheme.switchDisabledUnchecked, + disabledCheckedIconColor: Color = MaterialTheme.wireColorScheme.primaryButtonDisabled, + disabledUncheckedThumbColor: Color = MaterialTheme.wireColorScheme.onPrimaryButtonDisabled, + disabledUncheckedTrackColor: Color = MaterialTheme.wireColorScheme.primaryButtonDisabled, disabledUncheckedBorderColor: Color = Color.Transparent, - disabledUncheckedIconColor: Color = MaterialTheme.wireColorScheme.switchDisabledUnchecked, + disabledUncheckedIconColor: Color = MaterialTheme.wireColorScheme.primaryButtonDisabled, ): SwitchColors = SwitchDefaults.colors( checkedThumbColor = checkedThumbColor, checkedTrackColor = checkedTrackColor, @@ -96,26 +97,26 @@ fun wireSwitchColors( disabledUncheckedIconColor = disabledUncheckedIconColor ) -@Preview("Wire switch on") +@PreviewMultipleThemes @Composable -fun PreviewWireSwitchOn() { +fun PreviewWireSwitchOn() = WireTheme { WireSwitch(checked = true, onCheckedChange = {}) } -@Preview("Wire switch off") +@PreviewMultipleThemes @Composable -fun PreviewWireSwitchOff() { +fun PreviewWireSwitchOff() = WireTheme { WireSwitch(checked = false, onCheckedChange = {}) } -@Preview("Wire switch disabled on") +@PreviewMultipleThemes @Composable -fun PreviewWireSwitchDisabledOn() { +fun PreviewWireSwitchDisabledOn() = WireTheme { WireSwitch(checked = true, enabled = false, onCheckedChange = {}) } -@Preview("Wire switch disabled off") +@PreviewMultipleThemes @Composable -fun PreviewWireSwitchDisabledOff() { +fun PreviewWireSwitchDisabledOff() = WireTheme { WireSwitch(checked = false, enabled = false, onCheckedChange = {}) } diff --git a/app/src/main/kotlin/com/wire/android/ui/common/banner/SecurityClassificationBanner.kt b/app/src/main/kotlin/com/wire/android/ui/common/banner/SecurityClassificationBanner.kt index b637c5b6678..f479d1214c6 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/banner/SecurityClassificationBanner.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/banner/SecurityClassificationBanner.kt @@ -123,27 +123,27 @@ private fun getTextFor(securityClassificationType: SecurityClassificationType): @Composable private fun getBackgroundColorFor(securityClassificationType: SecurityClassificationType): Color { return if (securityClassificationType == SecurityClassificationType.CLASSIFIED) { - colorsScheme().classifiedBannerBackgroundColor + colorsScheme().positiveVariant } else { - colorsScheme().unclassifiedBannerBackgroundColor + colorsScheme().error } } @Composable private fun getColorTextFor(securityClassificationType: SecurityClassificationType): Color { return if (securityClassificationType == SecurityClassificationType.CLASSIFIED) { - colorsScheme().classifiedBannerForegroundColor + colorsScheme().onPositiveVariant } else { - colorsScheme().unclassifiedBannerForegroundColor + colorsScheme().onError } } @Composable private fun getDividerColorFor(securityClassificationType: SecurityClassificationType): Color { return if (securityClassificationType == SecurityClassificationType.CLASSIFIED) { - colorsScheme().classifiedBannerForegroundColor + colorsScheme().onPositiveVariant } else { - colorsScheme().unclassifiedBannerBackgroundColor + colorsScheme().onError } } diff --git a/app/src/main/kotlin/com/wire/android/ui/common/bottomsheet/RichMenuBottomSheetItem.kt b/app/src/main/kotlin/com/wire/android/ui/common/bottomsheet/RichMenuBottomSheetItem.kt index b1847381564..0c7697fa20b 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/bottomsheet/RichMenuBottomSheetItem.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/bottomsheet/RichMenuBottomSheetItem.kt @@ -128,7 +128,7 @@ fun MenuItemSubLine( ) { Text( style = MaterialTheme.wireTypography.subline01, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, text = subLine, modifier = modifier.fillMaxWidth() ) diff --git a/app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldDefaults.kt b/app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldDefaults.kt index 2563bc8424c..c561b967438 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldDefaults.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/textfield/WireTextFieldDefaults.kt @@ -40,7 +40,7 @@ fun wireTextFieldColors( disabledTextColor: Color = MaterialTheme.wireColorScheme.onSecondaryButtonDisabled, backgroundColor: Color = MaterialTheme.wireColorScheme.secondaryButtonEnabled, disabledBackgroundColor: Color = MaterialTheme.wireColorScheme.secondaryButtonDisabled, - labelColor: Color = MaterialTheme.wireColorScheme.labelText, + labelColor: Color = MaterialTheme.wireColorScheme.secondaryText, descriptionColor: Color = MaterialTheme.wireColorScheme.secondaryText, ): WireTextFieldColors = object : WireTextFieldColors { diff --git a/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt b/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt index f2ca12b41d1..107666d1d15 100644 --- a/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt +++ b/app/src/main/kotlin/com/wire/android/ui/edit/ReactionOption.kt @@ -65,7 +65,7 @@ fun ReactionOption( emojiFontSize: TextUnit = 28.sp ) { var isEmojiPickerVisible by remember { mutableStateOf(false) } - CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.secondary) { + CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurface) { Column(modifier = modifier) { Row { Spacer(modifier = Modifier.width(dimensions().spacing8x)) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt index 0087bc2f6eb..8b6cf4c8afc 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt @@ -1136,7 +1136,7 @@ fun MessageList( contentAlignment = Alignment.BottomEnd, modifier = modifier .fillMaxSize() - .background(color = colorsScheme().backgroundVariant), + .background(color = colorsScheme().surfaceContainerLow), content = { LazyColumn( state = lazyListState, @@ -1333,8 +1333,8 @@ fun JumpToLastMessageButton( ) { SmallFloatingActionButton( onClick = { coroutineScope.launch { lazyListState.animateScrollToItem(0) } }, - containerColor = MaterialTheme.wireColorScheme.scrollToBottomButtonColor, - contentColor = MaterialTheme.wireColorScheme.onScrollToBottomButtonColor, + containerColor = MaterialTheme.wireColorScheme.secondaryText, + contentColor = MaterialTheme.wireColorScheme.primaryButtonEnabled, shape = CircleShape, elevation = FloatingActionButtonDefaults.elevation(dimensions().spacing0x), modifier = Modifier diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt index b067f167aeb..9b9cfcdaf99 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt @@ -290,6 +290,7 @@ private fun GroupConversationDetailsContent( isAbandonedOneOnOneConversation: Boolean, onSearchConversationMessagesClick: () -> Unit, onConversationMediaClick: () -> Unit, + initialPageIndex: GroupConversationDetailsTabItem = GroupConversationDetailsTabItem.OPTIONS, changeConversationFavoriteStateViewModel: ChangeConversationFavoriteVM = hiltViewModelScoped( ChangeConversationFavoriteStateArgs @@ -299,8 +300,10 @@ private fun GroupConversationDetailsContent( val resources = LocalContext.current.resources val snackbarHostState = LocalSnackbarHostState.current val lazyListStates: List = GroupConversationDetailsTabItem.entries.map { rememberLazyListState() } - val initialPageIndex = GroupConversationDetailsTabItem.OPTIONS.ordinal - val pagerState = rememberPagerState(initialPage = initialPageIndex, pageCount = { GroupConversationDetailsTabItem.entries.size }) + val pagerState = rememberPagerState( + initialPage = initialPageIndex.ordinal, + pageCount = { GroupConversationDetailsTabItem.entries.size } + ) val currentTabState by remember { derivedStateOf { pagerState.calculateCurrentTab() } } val conversationSheetState = rememberConversationSheetState(conversationSheetContent) @@ -418,7 +421,7 @@ private fun GroupConversationDetailsContent( }, contentLazyListState = lazyListStates[currentTabState], ) { - var focusedTabIndex: Int by remember { mutableStateOf(initialPageIndex) } + var focusedTabIndex: Int by remember { mutableStateOf(initialPageIndex.ordinal) } val keyboardController = LocalSoftwareKeyboardController.current val focusManager = LocalFocusManager.current @@ -542,7 +545,7 @@ private fun VerificationInfo(conversationSheetContent: ConversationSheetContent? private fun MLSVerifiedLabel() { VerifiedLabel( stringResource(id = R.string.label_conversations_details_verified_mls).uppercase(), - MaterialTheme.wireColorScheme.mlsVerificationTextColor + MaterialTheme.wireColorScheme.positive ) { MLSVerifiedIcon() } } @@ -621,7 +624,8 @@ fun PreviewGroupConversationDetails() { onEditGuestAccess = {}, onSearchConversationMessagesClick = {}, onConversationMediaClick = {}, - isAbandonedOneOnOneConversation = false + isAbandonedOneOnOneConversation = false, + initialPageIndex = GroupConversationDetailsTabItem.PARTICIPANTS, ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/PasswordProtectedLinkBanner.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/PasswordProtectedLinkBanner.kt index 69a805a40f7..a44fe5c0274 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/PasswordProtectedLinkBanner.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/PasswordProtectedLinkBanner.kt @@ -37,8 +37,11 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.wire.android.R import com.wire.android.ui.common.colorsScheme +import com.wire.android.ui.common.dimensions +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireTypography +import com.wire.android.util.ui.PreviewMultipleThemes @Composable fun PasswordProtectedLinkBanner(modifier: Modifier = Modifier) { @@ -57,7 +60,9 @@ fun PasswordProtectedLinkBanner(modifier: Modifier = Modifier) { Column { Row( - modifier = Modifier.wrapContentHeight() + modifier = Modifier + .wrapContentHeight() + .padding(bottom = dimensions().spacing4x) ) { Text( text = stringResource(id = R.string.password_protected_link_banner_title), @@ -70,7 +75,7 @@ fun PasswordProtectedLinkBanner(modifier: Modifier = Modifier) { .width(16.dp) .height(16.dp), contentDescription = null, - tint = colorsScheme().labelText + tint = colorsScheme().onBackground ) } Text( @@ -81,3 +86,9 @@ fun PasswordProtectedLinkBanner(modifier: Modifier = Modifier) { } } } + +@PreviewMultipleThemes +@Composable +fun PreviewPasswordProtectedLinkBanner() = WireTheme { + PasswordProtectedLinkBanner() +} diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/createPasswordProtectedGuestLink/GeneratePasswordButton.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/createPasswordProtectedGuestLink/GeneratePasswordButton.kt index 04155cf5f47..eec7293b8f5 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/createPasswordProtectedGuestLink/GeneratePasswordButton.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/createPasswordProtectedGuestLink/GeneratePasswordButton.kt @@ -52,7 +52,7 @@ fun GeneratePasswordButton( modifier = Modifier.padding(end = dimensions().corner4x), painter = painterResource(id = R.drawable.ic_shield_holo), contentDescription = null, - tint = colorsScheme().labelText + tint = colorsScheme().onSecondaryButtonEnabled ) }, leadingIconAlignment = IconAlignment.Center, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt index 1e2eddbf039..88c043c35ab 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/options/GroupConversationOptions.kt @@ -123,7 +123,7 @@ fun GroupConversationSettings( ) } - item { WireDivider(color = colorsScheme().outlineVariant) } + item { WireDivider(color = colorsScheme().divider) } item { ServicesOption( @@ -160,7 +160,7 @@ fun GroupConversationSettings( ) } } - item { WireDivider(color = colorsScheme().outlineVariant) } + item { WireDivider(color = colorsScheme().divider) } item { ReadReceiptOption( isSwitchEnabled = state.isUpdatingReadReceiptAllowed, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/participants/GroupConversationParticipants.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/participants/GroupConversationParticipants.kt index 38aa1085b9c..86a4cf068d4 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/participants/GroupConversationParticipants.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/participants/GroupConversationParticipants.kt @@ -20,34 +20,28 @@ package com.wire.android.ui.home.conversations.details.participants import androidx.compose.animation.core.animateFloatAsState import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyListState import androidx.compose.foundation.lazy.rememberLazyListState -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text 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.clip -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.style.TextAlign import com.wire.android.BuildConfig import com.wire.android.ui.common.dimensions +import com.wire.android.ui.common.progress.WireLinearProgressIndicator import com.wire.android.ui.home.conversations.details.participants.model.UIParticipant import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireDimensions +import com.wire.android.ui.theme.wireTypography import com.wire.android.util.ui.PreviewMultipleThemes import com.wire.kalium.logic.data.user.SupportedProtocol @@ -92,32 +86,22 @@ fun GroupConversationParticipants( fun MLSProgressIndicator( mlsProgress: Float, modifier: Modifier = Modifier, - color: Color = MaterialTheme.wireColorScheme.primary, - trackColor: Color = MaterialTheme.wireColorScheme.uncheckedColor ) { val progress by animateFloatAsState(targetValue = mlsProgress) - Box( - modifier = modifier - .fillMaxWidth() - .clip(RoundedCornerShape(dimensions().spacing28x)) - .height(dimensions().spacing32x), - contentAlignment = Alignment.Center - ) { - LinearProgressIndicator( - progress = { progress }, + Column(modifier = modifier.fillMaxWidth()) { + Text( + text = "${SupportedProtocol.MLS.name} (${String.format("%.2f", mlsProgress * 100)}%)", + textAlign = TextAlign.Start, + style = MaterialTheme.wireTypography.title03, + color = MaterialTheme.wireColorScheme.secondaryText, modifier = Modifier .fillMaxWidth() - .fillMaxHeight(), - color = color, - trackColor = trackColor, + .padding(vertical = dimensions().spacing4x) ) - Text( - style = MaterialTheme.typography.labelLarge, - text = "${SupportedProtocol.MLS.name} (${String.format("%.2f", mlsProgress * 100)}%)", - textAlign = TextAlign.Center, - color = MaterialTheme.wireColorScheme.onPrimary, - modifier = Modifier.fillMaxWidth() + WireLinearProgressIndicator( + progress = { progress }, + modifier = Modifier.fillMaxWidth(), ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ConversationMediaScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ConversationMediaScreen.kt index 3b1b37b8c1a..1d4a09ab831 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ConversationMediaScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ConversationMediaScreen.kt @@ -188,7 +188,7 @@ private fun Content( WireScaffold( modifier = Modifier - .background(color = colorsScheme().backgroundVariant), + .background(color = colorsScheme().surfaceContainerLow), topBar = { WireCenterAlignedTopAppBar( elevation = elevationState, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ImageAssetsContent.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ImageAssetsContent.kt index 1f299b539a0..a07359fd8fb 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ImageAssetsContent.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/ImageAssetsContent.kt @@ -93,7 +93,7 @@ private fun ImageAssetGrid( BoxWithConstraints( modifier .fillMaxSize() - .background(color = colorsScheme().backgroundVariant) + .background(color = colorsScheme().surfaceContainerLow) ) { val screenWidth = maxWidth val horizontalPadding = dimensions().spacing12x diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/preview/AssetTilePreview.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/preview/AssetTilePreview.kt index 05b0f28d9c8..c94ba85a5df 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/preview/AssetTilePreview.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/media/preview/AssetTilePreview.kt @@ -130,7 +130,7 @@ fun AssetFilePreviewTile(assetBundle: AssetBundle, modifier: Modifier = Modifier modifier = Modifier, painter = painterResource(R.drawable.ic_file), contentDescription = stringResource(R.string.content_description_image_message), - colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.badge) + colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.secondaryText) ) HorizontalSpace.x4() Text( diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/ReactionPill.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/ReactionPill.kt index 69f6ccc73c3..0769abdbf1c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/ReactionPill.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/ReactionPill.kt @@ -65,7 +65,7 @@ fun ReactionPill( val textColor = if (isOwn) { MaterialTheme.wireColorScheme.primary } else { - MaterialTheme.wireColorScheme.labelText + MaterialTheme.wireColorScheme.secondaryText } CompositionLocalProvider( diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageContainerItem.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageContainerItem.kt index 0c275415209..7960fb27861 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageContainerItem.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageContainerItem.kt @@ -57,7 +57,7 @@ fun MessageContainerItem( shouldDisplayFooter: Boolean = true, isSelectedMessage: Boolean = false, failureInteractionAvailable: Boolean = true, - defaultBackgroundColor: Color = colorsScheme().backgroundVariant, + defaultBackgroundColor: Color = colorsScheme().surfaceContainerLow, ) { val selfDeletionTimerState = rememberSelfDeletionTimer(message.header.messageStatus.expirationStatus) if ( diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageItemComponents.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageItemComponents.kt index 4f712a6cdeb..e91af400750 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageItemComponents.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/messages/item/MessageItemComponents.kt @@ -292,9 +292,9 @@ internal fun Modifier.customizeMessageBackground( isDeleted: Boolean, isSelectedMessage: Boolean, selfDeletionTimerState: SelfDeletionTimerHelper.SelfDeletionTimerState, - errorBackgroundColor: Color = colorsScheme().messageErrorBackgroundColor, + errorBackgroundColor: Color = colorsScheme().errorVariant, highlightBackgroundColor: Color = colorsScheme().primaryVariant, - defaultBackgroundColor: Color = colorsScheme().backgroundVariant, + defaultBackgroundColor: Color = colorsScheme().surfaceContainerLow, ): Modifier { val backgroundColorAnimation = remember { Animatable(defaultBackgroundColor) } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/messagetypes/asset/AssetMessageTypes.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/messagetypes/asset/AssetMessageTypes.kt index e31c3d3f271..fba052229e2 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/messagetypes/asset/AssetMessageTypes.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/model/messagetypes/asset/AssetMessageTypes.kt @@ -112,7 +112,7 @@ internal fun MessageAsset( }, painter = painterResource(R.drawable.ic_file), contentDescription = stringResource(R.string.content_description_image_message), - colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.badge) + colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.secondaryText) ) Text( modifier = Modifier diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt index 7b7b39ce79d..229ff22a300 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/EventBadge.kt @@ -70,7 +70,7 @@ private fun MissedCallBadge(modifier: Modifier = Modifier) { Image( painter = painterResource(id = R.drawable.ic_event_badge_missed_call), contentDescription = null, - colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.onBadge), + colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.inverseOnSurface), modifier = Modifier.height(dimensions().spacing18x) ) } @@ -87,7 +87,7 @@ private fun UnreadMentionBadge(modifier: Modifier = Modifier) { Image( painter = painterResource(id = R.drawable.ic_event_badge_unread_mention), contentDescription = null, - colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.onBadge), + colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.inverseOnSurface), modifier = Modifier.height(dimensions().spacing18x) ) } @@ -104,7 +104,7 @@ private fun UnreadReplyBadge(modifier: Modifier = Modifier) { Image( painter = painterResource(id = R.drawable.ic_event_badge_unread_reply), contentDescription = null, - colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.onBadge), + colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.inverseOnSurface), modifier = Modifier.height(dimensions().spacing18x) ) } @@ -121,7 +121,7 @@ fun UnreadKnockBadge(modifier: Modifier = Modifier) { Image( painter = painterResource(id = R.drawable.ic_event_badge_unread_knock), contentDescription = null, - colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.onBadge), + colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.inverseOnSurface), modifier = Modifier.height(dimensions().spacing18x) ) } @@ -138,7 +138,7 @@ fun ConnectRequestBadge(modifier: Modifier = Modifier) { Image( painter = painterResource(id = R.drawable.ic_event_badge_connect_request), contentDescription = null, - colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.onBadge), + colorFilter = ColorFilter.tint(MaterialTheme.wireColorScheme.inverseOnSurface), modifier = Modifier.height(dimensions().spacing18x) ) } @@ -167,7 +167,7 @@ fun UnreadMessageEventBadge(unreadMessageCount: Int, modifier: Modifier = Modifi vertical = dimensions().spacing2x ), text = unReadMessageCountStringify(unreadMessageCount), - color = MaterialTheme.wireColorScheme.onBadge, + color = MaterialTheme.wireColorScheme.inverseOnSurface, style = MaterialTheme.wireTypography.label02, ) } @@ -180,7 +180,7 @@ private fun NotificationBadgeContainer(notificationIcon: @Composable () -> Unit, Box( modifier = modifier .background( - color = MaterialTheme.wireColorScheme.badge, + color = MaterialTheme.wireColorScheme.inverseSurface, shape = RoundedCornerShape(MaterialTheme.wireDimensions.notificationBadgeRadius) ) .wrapContentSize(Alignment.Center) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/FolderHeader.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/FolderHeader.kt index e422ee1b40b..85c01a701fc 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/FolderHeader.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/common/FolderHeader.kt @@ -52,7 +52,7 @@ fun FolderHeader(name: String, modifier: Modifier = Modifier) { maxLines = 1, overflow = TextOverflow.Ellipsis, style = MaterialTheme.wireTypography.title03, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, ) } @@ -78,7 +78,7 @@ fun CollapsingFolderHeader( Icon( imageVector = ImageVector.vectorResource(R.drawable.ic_collapse), contentDescription = null, - tint = MaterialTheme.wireColorScheme.labelText, + tint = MaterialTheme.wireColorScheme.secondaryText, modifier = Modifier .padding(horizontal = arrowHorizontalPadding) .width(arrowWidth) @@ -89,7 +89,7 @@ fun CollapsingFolderHeader( maxLines = 1, overflow = TextOverflow.Ellipsis, style = MaterialTheme.wireTypography.title02, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/filter/ConversationFilterSheetContent.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/filter/ConversationFilterSheetContent.kt index b345c267068..4d7f58064cc 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/filter/ConversationFilterSheetContent.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversationslist/filter/ConversationFilterSheetContent.kt @@ -49,7 +49,7 @@ fun ConversationFilterSheetContent( MenuItemIcon( id = R.drawable.ic_check_circle, contentDescription = stringResource(R.string.label_selected), - tint = MaterialTheme.wireColorScheme.switchEnabledChecked, + tint = MaterialTheme.wireColorScheme.positive, ) } }, diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/AdditionalOptions.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/AdditionalOptions.kt index a05f3c9fe85..9d16458a4e0 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/AdditionalOptions.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/AdditionalOptions.kt @@ -59,7 +59,7 @@ fun AdditionalOptionsMenu( onOnSelfDeletingOptionClicked: ((SelfDeletionTimer) -> Unit)? = null, onGifOptionClicked: (() -> Unit)? = null ) { - Box(modifier.background(colorsScheme().messageComposerBackgroundColor)) { + Box(modifier.background(colorsScheme().surface)) { when (additionalOptionsState) { AdditionalOptionMenuState.AttachmentAndAdditionalOptionsMenu -> { AttachmentAndAdditionalOptionsMenuItems( diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt index 39fc2d15e6f..ee003250489 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/EnabledMessageComposer.kt @@ -145,7 +145,7 @@ fun EnabledMessageComposer( Surface( modifier = modifier, - color = colorsScheme().messageComposerBackgroundColor + color = colorsScheme().surface ) { Column( modifier = Modifier @@ -161,7 +161,7 @@ fun EnabledMessageComposer( Box( contentAlignment = Alignment.BottomCenter, modifier = expandOrHideMessagesModifier - .background(color = colorsScheme().backgroundVariant) + .background(color = colorsScheme().surfaceContainerLow) ) { messageListContent() if (!inputStateHolder.isTextExpanded) { @@ -190,7 +190,7 @@ fun EnabledMessageComposer( verticalArrangement = Arrangement.Bottom, modifier = fillRemainingSpaceOrWrapContent .fillMaxWidth() - .background(color = colorsScheme().backgroundVariant) + .background(color = colorsScheme().surfaceContainerLow) ) { Box(Modifier.wrapContentSize()) { SecurityClassificationBannerForConversation( @@ -330,7 +330,7 @@ fun EnabledMessageComposer( showAttachments(false) } ) { - val rippleColor = colorsScheme().messageComposerBackgroundColor + val rippleColor = colorsScheme().surface val shape = if (isImeVisible) { RectangleShape } else { diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposer.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposer.kt index e16bda6fe63..f56f28258b9 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposer.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/MessageComposer.kt @@ -174,7 +174,7 @@ private fun DisabledInteractionMessageComposer( learnMoreLink: String? = null, messageListContent: @Composable () -> Unit ) { - Surface(color = colorsScheme().messageComposerBackgroundColor) { + Surface(color = colorsScheme().surface) { Column( Modifier .fillMaxWidth() @@ -186,7 +186,7 @@ private fun DisabledInteractionMessageComposer( Box( Modifier - .background(color = colorsScheme().backgroundVariant) + .background(color = colorsScheme().surfaceContainerLow) .then(fillRemainingSpaceBetweenMessageListContentAndMessageComposer) ) { messageListContent() @@ -197,7 +197,7 @@ private fun DisabledInteractionMessageComposer( verticalAlignment = Alignment.CenterVertically, modifier = Modifier .fillMaxWidth() - .background(color = colorsScheme().backgroundVariant) + .background(color = colorsScheme().surfaceContainerLow) .padding(dimensions().spacing16x) ) { Icon( diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioButtons.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioButtons.kt index 487e0cc5171..1356c670ba0 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioButtons.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioButtons.kt @@ -29,7 +29,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.CircleShape -import androidx.compose.material3.Checkbox import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text @@ -42,7 +41,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalInspectionMode import androidx.compose.ui.res.painterResource @@ -51,11 +49,11 @@ import androidx.compose.ui.unit.sp import com.wire.android.R import com.wire.android.media.audiomessage.AudioMediaPlayingState import com.wire.android.media.audiomessage.AudioState +import com.wire.android.ui.common.WireCheckbox import com.wire.android.ui.common.button.IconAlignment import com.wire.android.ui.common.button.WireButtonState -import com.wire.android.ui.common.button.WireSecondaryButton +import com.wire.android.ui.common.button.WirePrimaryButton import com.wire.android.ui.common.button.WireTertiaryIconButton -import com.wire.android.ui.common.button.wireSecondaryButtonColors import com.wire.android.ui.common.colorsScheme import com.wire.android.ui.common.dimensions import com.wire.android.ui.home.conversations.model.messagetypes.audio.RecordedAudioMessage @@ -95,7 +93,7 @@ fun RecordAudioButtonEnabled( topContent = {}, iconResId = R.drawable.ic_microphone_on, contentDescription = R.string.content_description_record_audio_button_start, - buttonColor = colorsScheme().recordAudioStartColor, + buttonState = WireButtonState.Default, bottomText = R.string.record_audio_start_label, applyAudioFilterState = applyAudioFilterState, applyAudioFilterClick = applyAudioFilterClick @@ -108,8 +106,9 @@ fun RecordAudioButtonRecording( onClick: () -> Unit, modifier: Modifier = Modifier ) { + val initialSeconds = if (LocalInspectionMode.current) 1 else 0 var seconds by remember { - mutableStateOf(0) + mutableStateOf(initialSeconds) } LaunchedEffect(key1 = Unit) { while (true) { @@ -141,9 +140,8 @@ fun RecordAudioButtonRecording( }, iconResId = R.drawable.ic_stop, contentDescription = R.string.content_description_record_audio_button_stop, - buttonColor = colorsScheme().recordAudioStopColor, bottomText = R.string.record_audio_recording_label, - buttonState = if (seconds > 0) WireButtonState.Default else WireButtonState.Disabled, + buttonState = if (seconds > 0) WireButtonState.Error else WireButtonState.Disabled, isAudioFilterEnabled = false, applyAudioFilterState = applyAudioFilterState, applyAudioFilterClick = { } @@ -173,7 +171,6 @@ fun RecordAudioButtonEncoding( iconResId = null, trailingIconAlignment = IconAlignment.Center, contentDescription = -1, - buttonColor = colorsScheme().recordAudioStopColor, bottomText = R.string.record_audio_encoding_label, buttonState = WireButtonState.Disabled, isAudioFilterEnabled = false, @@ -212,7 +209,7 @@ fun RecordAudioButtonSend( }, iconResId = R.drawable.ic_send, contentDescription = R.string.content_description_record_audio_button_send, - buttonColor = colorsScheme().recordAudioStartColor, + buttonState = WireButtonState.Default, bottomText = R.string.record_audio_send_label, applyAudioFilterState = applyAudioFilterState, applyAudioFilterClick = applyAudioFilterClick @@ -225,7 +222,6 @@ private fun RecordAudioButton( topContent: @Composable () -> Unit, @DrawableRes iconResId: Int?, @StringRes contentDescription: Int, - buttonColor: Color, @StringRes bottomText: Int, applyAudioFilterState: Boolean, applyAudioFilterClick: (Boolean) -> Unit, @@ -242,7 +238,7 @@ private fun RecordAudioButton( topContent() Spacer(modifier = Modifier.height(dimensions().spacing40x)) - WireSecondaryButton( + WirePrimaryButton( modifier = Modifier .width(dimensions().spacing80x) .height(dimensions().spacing80x), @@ -259,9 +255,6 @@ private fun RecordAudioButton( } }, shape = CircleShape, - colors = wireSecondaryButtonColors().copy( - enabled = buttonColor - ), state = buttonState, loading = loading ) @@ -275,7 +268,7 @@ private fun RecordAudioButton( Row( verticalAlignment = Alignment.CenterVertically ) { - Checkbox( + WireCheckbox( enabled = isAudioFilterEnabled, checked = applyAudioFilterState, onCheckedChange = applyAudioFilterClick @@ -283,7 +276,7 @@ private fun RecordAudioButton( Text( text = stringResource(id = R.string.record_audio_apply_filter_label), style = MaterialTheme.wireTypography.body01, - color = if (isAudioFilterEnabled) Color.Unspecified else colorsScheme().checkboxTextDisabled + color = if (isAudioFilterEnabled) colorsScheme().onSecondaryButtonEnabled else colorsScheme().onSecondaryButtonDisabled ) } } @@ -345,18 +338,6 @@ fun PreviewRecordAudioButtonSend() { @PreviewMultipleThemes @Composable -fun PreviewRecordAudioButton() { - WireTheme { - RecordAudioButton( - onClick = {}, - modifier = Modifier, - topContent = {}, - iconResId = R.drawable.ic_microphone_on, - contentDescription = R.string.content_description_record_audio_button_start, - buttonColor = colorsScheme().recordAudioStartColor, - bottomText = R.string.record_audio_start_label, - applyAudioFilterState = false, - applyAudioFilterClick = {} - ) - } +fun PreviewRecordAudioButtonEncoding() = WireTheme { + RecordAudioButtonEncoding(applyAudioFilterState = false) } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/state/MessageCompositionInputStateHolder.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/state/MessageCompositionInputStateHolder.kt index 320655a133d..6d76e876a00 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/state/MessageCompositionInputStateHolder.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/state/MessageCompositionInputStateHolder.kt @@ -224,7 +224,7 @@ sealed class InputType { ) @Composable - open fun backgroundColor(): Color = colorsScheme().messageComposerBackgroundColor + open fun backgroundColor(): Color = colorsScheme().surface @Composable open fun labelText(): String = stringResource(R.string.label_type_a_message) @@ -234,6 +234,6 @@ sealed class InputType { class Editing(val isEditButtonEnabled: Boolean) : InputType() { @Composable - override fun backgroundColor(): Color = colorsScheme().messageComposerEditBackgroundColor + override fun backgroundColor(): Color = colorsScheme().primaryVariant } } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/create/CreateBackupDialogs.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/create/CreateBackupDialogs.kt index 223f6971416..93068eb9432 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/create/CreateBackupDialogs.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/create/CreateBackupDialogs.kt @@ -25,7 +25,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.text.input.TextFieldState -import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -39,12 +38,15 @@ import com.wire.android.ui.common.WireDialogButtonProperties import com.wire.android.ui.common.WireDialogButtonType import com.wire.android.ui.common.button.WireButtonState import com.wire.android.ui.common.dimensions +import com.wire.android.ui.common.progress.WireLinearProgressIndicator import com.wire.android.ui.common.spacers.VerticalSpace import com.wire.android.ui.common.textfield.WirePasswordTextField import com.wire.android.ui.common.textfield.WireTextFieldState import com.wire.android.ui.common.wireDialogPropertiesBuilder +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireTypography import com.wire.android.util.permission.rememberCreateFileFlow +import com.wire.android.util.ui.PreviewMultipleThemes import com.wire.kalium.logic.feature.auth.ValidatePasswordResult import java.util.Locale import kotlin.math.roundToInt @@ -150,8 +152,22 @@ fun CreateBackupDialog( } } VerticalSpace.x16() - LinearProgressIndicator(modifier = Modifier.fillMaxWidth(), progress = { progress }) + WireLinearProgressIndicator(modifier = Modifier.fillMaxWidth(), progress = { progress }) VerticalSpace.x16() } } } + +@PreviewMultipleThemes +@Composable +fun PreviewSetBackupPasswordDialog() = WireTheme { + CreateBackupDialog( + isBackupCreationCompleted = false, + createBackupProgress = 0.5f, + backupFileName = "filename", + onPermissionPermanentlyDenied = {}, + onSaveBackup = {}, + onShareBackup = {}, + onDismissDialog = {} + ) +} diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/restore/RestoreBackupDialogs.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/restore/RestoreBackupDialogs.kt index d989dad2040..d4ba5122d6c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/restore/RestoreBackupDialogs.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/backup/dialog/restore/RestoreBackupDialogs.kt @@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.text.input.TextFieldState -import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -37,11 +36,14 @@ import com.wire.android.ui.common.WireDialog import com.wire.android.ui.common.WireDialogButtonProperties import com.wire.android.ui.common.WireDialogButtonType import com.wire.android.ui.common.button.WireButtonState +import com.wire.android.ui.common.progress.WireLinearProgressIndicator import com.wire.android.ui.common.spacers.VerticalSpace import com.wire.android.ui.common.textfield.WirePasswordTextField import com.wire.android.ui.common.wireDialogPropertiesBuilder import com.wire.android.ui.home.messagecomposer.rememberSingleFileBrowserFlow +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireTypography +import com.wire.android.util.ui.PreviewMultipleThemes import kotlin.math.roundToInt @Composable @@ -154,7 +156,7 @@ fun RestoreProgressDialog( } } VerticalSpace.x16() - LinearProgressIndicator( + WireLinearProgressIndicator( progress = { progress }, modifier = Modifier.fillMaxWidth(), ) @@ -162,3 +164,14 @@ fun RestoreProgressDialog( } } } + +@PreviewMultipleThemes +@Composable +fun PreviewRestoreProgressDialog() = WireTheme { + RestoreProgressDialog( + isRestoreCompleted = false, + restoreProgress = 0.5f, + onOpenConversation = {}, + onCancelBackupRestore = {}, + ) +} diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt index e1e791b2046..23cd3883f37 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/privacy/PrivacySettingsScreen.kt @@ -100,14 +100,14 @@ fun PrivacySettingsScreenContent( subtitle = stringResource(id = R.string.settings_send_anonymous_usage_data_description) ) } - WireDivider(color = colorsScheme().outlineVariant) + WireDivider(color = colorsScheme().divider) GroupConversationOptionsItem( title = stringResource(R.string.settings_send_read_receipts), switchState = SwitchState.Enabled(value = areReadReceiptsEnabled, onCheckedChange = setReadReceiptsState), arrowType = ArrowType.NONE, subtitle = stringResource(id = R.string.settings_send_read_receipts_description) ) - WireDivider(color = colorsScheme().outlineVariant) + WireDivider(color = colorsScheme().divider) GroupConversationOptionsItem( title = stringResource(R.string.settings_censor_screenshots), switchState = when (screenshotCensoringConfig) { @@ -128,7 +128,7 @@ fun PrivacySettingsScreenContent( } ) ) - WireDivider(color = colorsScheme().outlineVariant) + WireDivider(color = colorsScheme().divider) GroupConversationOptionsItem( title = stringResource(R.string.settings_show_typing_indicator_title), switchState = SwitchState.Enabled(value = isTypingIndicatorEnabled, onCheckedChange = setTypingIndicatorState), diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt index 843d1d988e5..5b09fcf9309 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt @@ -36,6 +36,7 @@ import com.wire.android.ui.common.dimensions import com.wire.android.ui.settings.devices.button.GetE2eiCertificateButton import com.wire.android.ui.settings.devices.button.ShowE2eiCertificateButton import com.wire.android.ui.settings.devices.button.UpdateE2eiCertificateButton +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.theme.wireTypography @@ -114,7 +115,7 @@ fun EndToEndIdentityCertificateItem( MLSClientE2EIStatus.VALID -> { E2EIStatusRow( label = stringResource(id = R.string.e2ei_certificat_status_valid), - labelColor = colorsScheme().validE2eiStatusColor, + labelColor = colorsScheme().positive, icon = R.drawable.ic_certificate_valid_mls ) SerialNumberBlock(mlsClientIdentity.x509Identity!!.serialNumber) @@ -215,7 +216,7 @@ private fun E2EIStatusRow( @PreviewMultipleThemes @Composable -fun PreviewEndToEndIdentityCertificateItem() { +fun PreviewEndToEndIdentityCertificateItem() = WireTheme { EndToEndIdentityCertificateItem( isE2eiCertificateActivated = true, isCurrentDevice = false, @@ -228,7 +229,7 @@ fun PreviewEndToEndIdentityCertificateItem() { @PreviewMultipleThemes @Composable -fun PreviewEndToEndIdentityCertificateSelfItem() { +fun PreviewEndToEndIdentityCertificateSelfItem() = WireTheme { EndToEndIdentityCertificateItem( isE2eiCertificateActivated = true, isCurrentDevice = true, diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt index eb2da5c2842..32d07b85e7c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/common/UserProfileInfo.kt @@ -218,8 +218,7 @@ fun UserProfileInfo( maxLines = 2, textAlign = TextAlign.Center, style = MaterialTheme.wireTypography.title02, - color = if (fullName.isNotBlank()) MaterialTheme.colorScheme.onBackground - else MaterialTheme.wireColorScheme.labelText, + color = if (fullName.isNotBlank()) MaterialTheme.colorScheme.onBackground else MaterialTheme.wireColorScheme.secondaryText, inlineContent = inlineContent ) @@ -239,7 +238,7 @@ fun UserProfileInfo( style = MaterialTheme.wireTypography.body02, maxLines = 2, textAlign = TextAlign.Center, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, modifier = Modifier.semantics(mergeDescendants = true) { contentDescription = usernameDescription } ) UserBadge( diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserConnectionStatusInfo.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserConnectionStatusInfo.kt index 6be5fee147c..385635fb72a 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserConnectionStatusInfo.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserConnectionStatusInfo.kt @@ -61,7 +61,7 @@ fun OtherUserConnectionStatusInfo(connectionStatus: ConnectionState, membership: Text( text = stringResource(it), textAlign = TextAlign.Center, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.secondaryText, style = MaterialTheme.wireTypography.body01 ) VerticalSpace.x24() diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileDetails.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileDetails.kt index 03780519dce..6ce6dce4700 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileDetails.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileDetails.kt @@ -30,14 +30,15 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource -import androidx.compose.ui.tooling.preview.Preview import com.wire.android.R import com.wire.android.model.Clickable import com.wire.android.ui.common.CopyButton import com.wire.android.ui.common.RowItemTemplate import com.wire.android.ui.common.dimensions +import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireTypography +import com.wire.android.util.ui.PreviewMultipleThemes @Composable fun OtherUserProfileDetails( @@ -93,8 +94,8 @@ private fun UserDetailInformation( modifier = Modifier.padding(horizontal = dimensions().spacing8x), title = { Text( - style = MaterialTheme.wireTypography.subline01, - color = MaterialTheme.wireColorScheme.labelText, + style = MaterialTheme.wireTypography.label01, + color = MaterialTheme.wireColorScheme.secondaryText, text = title.uppercase() ) }, @@ -117,8 +118,8 @@ private fun UserDetailInformation( ) } +@PreviewMultipleThemes @Composable -@Preview -fun PreviewOtherUserProfileDetails() { +fun PreviewOtherUserProfileDetails() = WireTheme { OtherUserProfileDetails(OtherUserProfileState.PREVIEW) } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileGroup.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileGroup.kt index dd3e26786d5..b7c26ce4584 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileGroup.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileGroup.kt @@ -33,7 +33,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString -import androidx.compose.ui.tooling.preview.Preview import com.wire.android.R import com.wire.android.model.Clickable import com.wire.android.ui.common.RowItemTemplate @@ -111,7 +110,7 @@ private fun UserGroupDetailsInformation( Spacer(modifier = Modifier.height(dimensions().spacing16x)) Text( style = MaterialTheme.wireTypography.body01, - color = MaterialTheme.wireColorScheme.labelText, + color = MaterialTheme.wireColorScheme.onBackground, text = title ) Spacer(modifier = Modifier.height(dimensions().spacing16x)) @@ -142,8 +141,8 @@ private fun UserRoleInformation( modifier = Modifier.padding(horizontal = dimensions().spacing8x), title = { Text( - style = MaterialTheme.wireTypography.subline01, - color = MaterialTheme.wireColorScheme.labelText, + style = MaterialTheme.wireTypography.label01, + color = MaterialTheme.wireColorScheme.secondaryText, text = label.uppercase() ) }, @@ -181,8 +180,8 @@ val Member.Role.name } @Composable -@Preview -fun PreviewOtherUserProfileGroup() { +@PreviewMultipleThemes +fun PreviewOtherUserProfileGroup() = WireTheme { OtherUserProfileGroup(OtherUserProfileState.PREVIEW, {}, {}) } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/CreateTeamInfoCard.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/CreateTeamInfoCard.kt index 3741472dd9d..09e3e5a9730 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/CreateTeamInfoCard.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/CreateTeamInfoCard.kt @@ -47,9 +47,9 @@ fun CreateTeamInfoCard( OutlinedCard( modifier = modifier.fillMaxWidth(), colors = CardDefaults.cardColors( - containerColor = colorsScheme().createTeamInfoCardBackgroundColor + containerColor = colorsScheme().secondaryButtonSelected ), - border = BorderStroke(dimensions().spacing1x, colorsScheme().createTeamInfoCardBorderColor), + border = BorderStroke(dimensions().spacing1x, colorsScheme().secondaryButtonSelectedOutline), ) { Row( modifier = Modifier.padding( @@ -95,8 +95,6 @@ fun CreateTeamInfoCard( @PreviewMultipleThemes @Composable -fun PreviewCreateTeamInfoCard() { - WireTheme { +fun PreviewCreateTeamInfoCard() = WireTheme { CreateTeamInfoCard({ }) - } } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationScreen.kt index c7ed3f3d9c5..1fb026631a7 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/TeamMigrationScreen.kt @@ -76,11 +76,12 @@ fun TeamMigrationScreen( } val isRunInPreview = LocalInspectionMode.current - + // TODO: after updating material3 to 1.4.0, we can replace it by bottom sheet with `sheetGestureEnabled = false` + // so that it can't be dragged down and the scrim looks way better than now and covers also status bar properly if (!isRunInPreview) { val activity = LocalActivity.current activity.window.setBackgroundDrawable( - ColorDrawable(colorsScheme().windowPersonalToTeamMigration.toArgb()) + ColorDrawable(colorsScheme().scrim.toArgb()) ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step1/TeamMigrationTeamPlanStepScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step1/TeamMigrationTeamPlanStepScreen.kt index 7f34cda3a13..556196d0b78 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step1/TeamMigrationTeamPlanStepScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/teammigration/step1/TeamMigrationTeamPlanStepScreen.kt @@ -32,7 +32,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource @@ -226,7 +225,7 @@ private fun AdvantageRow( Icon( painter = painterResource(id = R.drawable.ic_check), contentDescription = null, - tint = Color.Unspecified, + tint = colorsScheme().positive, modifier = Modifier.align(Alignment.CenterVertically) ) Text( @@ -238,7 +237,7 @@ private fun AdvantageRow( ) } Divider( - color = colorsScheme().dividerPersonalToTeamMigration + color = colorsScheme().outline ) } } diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/ThemeExt.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/ThemeExt.kt index fcdf718ff53..fae644414ec 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/ThemeExt.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/ThemeExt.kt @@ -20,7 +20,10 @@ package com.wire.android.ui.common import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import com.wire.android.ui.theme.wireColorScheme +import com.wire.android.ui.theme.wireDarkColorScheme import com.wire.android.ui.theme.wireDimensions +import com.wire.android.ui.theme.wireFixedColorScheme +import com.wire.android.ui.theme.wireLightColorScheme import com.wire.android.ui.theme.wireTypography @Composable @@ -29,5 +32,14 @@ fun dimensions() = MaterialTheme.wireDimensions @Composable fun colorsScheme() = MaterialTheme.wireColorScheme +@Composable +fun darkColorsScheme() = MaterialTheme.wireDarkColorScheme + +@Composable +fun lightColorsScheme() = MaterialTheme.wireLightColorScheme + +@Composable +fun fixedColorsScheme() = MaterialTheme.wireFixedColorScheme + @Composable fun typography() = MaterialTheme.wireTypography diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/MenuBottomSheetItem.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/MenuBottomSheetItem.kt index 019f6553cd4..d06025cc503 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/MenuBottomSheetItem.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/MenuBottomSheetItem.kt @@ -54,7 +54,7 @@ fun MenuBottomSheetItem( leading: (@Composable () -> Unit)? = null, trailing: (@Composable () -> Unit)? = null, clickBlockParams: ClickBlockParams = ClickBlockParams(), - itemProvidedColor: Color = MaterialTheme.colorScheme.secondary, + itemProvidedColor: Color = MaterialTheme.colorScheme.onSurface, onItemClick: () -> Unit = {}, enabled: Boolean = true, onItemClickDescription: String? = null diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/ModalSheetHeaderItem.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/ModalSheetHeaderItem.kt index f43ac73b191..0ec6ea2b2db 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/ModalSheetHeaderItem.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/bottomsheet/ModalSheetHeaderItem.kt @@ -45,7 +45,7 @@ fun ModalSheetHeaderItem(header: MenuModalSheetHeader = MenuModalSheetHeader.Gon } is MenuModalSheetHeader.Visible -> { - CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.secondary) { + CompositionLocalProvider(LocalContentColor provides MaterialTheme.colorScheme.onSurface) { Row( verticalAlignment = Alignment.CenterVertically, modifier = Modifier.padding( diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireCheckBoxDefaults.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireCheckBoxDefaults.kt index ddfc56a2826..ceae7b08f3d 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireCheckBoxDefaults.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/button/WireCheckBoxDefaults.kt @@ -27,18 +27,18 @@ import com.wire.android.ui.theme.wireColorScheme @Composable fun wireCheckBoxColors() = CheckboxDefaults.colors( - uncheckedColor = MaterialTheme.wireColorScheme.uncheckedColor, + uncheckedColor = MaterialTheme.wireColorScheme.onPrimaryButtonDisabled, checkedColor = MaterialTheme.colorScheme.primary, checkmarkColor = MaterialTheme.colorScheme.onPrimary, - disabledCheckedColor = MaterialTheme.wireColorScheme.disabledCheckedColor, - disabledUncheckedColor = MaterialTheme.wireColorScheme.disabledUncheckedColor, - disabledIndeterminateColor = MaterialTheme.wireColorScheme.disabledIndeterminateColor + disabledCheckedColor = MaterialTheme.wireColorScheme.primaryButtonDisabled, + disabledUncheckedColor = MaterialTheme.wireColorScheme.primaryButtonDisabled, + disabledIndeterminateColor = MaterialTheme.wireColorScheme.primaryButtonDisabled ) @Composable fun wireRadioButtonColors() = RadioButtonDefaults.colors( selectedColor = colorsScheme().primary, - unselectedColor = colorsScheme().uncheckedColor, - disabledSelectedColor = colorsScheme().disabledCheckedColor, - disabledUnselectedColor = colorsScheme().disabledUncheckedColor + unselectedColor = colorsScheme().onPrimaryButtonDisabled, + disabledSelectedColor = colorsScheme().primaryButtonDisabled, + disabledUnselectedColor = colorsScheme().primaryButtonDisabled ) diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/progress/WireLinearProgressIndicator.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/progress/WireLinearProgressIndicator.kt index 3ac1b3f84f6..b0aac476999 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/common/progress/WireLinearProgressIndicator.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/common/progress/WireLinearProgressIndicator.kt @@ -18,15 +18,38 @@ package com.wire.android.ui.common.progress +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding import androidx.compose.material3.LinearProgressIndicator import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color +import com.wire.android.ui.common.colorsScheme +import com.wire.android.ui.common.dimensions +import com.wire.android.ui.theme.WireTheme +import com.wire.android.util.PreviewMultipleThemes @Composable -fun WireLinearProgressIndicator(modifier: Modifier = Modifier, progressColor: Color) { +fun WireLinearProgressIndicator( + progress: () -> Float, + modifier: Modifier = Modifier, +) { LinearProgressIndicator( - color = progressColor, - modifier = modifier + progress = progress, + color = colorsScheme().primary, + trackColor = colorsScheme().primaryVariant, + modifier = modifier, ) } + +@PreviewMultipleThemes +@Composable +fun PreviewWireLinearProgressIndicator() = WireTheme { + Box( + modifier = Modifier + .background(colorsScheme().surface) + .padding(dimensions().spacing16x) + ) { + WireLinearProgressIndicator(progress = { 0.5f }) + } +} diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/Theme.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/Theme.kt index 50f615755d2..868cf9b1247 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/Theme.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/Theme.kt @@ -34,6 +34,7 @@ import com.wire.android.ui.common.snackbar.LocalSnackbarHostState @Composable fun WireTheme( wireColorScheme: WireColorScheme = WireColorSchemeTypes.currentTheme, + wireFixedColorScheme: WireFixedColorScheme = DefaultWireFixedColorScheme, wireTypography: WireTypography = WireTypographyTypes.currentScreenSize, wireDimensions: WireDimensions = WireDimensionsTypes.currentScreenSize.currentOrientation, content: @Composable () -> Unit @@ -43,6 +44,7 @@ fun WireTheme( @Suppress("SpreadOperator") CompositionLocalProvider( LocalWireColors provides wireColorScheme, + LocalWireFixedColors provides wireFixedColorScheme, LocalWireTypography provides wireTypography, LocalWireDimensions provides wireDimensions, // we need to provide our default content color dependent on the current colorScheme, otherwise it's Color.Black @@ -69,6 +71,7 @@ fun WireTheme( } private val LocalWireColors = staticCompositionLocalOf { WireColorSchemeTypes.light } +private val LocalWireFixedColors = staticCompositionLocalOf { DefaultWireFixedColorScheme } private val LocalWireTypography = staticCompositionLocalOf { WireTypographyTypes.defaultPhone } private val LocalWireDimensions = staticCompositionLocalOf { WireDimensionsTypes.defaultPhone.portrait } @@ -76,6 +79,18 @@ val MaterialTheme.wireColorScheme @Composable get() = LocalWireColors.current +val MaterialTheme.wireDarkColorScheme + @Composable + get() = WireColorSchemeTypes.dark + +val MaterialTheme.wireLightColorScheme + @Composable + get() = WireColorSchemeTypes.light + +val MaterialTheme.wireFixedColorScheme + @Composable + get() = LocalWireFixedColors.current + val MaterialTheme.wireTypography @Composable get() = LocalWireTypography.current diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt index 189689e2e7c..dfce90a62c6 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorPalette.kt @@ -304,9 +304,6 @@ object WireColorPalette { @Stable val Gray100 = Color(0xFF17181A) - @Stable - val GrayRed900 = Color(0xFF390000) - @Stable val BlackAlpha55 = Color(0x8C000000) diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt index 31bd3f8d98c..c74b1474e71 100644 --- a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireColorScheme.kt @@ -25,22 +25,37 @@ import androidx.compose.runtime.Immutable import androidx.compose.ui.graphics.Color import io.github.esentsov.PackagePrivate +@Suppress("LongParameterList") @Immutable -data class WireColorScheme( +class WireColorScheme( val useDarkSystemBarIcons: Boolean, val connectivityBarShouldUseDarkIcons: Boolean, + + // basic colors val primary: Color, val onPrimary: Color, val primaryVariant: Color, val onPrimaryVariant: Color, val inversePrimary: Color, val error: Color, val onError: Color, - val errorOutline: Color, + val errorVariant: Color, val onErrorVariant: Color, val warning: Color, val onWarning: Color, + val highlight: Color, val onHighlight: Color, val positive: Color, val onPositive: Color, + val positiveVariant: Color, val onPositiveVariant: Color, + val secondaryText: Color, + + // background colors val background: Color, val onBackground: Color, - val backgroundVariant: Color, val onBackgroundVariant: Color, val surface: Color, val onSurface: Color, val surfaceVariant: Color, val onSurfaceVariant: Color, val inverseSurface: Color, val inverseOnSurface: Color, + val surfaceBright: Color, val surfaceDim: Color, + val surfaceContainerLowest: Color, + val surfaceContainerLow: Color, // backgroundVariant + val surfaceContainer: Color, + val surfaceContainerHigh: Color, + val surfaceContainerHighest: Color, + + // buttons val primaryButtonEnabled: Color, val onPrimaryButtonEnabled: Color, val primaryButtonDisabled: Color, val onPrimaryButtonDisabled: Color, val primaryButtonSelected: Color, val onPrimaryButtonSelected: Color, @@ -57,87 +72,40 @@ data class WireColorScheme( val tertiaryButtonSelected: Color, val onTertiaryButtonSelected: Color, val tertiaryButtonSelectedOutline: Color, val tertiaryButtonRipple: Color, - val switchEnabledThumb: Color, val switchDisabledThumb: Color, - val switchEnabledChecked: Color, val switchDisabledChecked: Color, - val switchEnabledUnchecked: Color, val switchDisabledUnchecked: Color, - val divider: Color, - val dividerPersonalToTeamMigration: Color, - val windowPersonalToTeamMigration: Color, - val secondaryText: Color, + + // strokes and shadows val outline: Color, - val outlineVariant: Color, + val divider: Color, val scrim: Color, - val labelText: Color, - val badge: Color, val onBadge: Color, - val highlight: Color, val onHighlight: Color, - val uncheckedColor: Color, - val disabledCheckedColor: Color, - val disabledIndeterminateColor: Color, - val disabledUncheckedColor: Color, - val messageErrorBackgroundColor: Color, + + // accents val groupAvatarColors: List, - val callingParticipantTileBackgroundColor: Color, - val callingParticipantNameBackground: Color, - val callingParticipantNameText: Color, - val callingParticipantNameConnectingText: Color, - val callingParticipantError: Color, - val callingPagerIndicatorBackground: Color, - val callingActiveIndicator: Color, - val callingInActiveIndicator: Color, - val callingInActiveBorderIndicator: Color, - val callingControlButtonActive: Color, - val callingControlButtonActiveOutline: Color, - val onCallingControlButtonActive: Color, - val callingControlButtonInactive: Color, - val callingControlButtonInactiveOutline: Color, - val onCallingControlButtonInactive: Color, - val callingHangupButtonColor: Color, - val onCallingHangupButtonColor: Color, - val callingAnswerButtonColor: Color, - val onCallingAnswerButtonColor: Color, - val connectivityBarIssueBackgroundColor: Color, - val messageComposerBackgroundColor: Color, - val messageComposerEditBackgroundColor: Color, - val classifiedBannerBackgroundColor: Color, - val classifiedBannerForegroundColor: Color, - val unclassifiedBannerBackgroundColor: Color, - val unclassifiedBannerForegroundColor: Color, - val recordAudioStartColor: Color, - val recordAudioStopColor: Color, - val scrollToBottomButtonColor: Color, - val onScrollToBottomButtonColor: Color, - val validE2eiStatusColor: Color, - val mlsVerificationTextColor: Color, - val createTeamInfoCardBackgroundColor: Color, - val createTeamInfoCardBorderColor: Color, val wireAccentColors: WireAccentColors, - val checkboxTextDisabled: Color, - val sketchColorPalette: List ) { fun toColorScheme(): ColorScheme = ColorScheme( - primary = primary, - onPrimary = onPrimary, - primaryContainer = secondaryButtonSelected, - onPrimaryContainer = onSecondaryButtonSelected, + primary = primary, onPrimary = onPrimary, + primaryContainer = primaryVariant, onPrimaryContainer = onPrimaryVariant, inversePrimary = inversePrimary, - secondary = badge, - onSecondary = onBadge, - secondaryContainer = backgroundVariant, - onSecondaryContainer = onBackgroundVariant, - tertiary = primary, - onTertiary = onPrimary, - tertiaryContainer = secondaryButtonSelected, - onTertiaryContainer = onSecondaryButtonSelected, + secondary = positive, onSecondary = onPositive, + secondaryContainer = positiveVariant, onSecondaryContainer = onPositiveVariant, + tertiary = warning, onTertiary = onWarning, + tertiaryContainer = highlight, onTertiaryContainer = onHighlight, background = background, onBackground = onBackground, surface = surface, onSurface = onSurface, surfaceVariant = surfaceVariant, onSurfaceVariant = onSurfaceVariant, surfaceTint = primary, inverseSurface = inverseSurface, inverseOnSurface = inverseOnSurface, error = error, onError = onError, - errorContainer = errorOutline, onErrorContainer = error, + errorContainer = errorVariant, onErrorContainer = onErrorVariant, outline = outline, - outlineVariant = outlineVariant, - scrim = scrim + outlineVariant = divider, + scrim = scrim, + surfaceBright = surfaceBright, surfaceDim = surfaceDim, + surfaceContainerLowest = surfaceContainerLowest, + surfaceContainerLow = surfaceContainerLow, + surfaceContainer = surfaceContainer, + surfaceContainerHigh = surfaceContainerHigh, + surfaceContainerHighest = surfaceContainerHighest, ) } @@ -145,18 +113,32 @@ data class WireColorScheme( private val LightWireColorScheme = WireColorScheme( useDarkSystemBarIcons = true, connectivityBarShouldUseDarkIcons = false, + + // basic colors primary = WireColorPalette.LightBlue500, onPrimary = Color.White, primaryVariant = WireColorPalette.LightBlue50, onPrimaryVariant = WireColorPalette.LightBlue500, inversePrimary = WireColorPalette.DarkBlue500, error = WireColorPalette.LightRed500, onError = Color.White, - errorOutline = WireColorPalette.LightRed200, + errorVariant = WireColorPalette.LightRed200, onErrorVariant = WireColorPalette.LightRed500, warning = WireColorPalette.LightAmber500, onWarning = Color.White, + highlight = WireColorPalette.DarkAmber200, onHighlight = Color.Black, positive = WireColorPalette.LightGreen500, onPositive = Color.White, + positiveVariant = WireColorPalette.LightGreen50, onPositiveVariant = WireColorPalette.LightGreen500, + secondaryText = WireColorPalette.Gray70, + + // background colors background = WireColorPalette.Gray20, onBackground = Color.Black, - backgroundVariant = WireColorPalette.Gray10, onBackgroundVariant = Color.Black, surface = Color.White, onSurface = Color.Black, surfaceVariant = Color.White, onSurfaceVariant = Color.Black, - inverseSurface = WireColorPalette.Gray95, inverseOnSurface = Color.White, + inverseSurface = Color.Black, inverseOnSurface = Color.White, + surfaceBright = Color.White, surfaceDim = WireColorPalette.Gray40, + surfaceContainerLowest = Color.White, + surfaceContainerLow = WireColorPalette.Gray10, + surfaceContainer = WireColorPalette.Gray20, + surfaceContainerHigh = WireColorPalette.Gray30, + surfaceContainerHighest = WireColorPalette.Gray40, + + // buttons primaryButtonEnabled = WireColorPalette.LightBlue500, onPrimaryButtonEnabled = Color.White, primaryButtonDisabled = WireColorPalette.Gray50, onPrimaryButtonDisabled = WireColorPalette.Gray80, primaryButtonSelected = WireColorPalette.LightBlue700, onPrimaryButtonSelected = Color.White, @@ -173,88 +155,22 @@ private val LightWireColorScheme = WireColorScheme( tertiaryButtonSelected = WireColorPalette.LightBlue50, onTertiaryButtonSelected = WireColorPalette.LightBlue500, tertiaryButtonSelectedOutline = WireColorPalette.LightBlue300, tertiaryButtonRipple = Color.Black, - switchEnabledThumb = Color.White, switchDisabledThumb = WireColorPalette.Gray20, - switchEnabledChecked = WireColorPalette.LightGreen500, switchDisabledChecked = WireColorPalette.LightGreen200, - switchEnabledUnchecked = WireColorPalette.Gray70, switchDisabledUnchecked = WireColorPalette.Gray50, - divider = WireColorPalette.Gray20, - dividerPersonalToTeamMigration = WireColorPalette.Gray40, - windowPersonalToTeamMigration = WireColorPalette.Gray100, - secondaryText = WireColorPalette.Gray70, + + // strokes and shadows outline = WireColorPalette.Gray40, - outlineVariant = WireColorPalette.Gray20, + divider = WireColorPalette.Gray20, scrim = WireColorPalette.BlackAlpha55, - labelText = WireColorPalette.Gray80, - badge = WireColorPalette.Gray90, onBadge = Color.White, - highlight = WireColorPalette.DarkAmber200, onHighlight = Color.Black, - uncheckedColor = WireColorPalette.Gray80, - disabledCheckedColor = WireColorPalette.Gray80, - disabledIndeterminateColor = WireColorPalette.Gray80, - disabledUncheckedColor = WireColorPalette.Gray80, - messageErrorBackgroundColor = WireColorPalette.LightRed50, + + // accents groupAvatarColors = listOf( - // Red - WireColorPalette.LightRed300, - WireColorPalette.LightRed500, - WireColorPalette.LightRed700, - // Green - WireColorPalette.LightGreen300, - WireColorPalette.LightGreen500, - WireColorPalette.LightGreen700, - // Blue - WireColorPalette.LightBlue300, - WireColorPalette.LightBlue500, - WireColorPalette.LightBlue700, - // Purple - WireColorPalette.LightPurple300, - WireColorPalette.LightPurple500, - WireColorPalette.LightPurple700, - // Yellow - Amber - WireColorPalette.LightAmber300, - WireColorPalette.LightAmber500, - WireColorPalette.LightAmber700, - // Petrol - WireColorPalette.LightPetrol300, - WireColorPalette.LightPetrol500, - WireColorPalette.LightPetrol700, - // Gray - WireColorPalette.Gray30, - WireColorPalette.Gray50, - WireColorPalette.Gray70, + WireColorPalette.LightRed300, WireColorPalette.LightRed500, WireColorPalette.LightRed700, + WireColorPalette.LightGreen300, WireColorPalette.LightGreen500, WireColorPalette.LightGreen700, + WireColorPalette.LightBlue300, WireColorPalette.LightBlue500, WireColorPalette.LightBlue700, + WireColorPalette.LightPurple300, WireColorPalette.LightPurple500, WireColorPalette.LightPurple700, + WireColorPalette.LightAmber300, WireColorPalette.LightAmber500, WireColorPalette.LightAmber700, + WireColorPalette.LightPetrol300, WireColorPalette.LightPetrol500, WireColorPalette.LightPetrol700, + WireColorPalette.Gray30, WireColorPalette.Gray50, WireColorPalette.Gray70, ), - callingParticipantTileBackgroundColor = WireColorPalette.Gray90, - callingParticipantNameBackground = Color.Black, - callingParticipantNameText = Color.White, - callingParticipantNameConnectingText = WireColorPalette.Gray60, - callingParticipantError = WireColorPalette.DarkRed500, - callingPagerIndicatorBackground = WireColorPalette.Gray40, - callingActiveIndicator = WireColorPalette.LightBlue500, - callingInActiveIndicator = Color.White, - callingInActiveBorderIndicator = WireColorPalette.Gray60, - callingControlButtonActive = Color.Black, - callingControlButtonActiveOutline = Color.Black, - onCallingControlButtonActive = Color.White, - callingControlButtonInactive = Color.White, - callingControlButtonInactiveOutline = WireColorPalette.Gray40, - onCallingControlButtonInactive = WireColorPalette.Gray90, - callingHangupButtonColor = WireColorPalette.LightRed500, - onCallingHangupButtonColor = Color.White, - callingAnswerButtonColor = WireColorPalette.LightGreen500, - onCallingAnswerButtonColor = Color.White, - connectivityBarIssueBackgroundColor = WireColorPalette.LightBlue500, - messageComposerBackgroundColor = Color.White, - messageComposerEditBackgroundColor = WireColorPalette.LightBlue50, - classifiedBannerBackgroundColor = WireColorPalette.LightGreen50, - classifiedBannerForegroundColor = WireColorPalette.LightGreen500, - unclassifiedBannerBackgroundColor = WireColorPalette.LightRed600, - unclassifiedBannerForegroundColor = Color.White, - recordAudioStartColor = WireColorPalette.LightBlue500, - recordAudioStopColor = WireColorPalette.LightRed500, - scrollToBottomButtonColor = WireColorPalette.Gray70, - onScrollToBottomButtonColor = Color.White, - validE2eiStatusColor = WireColorPalette.LightGreen550, - mlsVerificationTextColor = WireColorPalette.DarkGreen700, - createTeamInfoCardBackgroundColor = WireColorPalette.LightBlue50, - createTeamInfoCardBorderColor = WireColorPalette.LightBlue500, wireAccentColors = WireAccentColors { when (it) { Accent.Amber -> WireColorPalette.LightAmber500 @@ -266,47 +182,40 @@ private val LightWireColorScheme = WireColorScheme( Accent.Unknown -> WireColorPalette.LightBlue500 } }, - checkboxTextDisabled = WireColorPalette.Gray70, - sketchColorPalette = listOf( - Color.Black, - Color.White, - WireColorPalette.LightBlue500, - WireColorPalette.LightGreen550, - WireColorPalette.DarkAmber500, - WireColorPalette.LightRed500, - WireColorPalette.Orange, - WireColorPalette.LightPurple600, - WireColorPalette.Brown, - WireColorPalette.Turquoise, - WireColorPalette.DarkBlue500, - WireColorPalette.DarkGreen500, - WireColorPalette.DarkPetrol500, - WireColorPalette.DarkPurple500, - WireColorPalette.DarkRed500, - WireColorPalette.Pink, - WireColorPalette.Chocolate, - WireColorPalette.Gray70, - ) ) // Dark WireColorScheme private val DarkWireColorScheme = WireColorScheme( useDarkSystemBarIcons = false, connectivityBarShouldUseDarkIcons = true, + + // basic colors primary = WireColorPalette.DarkBlue500, onPrimary = Color.Black, primaryVariant = WireColorPalette.DarkBlue800, onPrimaryVariant = WireColorPalette.DarkBlue300, inversePrimary = WireColorPalette.LightBlue500, error = WireColorPalette.DarkRed500, onError = Color.Black, - errorOutline = WireColorPalette.DarkRed800, + errorVariant = WireColorPalette.LightRed900, onErrorVariant = WireColorPalette.DarkRed500, warning = WireColorPalette.DarkAmber500, onWarning = Color.Black, + highlight = WireColorPalette.DarkAmber300, onHighlight = Color.Black, positive = WireColorPalette.DarkGreen500, onPositive = Color.Black, + positiveVariant = WireColorPalette.DarkGreen900, onPositiveVariant = WireColorPalette.DarkGreen500, + secondaryText = WireColorPalette.Gray60, + + // background colors background = WireColorPalette.Gray100, onBackground = Color.White, - backgroundVariant = WireColorPalette.Gray95, onBackgroundVariant = Color.White, surface = WireColorPalette.Gray95, onSurface = Color.White, surfaceVariant = WireColorPalette.Gray90, onSurfaceVariant = Color.White, inverseSurface = Color.White, inverseOnSurface = Color.Black, + surfaceBright = WireColorPalette.Gray70, surfaceDim = WireColorPalette.Gray95, + surfaceContainerLowest = Color.Black, + surfaceContainerLow = WireColorPalette.Gray95, + surfaceContainer = WireColorPalette.Gray90, + surfaceContainerHigh = WireColorPalette.Gray80, + surfaceContainerHighest = WireColorPalette.Gray70, + + // buttons primaryButtonEnabled = WireColorPalette.DarkBlue500, onPrimaryButtonEnabled = Color.Black, - primaryButtonDisabled = WireColorPalette.Gray70, onPrimaryButtonDisabled = Color.Black, + primaryButtonDisabled = WireColorPalette.Gray80, onPrimaryButtonDisabled = WireColorPalette.Gray50, primaryButtonSelected = WireColorPalette.DarkBlue400, onPrimaryButtonSelected = Color.Black, primaryButtonRipple = Color.White, secondaryButtonEnabled = WireColorPalette.Gray90, onSecondaryButtonEnabled = Color.White, @@ -321,88 +230,22 @@ private val DarkWireColorScheme = WireColorScheme( tertiaryButtonSelected = WireColorPalette.DarkBlue50, onTertiaryButtonSelected = WireColorPalette.DarkBlue500, tertiaryButtonSelectedOutline = WireColorPalette.DarkBlue300, tertiaryButtonRipple = Color.White, - switchEnabledThumb = Color.Black, switchDisabledThumb = WireColorPalette.Gray90, - switchEnabledChecked = WireColorPalette.DarkGreen500, switchDisabledChecked = WireColorPalette.DarkGreen200, - switchEnabledUnchecked = WireColorPalette.Gray40, switchDisabledUnchecked = WireColorPalette.Gray60, - divider = WireColorPalette.Gray100, - dividerPersonalToTeamMigration = WireColorPalette.Gray90, - windowPersonalToTeamMigration = WireColorPalette.Gray100, - secondaryText = WireColorPalette.Gray60, + + // strokes and shadows outline = WireColorPalette.Gray90, - outlineVariant = WireColorPalette.Gray100, + divider = WireColorPalette.Gray100, scrim = WireColorPalette.BlackAlpha55, - labelText = WireColorPalette.Gray30, - badge = WireColorPalette.Gray10, onBadge = Color.Black, - highlight = WireColorPalette.DarkAmber300, onHighlight = Color.Black, - uncheckedColor = WireColorPalette.Gray60, - disabledCheckedColor = WireColorPalette.Gray80, - disabledIndeterminateColor = WireColorPalette.Gray80, - disabledUncheckedColor = WireColorPalette.Gray80, - messageErrorBackgroundColor = WireColorPalette.GrayRed900, + + // accents groupAvatarColors = listOf( - // Red - WireColorPalette.DarkRed300, - WireColorPalette.DarkRed500, - WireColorPalette.DarkRed700, - // Green - WireColorPalette.DarkGreen300, - WireColorPalette.DarkGreen500, - WireColorPalette.DarkGreen700, - // Blue - WireColorPalette.DarkBlue300, - WireColorPalette.DarkBlue500, - WireColorPalette.DarkBlue700, - // Purple - WireColorPalette.DarkPurple300, - WireColorPalette.DarkPurple500, - WireColorPalette.DarkPurple700, - // Yellow - Amber - WireColorPalette.DarkAmber300, - WireColorPalette.DarkAmber500, - WireColorPalette.DarkAmber700, - // Petrol - WireColorPalette.DarkPetrol300, - WireColorPalette.DarkPetrol500, - WireColorPalette.DarkPetrol700, - // Gray - WireColorPalette.Gray50, - WireColorPalette.Gray70, - WireColorPalette.Gray90, + WireColorPalette.DarkRed300, WireColorPalette.DarkRed500, WireColorPalette.DarkRed700, + WireColorPalette.DarkGreen300, WireColorPalette.DarkGreen500, WireColorPalette.DarkGreen700, + WireColorPalette.DarkBlue300, WireColorPalette.DarkBlue500, WireColorPalette.DarkBlue700, + WireColorPalette.DarkPurple300, WireColorPalette.DarkPurple500, WireColorPalette.DarkPurple700, + WireColorPalette.DarkAmber300, WireColorPalette.DarkAmber500, WireColorPalette.DarkAmber700, + WireColorPalette.DarkPetrol300, WireColorPalette.DarkPetrol500, WireColorPalette.DarkPetrol700, + WireColorPalette.Gray50, WireColorPalette.Gray70, WireColorPalette.Gray90, ), - callingParticipantTileBackgroundColor = WireColorPalette.Gray90, - callingParticipantNameBackground = Color.Black, - callingParticipantNameText = Color.White, - callingParticipantNameConnectingText = WireColorPalette.Gray60, - callingParticipantError = WireColorPalette.DarkRed500, - callingPagerIndicatorBackground = WireColorPalette.Gray40, - callingActiveIndicator = WireColorPalette.LightBlue500, - callingInActiveIndicator = Color.White, - callingInActiveBorderIndicator = WireColorPalette.Gray60, - callingControlButtonActive = Color.White, - callingControlButtonActiveOutline = Color.White, - onCallingControlButtonActive = Color.Black, - callingControlButtonInactive = WireColorPalette.Gray90, - callingControlButtonInactiveOutline = WireColorPalette.Gray100, - onCallingControlButtonInactive = Color.White, - callingHangupButtonColor = WireColorPalette.DarkRed500, - onCallingHangupButtonColor = Color.Black, - callingAnswerButtonColor = WireColorPalette.DarkGreen500, - onCallingAnswerButtonColor = Color.Black, - connectivityBarIssueBackgroundColor = WireColorPalette.LightBlue500, - messageComposerBackgroundColor = WireColorPalette.Gray100, - messageComposerEditBackgroundColor = WireColorPalette.DarkBlue800, - classifiedBannerBackgroundColor = WireColorPalette.DarkGreen900, - classifiedBannerForegroundColor = WireColorPalette.DarkGreen500, - unclassifiedBannerBackgroundColor = WireColorPalette.DarkRed500, - unclassifiedBannerForegroundColor = Color.Black, - recordAudioStartColor = WireColorPalette.DarkBlue500, - recordAudioStopColor = WireColorPalette.DarkRed500, - scrollToBottomButtonColor = WireColorPalette.Gray60, - onScrollToBottomButtonColor = Color.Black, - validE2eiStatusColor = WireColorPalette.DarkGreen500, - mlsVerificationTextColor = WireColorPalette.DarkGreen700, - createTeamInfoCardBackgroundColor = WireColorPalette.DarkBlue800, - createTeamInfoCardBorderColor = WireColorPalette.LightBlue500, wireAccentColors = WireAccentColors { when (it) { Accent.Amber -> WireColorPalette.DarkAmber500 @@ -414,27 +257,6 @@ private val DarkWireColorScheme = WireColorScheme( Accent.Unknown -> WireColorPalette.DarkBlue500 } }, - checkboxTextDisabled = WireColorPalette.Gray70, - sketchColorPalette = listOf( - Color.Black, - Color.White, - WireColorPalette.LightBlue500, - WireColorPalette.LightGreen550, - WireColorPalette.DarkAmber500, - WireColorPalette.LightRed500, - WireColorPalette.Orange, - WireColorPalette.LightPurple600, - WireColorPalette.Brown, - WireColorPalette.Turquoise, - WireColorPalette.DarkBlue500, - WireColorPalette.DarkGreen500, - WireColorPalette.DarkPetrol500, - WireColorPalette.DarkPurple500, - WireColorPalette.DarkRed500, - WireColorPalette.Pink, - WireColorPalette.Chocolate, - WireColorPalette.Gray70, - ) ) @PackagePrivate diff --git a/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireFixedColorScheme.kt b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireFixedColorScheme.kt new file mode 100644 index 00000000000..04913875863 --- /dev/null +++ b/core/ui-common/src/main/kotlin/com/wire/android/ui/theme/WireFixedColorScheme.kt @@ -0,0 +1,49 @@ +/* + * Wire + * Copyright (C) 2024 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ +package com.wire.android.ui.theme + +import androidx.compose.runtime.Immutable +import androidx.compose.ui.graphics.Color + +@Immutable +class WireFixedColorScheme( + val sketchColorPalette: List, +) + +val DefaultWireFixedColorScheme = WireFixedColorScheme( + sketchColorPalette = listOf( + Color.Black, + Color.White, + WireColorPalette.LightBlue500, + WireColorPalette.LightGreen550, + WireColorPalette.DarkAmber500, + WireColorPalette.LightRed500, + WireColorPalette.Orange, + WireColorPalette.LightPurple600, + WireColorPalette.Brown, + WireColorPalette.Turquoise, + WireColorPalette.DarkBlue500, + WireColorPalette.DarkGreen500, + WireColorPalette.DarkPetrol500, + WireColorPalette.DarkPurple500, + WireColorPalette.DarkRed500, + WireColorPalette.Pink, + WireColorPalette.Chocolate, + WireColorPalette.Gray70, + ) +) diff --git a/features/sketch/src/main/java/com/wire/android/feature/sketch/DrawingToolPicker.kt b/features/sketch/src/main/java/com/wire/android/feature/sketch/DrawingToolPicker.kt index 51956d64a31..6c316066d70 100644 --- a/features/sketch/src/main/java/com/wire/android/feature/sketch/DrawingToolPicker.kt +++ b/features/sketch/src/main/java/com/wire/android/feature/sketch/DrawingToolPicker.kt @@ -59,6 +59,7 @@ import com.wire.android.ui.common.dimensions import com.wire.android.ui.theme.WireColorPalette import com.wire.android.ui.theme.WireTheme import com.wire.android.feature.sketch.util.PreviewMultipleThemes +import com.wire.android.ui.common.fixedColorsScheme @OptIn(ExperimentalLayoutApi::class) @Composable @@ -68,7 +69,7 @@ fun DrawingToolPicker( onColorSelected: (Color) -> Unit, modifier: Modifier = Modifier, ) { - val colorPalette = colorsScheme().sketchColorPalette + val colorPalette = fixedColorsScheme().sketchColorPalette WireModalSheetLayout( modifier = modifier, dragHandle = null,