diff --git a/app/src/main/kotlin/io/element/android/x/MainActivity.kt b/app/src/main/kotlin/io/element/android/x/MainActivity.kt index 2d2b645f3f..2bdf083683 100644 --- a/app/src/main/kotlin/io/element/android/x/MainActivity.kt +++ b/app/src/main/kotlin/io/element/android/x/MainActivity.kt @@ -14,7 +14,6 @@ import androidx.activity.enableEdgeToEdge import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.Modifier @@ -26,6 +25,7 @@ import androidx.lifecycle.repeatOnLifecycle import com.bumble.appyx.core.integration.NodeHost import com.bumble.appyx.core.integrationpoint.NodeActivity import com.bumble.appyx.core.plugin.NodeReadyObserver +import io.element.android.compound.theme.ElementTheme import io.element.android.features.lockscreen.api.LockScreenEntryPoint import io.element.android.features.lockscreen.api.LockScreenLockState import io.element.android.features.lockscreen.api.LockScreenService @@ -61,7 +61,10 @@ class MainActivity : NodeActivity() { @Composable private fun MainContent(appBindings: AppBindings) { val migrationState = appBindings.migrationEntryPoint().present() - ElementThemeApp(appBindings.preferencesStore()) { + ElementThemeApp( + appPreferencesStore = appBindings.preferencesStore(), + enterpriseService = appBindings.enterpriseService(), + ) { CompositionLocalProvider( LocalSnackbarDispatcher provides appBindings.snackbarDispatcher(), LocalUriHandler provides SafeUriHandler(this), @@ -69,8 +72,8 @@ class MainActivity : NodeActivity() { ) { Box( modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.background), + .fillMaxSize() + .background(ElementTheme.colors.bgCanvasDefault), ) { if (migrationState.migrationAction.isSuccess()) { MainNodeHost() diff --git a/app/src/main/kotlin/io/element/android/x/di/AppBindings.kt b/app/src/main/kotlin/io/element/android/x/di/AppBindings.kt index e24fdbb9fb..4aa5d2c267 100644 --- a/app/src/main/kotlin/io/element/android/x/di/AppBindings.kt +++ b/app/src/main/kotlin/io/element/android/x/di/AppBindings.kt @@ -9,6 +9,7 @@ package io.element.android.x.di import com.squareup.anvil.annotations.ContributesTo import io.element.android.features.api.MigrationEntryPoint +import io.element.android.features.enterprise.api.EnterpriseService import io.element.android.features.lockscreen.api.LockScreenEntryPoint import io.element.android.features.lockscreen.api.LockScreenService import io.element.android.features.rageshake.api.reporter.BugReporter @@ -35,4 +36,6 @@ interface AppBindings { fun lockScreenEntryPoint(): LockScreenEntryPoint fun analyticsService(): AnalyticsService + + fun enterpriseService(): EnterpriseService } diff --git a/enterprise b/enterprise index b4f0427e35..0c028db8a4 160000 --- a/enterprise +++ b/enterprise @@ -1 +1 @@ -Subproject commit b4f0427e3595049d39846aabcdc06e818f2e96ea +Subproject commit 0c028db8a48118433c7e11737080a6a01fb90f69 diff --git a/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt b/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt index f1781f1b08..3e8b9d98f9 100644 --- a/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt +++ b/features/analytics/impl/src/main/kotlin/io/element/android/features/analytics/impl/AnalyticsOptInView.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.systemBarsPadding -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.BiasAlignment @@ -111,7 +110,7 @@ private fun AnalyticsOptInHeader( .padding(8.dp), style = ElementTheme.typography.fontBodyMdRegular .copy( - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, textAlign = TextAlign.Center, ) ) diff --git a/features/call/impl/build.gradle.kts b/features/call/impl/build.gradle.kts index 70e0ee631c..7a291a7423 100644 --- a/features/call/impl/build.gradle.kts +++ b/features/call/impl/build.gradle.kts @@ -29,6 +29,7 @@ setupAnvil() dependencies { implementation(projects.appconfig) + implementation(projects.features.enterprise.api) implementation(projects.libraries.architecture) implementation(projects.libraries.core) implementation(projects.libraries.designsystem) diff --git a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/ElementCallActivity.kt b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/ElementCallActivity.kt index 65859da60e..af7323eea4 100644 --- a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/ElementCallActivity.kt +++ b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/ElementCallActivity.kt @@ -44,6 +44,7 @@ import io.element.android.features.call.impl.pip.PictureInPictureState import io.element.android.features.call.impl.pip.PipView import io.element.android.features.call.impl.services.CallForegroundService import io.element.android.features.call.impl.utils.CallIntentDataParser +import io.element.android.features.enterprise.api.EnterpriseService import io.element.android.libraries.architecture.Presenter import io.element.android.libraries.architecture.bindings import io.element.android.libraries.core.log.logger.LoggerTag @@ -61,6 +62,7 @@ class ElementCallActivity : @Inject lateinit var callIntentDataParser: CallIntentDataParser @Inject lateinit var presenterFactory: CallScreenPresenter.Factory @Inject lateinit var appPreferencesStore: AppPreferencesStore + @Inject lateinit var enterpriseService: EnterpriseService @Inject lateinit var pictureInPicturePresenter: PictureInPicturePresenter private lateinit var presenter: Presenter @@ -109,7 +111,10 @@ class ElementCallActivity : setContent { val pipState = pictureInPicturePresenter.present() ListenToAndroidEvents(pipState) - ElementThemeApp(appPreferencesStore) { + ElementThemeApp( + appPreferencesStore = appPreferencesStore, + enterpriseService = enterpriseService, + ) { val state = presenter.present() eventSink = state.eventSink LaunchedEffect(state.isCallActive, state.isInWidgetMode) { diff --git a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/IncomingCallActivity.kt b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/IncomingCallActivity.kt index 7dd4b56057..445e3c4f9a 100644 --- a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/IncomingCallActivity.kt +++ b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/ui/IncomingCallActivity.kt @@ -19,6 +19,7 @@ import io.element.android.features.call.impl.di.CallBindings import io.element.android.features.call.impl.notifications.CallNotificationData import io.element.android.features.call.impl.utils.ActiveCallManager import io.element.android.features.call.impl.utils.CallState +import io.element.android.features.enterprise.api.EnterpriseService import io.element.android.libraries.architecture.bindings import io.element.android.libraries.designsystem.theme.ElementThemeApp import io.element.android.libraries.preferences.api.store.AppPreferencesStore @@ -47,6 +48,9 @@ class IncomingCallActivity : AppCompatActivity() { @Inject lateinit var appPreferencesStore: AppPreferencesStore + @Inject + lateinit var enterpriseService: EnterpriseService + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -64,7 +68,10 @@ class IncomingCallActivity : AppCompatActivity() { val notificationData = intent?.let { IntentCompat.getParcelableExtra(it, EXTRA_NOTIFICATION_DATA, CallNotificationData::class.java) } if (notificationData != null) { setContent { - ElementThemeApp(appPreferencesStore) { + ElementThemeApp( + appPreferencesStore = appPreferencesStore, + enterpriseService = enterpriseService, + ) { IncomingCallScreen( notificationData = notificationData, onAnswer = ::onAnswer, diff --git a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt index af3aa3b9fb..7eb2f49511 100644 --- a/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt +++ b/features/createroom/impl/src/main/kotlin/io/element/android/features/createroom/impl/root/CreateRoomRootView.kt @@ -19,7 +19,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -211,7 +210,7 @@ private fun CreateRoomActionButton( ) { Icon( modifier = Modifier.size(24.dp), - tint = MaterialTheme.colorScheme.secondary, + tint = ElementTheme.colors.iconSecondary, resourceId = iconRes, contentDescription = null, ) diff --git a/features/enterprise/api/build.gradle.kts b/features/enterprise/api/build.gradle.kts index 91c54bc42c..9f63ab2cf1 100644 --- a/features/enterprise/api/build.gradle.kts +++ b/features/enterprise/api/build.gradle.kts @@ -13,6 +13,7 @@ android { } dependencies { + implementation(libs.compound) implementation(projects.libraries.architecture) implementation(projects.libraries.matrix.api) } diff --git a/features/enterprise/api/src/main/kotlin/io/element/android/features/enterprise/api/EnterpriseService.kt b/features/enterprise/api/src/main/kotlin/io/element/android/features/enterprise/api/EnterpriseService.kt index 2ac334653e..305aae2243 100644 --- a/features/enterprise/api/src/main/kotlin/io/element/android/features/enterprise/api/EnterpriseService.kt +++ b/features/enterprise/api/src/main/kotlin/io/element/android/features/enterprise/api/EnterpriseService.kt @@ -7,9 +7,13 @@ package io.element.android.features.enterprise.api +import io.element.android.compound.tokens.generated.SemanticColors import io.element.android.libraries.matrix.api.core.SessionId interface EnterpriseService { val isEnterpriseBuild: Boolean suspend fun isEnterpriseUser(sessionId: SessionId): Boolean + + fun semanticColorsLight(): SemanticColors + fun semanticColorsDark(): SemanticColors } diff --git a/features/enterprise/impl/build.gradle.kts b/features/enterprise/impl/build.gradle.kts index 6beea5b83a..642b2fef40 100644 --- a/features/enterprise/impl/build.gradle.kts +++ b/features/enterprise/impl/build.gradle.kts @@ -17,6 +17,7 @@ android { setupAnvil() dependencies { + implementation(libs.compound) implementation(projects.anvilannotations) api(projects.features.enterprise.api) implementation(projects.libraries.architecture) diff --git a/features/enterprise/impl/src/main/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseService.kt b/features/enterprise/impl/src/main/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseService.kt index c77c7377d8..1a18ddbee3 100644 --- a/features/enterprise/impl/src/main/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseService.kt +++ b/features/enterprise/impl/src/main/kotlin/io/element/android/features/enterprise/impl/DefaultEnterpriseService.kt @@ -8,6 +8,9 @@ package io.element.android.features.enterprise.impl import com.squareup.anvil.annotations.ContributesBinding +import io.element.android.compound.tokens.generated.SemanticColors +import io.element.android.compound.tokens.generated.compoundColorsDark +import io.element.android.compound.tokens.generated.compoundColorsLight import io.element.android.features.enterprise.api.EnterpriseService import io.element.android.libraries.di.AppScope import io.element.android.libraries.matrix.api.core.SessionId @@ -18,4 +21,8 @@ class DefaultEnterpriseService @Inject constructor() : EnterpriseService { override val isEnterpriseBuild = false override suspend fun isEnterpriseUser(sessionId: SessionId) = false + + override fun semanticColorsLight(): SemanticColors = compoundColorsLight + + override fun semanticColorsDark(): SemanticColors = compoundColorsDark } diff --git a/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt b/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt index 49c7b5742b..88a0c15ecf 100644 --- a/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt +++ b/features/joinroom/impl/src/main/kotlin/io/element/android/features/joinroom/impl/JoinRoomView.kt @@ -24,7 +24,6 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -308,7 +307,7 @@ private fun JoinRoomContent( Text( text = stringResource(id = CommonStrings.error_unknown), textAlign = TextAlign.Center, - color = MaterialTheme.colorScheme.error, + color = ElementTheme.colors.textCriticalPrimary, ) }, ) @@ -380,13 +379,13 @@ private fun DefaultLoadedContent( text = stringResource(R.string.screen_join_room_space_not_supported_title), textAlign = TextAlign.Center, style = ElementTheme.typography.fontBodyLgMedium, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) Text( text = stringResource(R.string.screen_join_room_space_not_supported_description, applicationName), textAlign = TextAlign.Center, style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, ) } else if (contentState.joinAuthorisationStatus is JoinAuthorisationStatus.CanKnock) { Spacer(modifier = Modifier.height(24.dp)) diff --git a/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/banner/KnockRequestsBannerView.kt b/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/banner/KnockRequestsBannerView.kt index b62b886afa..09ac8bff59 100644 --- a/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/banner/KnockRequestsBannerView.kt +++ b/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/banner/KnockRequestsBannerView.kt @@ -128,14 +128,14 @@ private fun KnockRequestsBannerContent( Text( text = state.formattedTitle(), style = ElementTheme.typography.fontBodyMdMedium, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, textAlign = TextAlign.Start, ) if (state.subtitle != null) { Text( text = state.subtitle, style = ElementTheme.typography.fontBodySmRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, textAlign = TextAlign.Start, ) } diff --git a/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/list/KnockRequestsListView.kt b/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/list/KnockRequestsListView.kt index 800d68c273..3b90fe7e11 100644 --- a/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/list/KnockRequestsListView.kt +++ b/features/knockrequests/impl/src/main/kotlin/io/element/android/features/knockrequests/impl/list/KnockRequestsListView.kt @@ -27,7 +27,6 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf @@ -331,7 +330,7 @@ private fun KnockRequestItem( text = knockRequest.getBestName(), maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, style = ElementTheme.typography.fontBodyLgMedium, ) val formattedDate = knockRequest.formattedDate @@ -339,7 +338,7 @@ private fun KnockRequestItem( Spacer(modifier = Modifier.width(8.dp)) Text( text = formattedDate, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodySmRegular, ) } @@ -348,7 +347,7 @@ private fun KnockRequestItem( if (!knockRequest.displayName.isNullOrEmpty()) { Text( text = knockRequest.userId.value, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodyMdRegular, diff --git a/features/lockscreen/impl/build.gradle.kts b/features/lockscreen/impl/build.gradle.kts index 6e8784b72c..808abf9150 100644 --- a/features/lockscreen/impl/build.gradle.kts +++ b/features/lockscreen/impl/build.gradle.kts @@ -21,6 +21,7 @@ setupAnvil() dependencies { api(projects.features.lockscreen.api) implementation(projects.appconfig) + implementation(projects.features.enterprise.api) implementation(projects.libraries.core) implementation(projects.libraries.architecture) implementation(projects.libraries.matrix.api) diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockView.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockView.kt index 3923ced61d..f9665b52dd 100644 --- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockView.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/PinUnlockView.kt @@ -27,7 +27,6 @@ import androidx.compose.foundation.layout.systemBarsPadding import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Lock -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -316,7 +315,7 @@ private fun PinUnlockHeader( .fillMaxWidth(), textAlign = TextAlign.Center, style = ElementTheme.typography.fontHeadingMdBold, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) Spacer(Modifier.height(8.dp)) val remainingAttempts = state.remainingAttempts.dataOrNull() @@ -330,9 +329,9 @@ private fun PinUnlockHeader( "" } val subtitleColor = if (state.showWrongPinTitle) { - MaterialTheme.colorScheme.error + ElementTheme.colors.textCriticalPrimary } else { - MaterialTheme.colorScheme.secondary + ElementTheme.colors.textSecondary } Text( text = subtitle, diff --git a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/activity/PinUnlockActivity.kt b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/activity/PinUnlockActivity.kt index e308865315..f89d25dd76 100644 --- a/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/activity/PinUnlockActivity.kt +++ b/features/lockscreen/impl/src/main/kotlin/io/element/android/features/lockscreen/impl/unlock/activity/PinUnlockActivity.kt @@ -16,6 +16,7 @@ import androidx.activity.enableEdgeToEdge import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.lifecycleScope import io.element.android.compound.theme.ElementTheme +import io.element.android.features.enterprise.api.EnterpriseService import io.element.android.features.lockscreen.api.LockScreenLockState import io.element.android.features.lockscreen.api.LockScreenService import io.element.android.features.lockscreen.impl.unlock.PinUnlockPresenter @@ -38,13 +39,17 @@ class PinUnlockActivity : AppCompatActivity() { @Inject lateinit var presenter: PinUnlockPresenter @Inject lateinit var lockScreenService: LockScreenService @Inject lateinit var appPreferencesStore: AppPreferencesStore + @Inject lateinit var enterpriseService: EnterpriseService override fun onCreate(savedInstanceState: Bundle?) { enableEdgeToEdge() super.onCreate(savedInstanceState) bindings().inject(this) setContent { - ElementThemeApp(appPreferencesStore) { + ElementThemeApp( + appPreferencesStore = appPreferencesStore, + enterpriseService = enterpriseService, + ) { val state = presenter.present() val isDark = ElementTheme.isLightTheme.not() PinUnlockView( diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt index fc2f518873..e8b931ffe9 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/accountprovider/AccountProviderView.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -68,7 +67,7 @@ fun AccountProviderView( RoundedIconAtom( size = RoundedIconAtomSize.Medium, imageVector = CompoundIcons.Search(), - tint = MaterialTheme.colorScheme.primary, + tint = ElementTheme.colors.iconPrimary, ) } Text( @@ -77,7 +76,7 @@ fun AccountProviderView( .weight(1f), text = item.title, style = ElementTheme.typography.fontBodyLgMedium, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) if (item.isPublic) { Icon( @@ -96,7 +95,7 @@ fun AccountProviderView( .padding(start = 46.dp, bottom = 12.dp, end = 26.dp), text = item.subtitle, style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, ) } } diff --git a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/scan/QrCodeScanView.kt b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/scan/QrCodeScanView.kt index 7f7df3e3b2..b319781962 100644 --- a/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/scan/QrCodeScanView.kt +++ b/features/login/impl/src/main/kotlin/io/element/android/features/login/impl/screens/qrcode/scan/QrCodeScanView.kt @@ -22,7 +22,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.progressSemantics -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -138,7 +137,7 @@ private fun ColumnScope.Buttons( ) { Icon( imageVector = CompoundIcons.Error(), - tint = MaterialTheme.colorScheme.error, + tint = ElementTheme.colors.iconCriticalPrimary, contentDescription = null, modifier = Modifier.size(24.dp) ) @@ -151,7 +150,7 @@ private fun ColumnScope.Buttons( else -> stringResource(R.string.screen_qr_code_login_invalid_scan_state_subtitle) }, textAlign = TextAlign.Center, - color = MaterialTheme.colorScheme.error, + color = ElementTheme.colors.textCriticalPrimary, style = ElementTheme.typography.fontBodySmMedium, ) } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt index 381d2dca41..747fc847cc 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesView.kt @@ -196,8 +196,8 @@ fun MessagesView( MessagesViewContent( state = state, modifier = Modifier - .padding(padding) - .consumeWindowInsets(padding), + .padding(padding) + .consumeWindowInsets(padding), onContentClick = ::onContentClick, onMessageLongClick = ::onMessageLongClick, onUserDataClick = { hidingKeyboard { onUserDataClick(it) } }, @@ -290,9 +290,9 @@ private fun MessagesViewContent( ) { Box( modifier = modifier - .fillMaxSize() - .navigationBarsPadding() - .imePadding(), + .fillMaxSize() + .navigationBarsPadding() + .imePadding(), ) { AttachmentsBottomSheet( state = state.composerState, @@ -402,13 +402,13 @@ private fun MessagesViewComposerBottomSheetContents( Column(modifier = Modifier.fillMaxWidth()) { SuggestionsPickerView( modifier = Modifier - .heightIn(max = 230.dp) - // Consume all scrolling, preventing the bottom sheet from being dragged when interacting with the list of suggestions - .nestedScroll(object : NestedScrollConnection { - override fun onPostScroll(consumed: Offset, available: Offset, source: NestedScrollSource): Offset { - return available - } - }), + .heightIn(max = 230.dp) + // Consume all scrolling, preventing the bottom sheet from being dragged when interacting with the list of suggestions + .nestedScroll(object : NestedScrollConnection { + override fun onPostScroll(consumed: Offset, available: Offset, source: NestedScrollSource): Offset { + return available + } + }), roomId = state.roomId, roomName = state.roomName.dataOrNull(), roomAvatarData = state.roomAvatar.dataOrNull(), @@ -456,8 +456,8 @@ private fun MessagesViewTopBar( title = { val roundedCornerShape = RoundedCornerShape(8.dp) val titleModifier = Modifier - .clip(roundedCornerShape) - .clickable { onRoomDetailsClick() } + .clip(roundedCornerShape) + .clickable { onRoomDetailsClick() } if (roomName != null && roomAvatar != null) { RoomAvatarAndNameRow( roomName = roomName, @@ -512,15 +512,15 @@ private fun RoomAvatarAndNameRow( private fun CantSendMessageBanner() { Row( modifier = Modifier - .fillMaxWidth() - .background(MaterialTheme.colorScheme.secondary) - .padding(16.dp), + .fillMaxWidth() + .background(ElementTheme.colors.bgSubtleSecondary) + .padding(16.dp), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Center ) { Text( text = stringResource(id = R.string.screen_room_timeline_no_permission_to_post), - color = MaterialTheme.colorScheme.onSecondary, + color = ElementTheme.colors.textSecondary, style = MaterialTheme.typography.bodyMedium, textAlign = TextAlign.Center, fontStyle = FontStyle.Italic, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt index 7a19468e93..3e83176288 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/actionlist/ActionListView.kt @@ -27,7 +27,6 @@ import androidx.compose.foundation.lazy.items import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ListItemDefaults -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.material3.ripple import androidx.compose.runtime.Composable @@ -253,7 +252,7 @@ private fun MessageSummary( ) { val content: @Composable () -> Unit val icon: @Composable () -> Unit = { Avatar(avatarData = event.senderAvatar.copy(size = AvatarSize.MessageActionSender)) } - val contentStyle = ElementTheme.typography.fontBodyMdRegular.copy(color = MaterialTheme.colorScheme.secondary) + val contentStyle = ElementTheme.typography.fontBodyMdRegular.copy(color = ElementTheme.colors.textSecondary) @Composable fun ContentForBody(body: String) { @@ -316,7 +315,7 @@ private fun MessageSummary( Text( text = sentTimeFull, style = ElementTheme.typography.fontBodyXsRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, textAlign = TextAlign.End, ) } @@ -358,7 +357,7 @@ private fun EmojiReactionsRow( Icon( imageVector = CompoundIcons.ReactionAdd(), contentDescription = stringResource(id = CommonStrings.a11y_react_with_other_emojis), - tint = MaterialTheme.colorScheme.secondary, + tint = ElementTheme.colors.iconSecondary, modifier = Modifier .size(24.dp) .clickable( diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt index 2e4bd92289..dcbc0695b2 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/pinned/banner/PinnedMessagesBannerView.kt @@ -108,7 +108,7 @@ private fun PinnedMessagesBannerRow( Icon( imageVector = CompoundIcons.PinSolid(), contentDescription = null, - tint = ElementTheme.materialColors.secondary, + tint = ElementTheme.colors.iconSecondary, modifier = Modifier .padding(horizontal = 10.dp) .size(20.dp) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt index 49334574cd..d2c5d05e1a 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/report/ReportMessageView.kt @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Switch import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -113,7 +112,7 @@ fun ReportMessageView( Text( text = stringResource(R.string.screen_report_content_block_user_hint), style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, ) } Switch( diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessagesReactionButton.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessagesReactionButton.kt index f2db4e6efb..98fc9d201b 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessagesReactionButton.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/MessagesReactionButton.kt @@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.CornerSize import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.ui.Alignment @@ -76,7 +75,7 @@ fun MessagesReactionButton( .background(Color.Transparent) // Outer border, same colour as background .border( - BorderStroke(2.dp, MaterialTheme.colorScheme.background), + BorderStroke(2.dp, ElementTheme.colors.bgCanvasDefault), shape = RoundedCornerShape(corner = CornerSize(14.dp)) ) .padding(vertical = 2.dp, horizontal = 2.dp) @@ -122,7 +121,7 @@ private fun TextContent( .height(REACTION_EMOJI_LINE_HEIGHT.toDp()), text = text, style = ElementTheme.typography.fontBodyMdRegular, - color = ElementTheme.materialColors.primary + color = ElementTheme.colors.textPrimary ) @Composable @@ -131,7 +130,7 @@ private fun IconContent( ) = Icon( resourceId = resourceId, contentDescription = stringResource(id = R.string.screen_room_timeline_add_reaction), - tint = ElementTheme.materialColors.secondary, + tint = ElementTheme.colors.iconSecondary, modifier = Modifier .size(ADD_EMOJI_SIZE) ) @@ -164,7 +163,7 @@ private fun ReactionContent( Spacer(modifier = Modifier.width(4.dp)) Text( text = reaction.count.toString(), - color = if (reaction.isHighlighted) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.secondary, + color = if (reaction.isHighlighted) ElementTheme.colors.textPrimary else ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodyMdRegular, ) } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineEventTimestampView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineEventTimestampView.kt index 85b6181050..119bb0977a 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineEventTimestampView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineEventTimestampView.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -45,7 +44,7 @@ fun TimelineEventTimestampView( val hasError = event.localSendState is LocalEventSendState.Failed val hasEncryptionCritical = event.messageShield?.isCritical.orFalse() val isMessageEdited = event.content.isEdited() - val tint = if (hasError || hasEncryptionCritical) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.secondary + val tint = if (hasError || hasEncryptionCritical) ElementTheme.colors.textCriticalPrimary else ElementTheme.colors.textSecondary Row( modifier = Modifier .padding(PaddingValues(start = TimelineEventTimestampViewDefaults.spacing)) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt index 106d4eb532..33cf3cdfcf 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/TimelineItemRow.kt @@ -169,7 +169,7 @@ private fun Modifier.focusedEvent( val highlightedLineColor = ElementTheme.colors.textActionAccent val gradientColors = listOf( ElementTheme.colors.highlightedMessageBackgroundColor, - ElementTheme.materialColors.background + ElementTheme.colors.bgCanvasDefault, ) val verticalOffset = focusedEventOffset.toPx() val verticalRatio = 0.7f diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAttachmentView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAttachmentView.kt index a2b55f00e5..dc40fd77fa 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAttachmentView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAttachmentView.kt @@ -77,7 +77,7 @@ private fun TimelineItemAttachmentHeaderView( modifier = Modifier .size(iconSize) .clip(CircleShape) - .background(ElementTheme.materialColors.background), + .background(ElementTheme.colors.bgCanvasDefault), contentAlignment = Alignment.Center, ) { icon() @@ -86,14 +86,14 @@ private fun TimelineItemAttachmentHeaderView( Column { Text( text = filename, - color = ElementTheme.materialColors.primary, + color = ElementTheme.colors.textPrimary, maxLines = 2, style = ElementTheme.typography.fontBodyLgRegular, overflow = TextOverflow.Ellipsis ) Text( text = fileExtensionAndSize, - color = ElementTheme.materialColors.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodySmRegular, maxLines = 1, overflow = TextOverflow.Ellipsis, @@ -119,7 +119,7 @@ private fun TimelineItemAttachmentCaptionView( Text( modifier = modifier, text = caption, - color = ElementTheme.materialColors.primary, + color = ElementTheme.colors.textPrimary, style = ElementTheme.typography.fontBodyLgRegular, onTextLayout = ContentAvoidingLayout.measureLastTextLine( onContentLayoutChange = onContentLayoutChange, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAudioView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAudioView.kt index 6b28d5922b..d325b6bec5 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAudioView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemAudioView.kt @@ -38,7 +38,7 @@ fun TimelineItemAudioView( Icon( imageVector = Icons.Outlined.GraphicEq, contentDescription = null, - tint = ElementTheme.materialColors.primary, + tint = ElementTheme.colors.iconPrimary, modifier = Modifier .size(16.dp), ) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemFileView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemFileView.kt index 91260ec8aa..06e0ea6616 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemFileView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemFileView.kt @@ -38,7 +38,7 @@ fun TimelineItemFileView( Icon( resourceId = CompoundDrawables.ic_compound_attachment, contentDescription = null, - tint = ElementTheme.materialColors.primary, + tint = ElementTheme.colors.iconPrimary, modifier = Modifier .size(16.dp) .rotate(-45f), diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemInformativeView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemInformativeView.kt index 7343846dfe..74594210b0 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemInformativeView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemInformativeView.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -53,7 +52,7 @@ fun TimelineItemInformativeView( ) { Icon( resourceId = iconResourceId, - tint = MaterialTheme.colorScheme.secondary, + tint = ElementTheme.colors.iconSecondary, contentDescription = iconDescription, modifier = Modifier.size(16.dp) ) @@ -61,7 +60,7 @@ fun TimelineItemInformativeView( Spacer(modifier = Modifier.width(4.dp)) Text( fontStyle = FontStyle.Italic, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodyMdRegular, text = text ) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemStateView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemStateView.kt index 536c5374b5..334a7463f7 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemStateView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemStateView.kt @@ -7,7 +7,6 @@ package io.element.android.features.messages.impl.timeline.components.event -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign @@ -25,7 +24,7 @@ fun TimelineItemStateView( ) { Text( modifier = modifier, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodyMdRegular, text = content.body, textAlign = TextAlign.Center, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemVoiceView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemVoiceView.kt index 17785cd97c..1d357bdd2f 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemVoiceView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/event/TimelineItemVoiceView.kt @@ -91,7 +91,7 @@ fun TimelineItemVoiceView( Spacer(Modifier.width(8.dp)) Text( text = state.time, - color = ElementTheme.materialColors.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodySmMedium, maxLines = 1, overflow = TextOverflow.Ellipsis, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt index a11b36f58f..0a8662eab4 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/group/GroupHeaderView.kt @@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment @@ -67,7 +66,7 @@ fun GroupHeaderView( ) { Text( text = text, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodyMdRegular, ) val rotation: Float by animateFloatAsState( @@ -82,7 +81,7 @@ fun GroupHeaderView( modifier = Modifier.rotate(rotation), imageVector = CompoundIcons.ChevronRight(), contentDescription = null, - tint = MaterialTheme.colorScheme.secondary + tint = ElementTheme.colors.iconSecondary ) } } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt index b4b02ca45d..ae9ea9fd5d 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt @@ -172,7 +172,7 @@ private fun AggregatedReactionButton( val textColor = if (isHighlighted) { MaterialTheme.colorScheme.inversePrimary } else { - MaterialTheme.colorScheme.primary + ElementTheme.colors.textPrimary } val roundedCornerShape = RoundedCornerShape(corner = CornerSize(percent = 50)) @@ -250,12 +250,12 @@ private fun SenderRow( text = name, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, style = ElementTheme.typography.fontBodyMdRegular, ) Text( text = sentTime, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodySmRegular, @@ -263,7 +263,7 @@ private fun SenderRow( } Text( text = userId, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodySmRegular, diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/TimelineItemReadReceiptView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/TimelineItemReadReceiptView.kt index 3e11e1e0ae..701dd93fc7 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/TimelineItemReadReceiptView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/receipt/TimelineItemReadReceiptView.kt @@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -131,7 +130,7 @@ private fun ReadReceiptsAvatars( ) { val avatarSize = AvatarSize.TimelineReadReceipt.dp val avatarStrokeSize = 1.dp - val avatarStrokeColor = MaterialTheme.colorScheme.background + val avatarStrokeColor = ElementTheme.colors.bgCanvasDefault val receiptDescription = computeReceiptDescription(receipts) Row( modifier = modifier diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemDaySeparatorView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemDaySeparatorView.kt index 86dce5349f..2e0c874535 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemDaySeparatorView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemDaySeparatorView.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -39,7 +38,7 @@ internal fun TimelineItemDaySeparatorView( Text( text = model.formattedDate, style = ElementTheme.typography.fontBodyMdMedium, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) } } diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemRoomBeginningView.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemRoomBeginningView.kt index f6a8c3821e..645f36602c 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemRoomBeginningView.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/virtual/TimelineItemRoomBeginningView.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -41,7 +40,7 @@ fun TimelineItemRoomBeginningView( stringResource(id = R.string.screen_room_timeline_beginning_of_room, roomName) } Text( - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodyMdRegular, text = text, textAlign = TextAlign.Center, diff --git a/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/Indicator.kt b/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/Indicator.kt index 992e9bf53c..95c46d3fd0 100644 --- a/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/Indicator.kt +++ b/features/networkmonitor/api/src/main/kotlin/io/element/android/features/networkmonitor/api/ui/Indicator.kt @@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.width -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -25,6 +24,8 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons +import io.element.android.libraries.designsystem.preview.ElementPreview +import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.text.toDp import io.element.android.libraries.designsystem.theme.components.Icon import io.element.android.libraries.designsystem.theme.components.Text @@ -37,24 +38,29 @@ internal fun Indicator( Row( modifier .fillMaxWidth() - .background(MaterialTheme.colorScheme.secondaryContainer) + .background(ElementTheme.colors.bgSubtlePrimary) .statusBarsPadding() .padding(vertical = 6.dp), horizontalArrangement = Arrangement.Center, verticalAlignment = Alignment.CenterVertically, ) { - val tint = MaterialTheme.colorScheme.primary Icon( imageVector = CompoundIcons.Offline(), contentDescription = null, - tint = tint, + tint = ElementTheme.colors.iconPrimary, modifier = Modifier.size(16.sp.toDp()), ) Spacer(modifier = Modifier.width(8.dp)) Text( text = stringResource(CommonStrings.common_offline), style = ElementTheme.typography.fontBodyMdMedium, - color = tint, + color = ElementTheme.colors.textPrimary, ) } } + +@PreviewsDayNight +@Composable +internal fun IndicatorPreview() = ElementPreview { + Indicator() +} diff --git a/features/onboarding/impl/src/main/kotlin/io/element/android/features/onboarding/impl/OnBoardingView.kt b/features/onboarding/impl/src/main/kotlin/io/element/android/features/onboarding/impl/OnBoardingView.kt index 2d84a618fc..6e3878c4d2 100644 --- a/features/onboarding/impl/src/main/kotlin/io/element/android/features/onboarding/impl/OnBoardingView.kt +++ b/features/onboarding/impl/src/main/kotlin/io/element/android/features/onboarding/impl/OnBoardingView.kt @@ -103,14 +103,14 @@ private fun OnBoardingContent(state: OnBoardingState) { ) { Text( text = stringResource(id = R.string.screen_onboarding_welcome_title), - color = ElementTheme.materialColors.primary, + color = ElementTheme.colors.textPrimary, style = ElementTheme.typography.fontHeadingLgBold, textAlign = TextAlign.Center ) Spacer(modifier = Modifier.height(8.dp)) Text( text = stringResource(id = R.string.screen_onboarding_welcome_message, state.productionApplicationName), - color = ElementTheme.materialColors.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodyLgRegular.copy(fontSize = 17.sp), textAlign = TextAlign.Center ) diff --git a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/history/PollHistoryView.kt b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/history/PollHistoryView.kt index be517fa80d..0ad8f8fe84 100644 --- a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/history/PollHistoryView.kt +++ b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/history/PollHistoryView.kt @@ -24,7 +24,6 @@ import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.rememberPagerState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.SingleChoiceSegmentedButtonRow import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -236,7 +235,7 @@ private fun PollHistoryItemRow( Column(modifier = Modifier.padding(16.dp)) { Text( text = pollHistoryItem.formattedDate, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodySmRegular, ) Spacer(modifier = Modifier.height(4.dp)) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt index 75d260d6a3..236d659f33 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt @@ -262,7 +262,7 @@ private fun ColumnScope.Footer( textAlign = TextAlign.Center, text = text, style = ElementTheme.typography.fontBodySmRegular, - color = ElementTheme.materialColors.secondary, + color = ElementTheme.colors.textSecondary, ) } diff --git a/features/roomaliasresolver/impl/src/main/kotlin/io/element/android/features/roomaliasresolver/impl/RoomAliasResolverView.kt b/features/roomaliasresolver/impl/src/main/kotlin/io/element/android/features/roomaliasresolver/impl/RoomAliasResolverView.kt index f36fa80819..9256e39bfe 100644 --- a/features/roomaliasresolver/impl/src/main/kotlin/io/element/android/features/roomaliasresolver/impl/RoomAliasResolverView.kt +++ b/features/roomaliasresolver/impl/src/main/kotlin/io/element/android/features/roomaliasresolver/impl/RoomAliasResolverView.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -25,6 +24,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.architecture.AsyncData import io.element.android.libraries.designsystem.atomic.atoms.PlaceholderAtom import io.element.android.libraries.designsystem.atomic.atoms.RoomPreviewTitleAtom @@ -127,7 +127,7 @@ private fun RoomAliasResolverContent( Text( text = stringResource(id = R.string.screen_room_alias_resolver_resolve_alias_failure), textAlign = TextAlign.Center, - color = MaterialTheme.colorScheme.error, + color = ElementTheme.colors.textCriticalPrimary, ) } }, diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index e35de9f5ec..c702d74f04 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -424,7 +424,7 @@ private fun TitleAndSubtitle( Text( text = subtitle, style = ElementTheme.typography.fontBodyLgRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, textAlign = TextAlign.Center, ) } diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt index 5c17b93b8c..69061c2000 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/members/RoomMemberListView.kt @@ -26,7 +26,6 @@ import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.SingleChoiceSegmentedButtonRow import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect @@ -278,7 +277,7 @@ private fun LazyListScope.roomMemberListSection( modifier = Modifier.padding(horizontal = 16.dp, vertical = 12.dp), text = it(), style = ElementTheme.typography.fontBodyLgRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, ) } } diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsView.kt index 1eda6dc582..a94f605059 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/notificationsettings/RoomNotificationSettingsView.kt @@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color @@ -111,7 +110,7 @@ private fun RoomSpecificNotificationSettingsView( .padding(start = 16.dp, bottom = 16.dp, end = 16.dp), style = ElementTheme.typography.fontBodyMdRegular .copy( - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, ) ) if (state.defaultRoomNotificationMode != null) { diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/rolesandpermissions/changeroles/ChangeRolesView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/rolesandpermissions/changeroles/ChangeRolesView.kt index 4c5a5e9b6b..acd4c28483 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/rolesandpermissions/changeroles/ChangeRolesView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/rolesandpermissions/changeroles/ChangeRolesView.kt @@ -29,7 +29,6 @@ import androidx.compose.foundation.lazy.LazyListState import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -356,7 +355,7 @@ private fun MemberRow( text = name, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, style = ElementTheme.typography.fontBodyLgRegular, ) // Invitation pending marker @@ -365,7 +364,7 @@ private fun MemberRow( modifier = Modifier.padding(start = 8.dp), text = stringResource(id = R.string.screen_room_member_list_pending_header_title), style = ElementTheme.typography.fontBodySmRegular.copy(fontStyle = FontStyle.Italic), - color = MaterialTheme.colorScheme.secondary + color = ElementTheme.colors.textSecondary ) } } @@ -373,7 +372,7 @@ private fun MemberRow( userId?.let { Text( text = userId, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodySmRegular, diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListView.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListView.kt index d40546b5dd..668ce06255 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListView.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListView.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.rememberTopAppBarState import androidx.compose.runtime.Composable @@ -22,6 +21,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewParameter +import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.features.leaveroom.api.LeaveRoomView import io.element.android.features.networkmonitor.api.ui.ConnectivityIndicatorContainer @@ -90,7 +90,7 @@ fun RoomListView( .statusBarsPadding() .padding(top = topPadding) .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(ElementTheme.colors.bgCanvasDefault) ) acceptDeclineInviteView() } @@ -152,14 +152,14 @@ private fun RoomListScaffold( floatingActionButton = { if (state.displayActions) { FloatingActionButton( - // FIXME align on Design system theme - containerColor = MaterialTheme.colorScheme.primary, + containerColor = ElementTheme.colors.iconPrimary, onClick = onCreateRoomClick ) { Icon( // Note cannot use Icons.Outlined.EditSquare, it does not exist :/ imageVector = CompoundIcons.Compose(), - contentDescription = stringResource(id = R.string.screen_roomlist_a11y_create_message) + contentDescription = stringResource(id = R.string.screen_roomlist_a11y_create_message), + tint = ElementTheme.colors.iconOnSolidPrimary, ) } } diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt index f196ba3c19..a0e9078530 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomListTopBar.kt @@ -162,7 +162,7 @@ private fun DefaultRoomListTopBar( // Workaround to display a very subtle bloom for avatars with very soft colors Color(0xFFF9F9F9) } else { - ElementTheme.materialColors.background + ElementTheme.colors.bgCanvasDefault }, blurSize = DpSize(avatarBloomSize, avatarBloomSize), offset = DpOffset(24.dp, 24.dp + statusBarPadding), @@ -174,7 +174,7 @@ private fun DefaultRoomListTopBar( } else { DpSize.Unspecified }, - bottomSoftEdgeColor = ElementTheme.materialColors.background, + bottomSoftEdgeColor = ElementTheme.colors.bgCanvasDefault, bottomSoftEdgeAlpha = if (displayFilters) { 1f } else { @@ -233,7 +233,7 @@ private fun DefaultRoomListTopBar( leadingIcon = { Icon( imageVector = CompoundIcons.ShareAndroid(), - tint = ElementTheme.materialColors.secondary, + tint = ElementTheme.colors.iconSecondary, contentDescription = null, ) } @@ -249,7 +249,7 @@ private fun DefaultRoomListTopBar( leadingIcon = { Icon( imageVector = CompoundIcons.ChatProblem(), - tint = ElementTheme.materialColors.secondary, + tint = ElementTheme.colors.iconSecondary, contentDescription = null, ) } diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt index 05ff1042e5..0fbd4d38fe 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt @@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ripple import androidx.compose.runtime.Composable import androidx.compose.runtime.remember @@ -212,7 +211,7 @@ private fun NameAndTimestampRow( style = ElementTheme.typography.fontBodyLgMedium, text = name ?: stringResource(id = CommonStrings.common_no_room_name), fontStyle = FontStyle.Italic.takeIf { name == null }, - color = MaterialTheme.roomListRoomName(), + color = ElementTheme.roomListRoomName(), maxLines = 1, overflow = TextOverflow.Ellipsis ) @@ -223,7 +222,7 @@ private fun NameAndTimestampRow( color = if (isHighlighted) { ElementTheme.colors.unreadIndicator } else { - MaterialTheme.roomListRoomMessageDate() + ElementTheme.roomListRoomMessageDate() }, ) } @@ -247,7 +246,7 @@ private fun InviteSubtitle( maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.roomListRoomMessage(), + color = ElementTheme.roomListRoomMessage(), modifier = modifier, ) } @@ -268,7 +267,7 @@ private fun LastMessageAndIndicatorRow( Text( modifier = Modifier.weight(1f), text = attributedLastMessage, - color = MaterialTheme.roomListRoomMessage(), + color = ElementTheme.roomListRoomMessage(), style = ElementTheme.typography.fontBodyMdRegular, minLines = 2, maxLines = 2, @@ -315,7 +314,7 @@ private fun InviteNameAndIndicatorRow( style = ElementTheme.typography.fontBodyLgMedium, text = name ?: stringResource(id = CommonStrings.common_no_room_name), fontStyle = FontStyle.Italic.takeIf { name == null }, - color = MaterialTheme.roomListRoomName(), + color = ElementTheme.roomListRoomName(), maxLines = 1, overflow = TextOverflow.Ellipsis ) diff --git a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt index 1a59e43fc6..c8755aac56 100644 --- a/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt +++ b/features/userprofile/shared/src/main/kotlin/io/element/android/features/userprofile/shared/UserProfileHeaderSection.kt @@ -13,7 +13,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -72,7 +71,7 @@ fun UserProfileHeaderSection( Text( text = userId.value, style = ElementTheme.typography.fontBodyLgRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, textAlign = TextAlign.Center, ) if (isUserVerified.dataOrNull() == true) { diff --git a/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/ui/VerificationContentVerifying.kt b/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/ui/VerificationContentVerifying.kt index 4484c9c708..12775cd2e0 100644 --- a/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/ui/VerificationContentVerifying.kt +++ b/features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/ui/VerificationContentVerifying.kt @@ -18,7 +18,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.widthIn -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -49,7 +48,7 @@ internal fun VerificationContentVerifying( modifier = Modifier.fillMaxWidth(), text = text, style = ElementTheme.typography.fontHeadingLgBold, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, textAlign = TextAlign.Center, ) } @@ -86,7 +85,7 @@ private fun EmojiItemView(emoji: VerificationEmoji, modifier: Modifier = Modifie Text( text = stringResource(id = emojiResource.nameRes), style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, ) diff --git a/libraries/designsystem/build.gradle.kts b/libraries/designsystem/build.gradle.kts index 01e8d56bb0..3e8d776f50 100644 --- a/libraries/designsystem/build.gradle.kts +++ b/libraries/designsystem/build.gradle.kts @@ -31,6 +31,7 @@ android { implementation(libs.androidx.compose.material3.adaptive) implementation(libs.coil.compose) implementation(libs.vanniktech.blurhash) + implementation(projects.features.enterprise.api) implementation(projects.libraries.architecture) implementation(projects.libraries.preferences.api) implementation(projects.libraries.testtags) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/ColorUtil.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/ColorUtil.kt index 317abe76ba..8b22e53ae6 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/ColorUtil.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/ColorUtil.kt @@ -7,24 +7,24 @@ package io.element.android.libraries.designsystem -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color +import io.element.android.compound.theme.ElementTheme @Composable fun Boolean.toEnabledColor(): Color { return if (this) { - MaterialTheme.colorScheme.primary + ElementTheme.colors.textPrimary } else { - MaterialTheme.colorScheme.primary.copy(alpha = 0.40f) + ElementTheme.colors.textDisabled } } @Composable fun Boolean.toSecondaryEnabledColor(): Color { return if (this) { - MaterialTheme.colorScheme.secondary + ElementTheme.colors.textSecondary } else { - MaterialTheme.colorScheme.secondary.copy(alpha = 0.40f) + ElementTheme.colors.textDisabled } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RedIndicatorAtom.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RedIndicatorAtom.kt index 86537f1435..354eada12a 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RedIndicatorAtom.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RedIndicatorAtom.kt @@ -33,7 +33,7 @@ fun RedIndicatorAtom( Box( modifier = modifier .size(size) - .border(borderSize, ElementTheme.materialColors.background, CircleShape) + .border(borderSize, ElementTheme.colors.bgCanvasDefault, CircleShape) .padding(borderSize / 2) .clip(CircleShape) .background(color) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RoundedIconAtom.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RoundedIconAtom.kt index 7816a59e48..b5312af314 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RoundedIconAtom.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/atoms/RoundedIconAtom.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Home -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -45,7 +44,7 @@ fun RoundedIconAtom( size: RoundedIconAtomSize = RoundedIconAtomSize.Big, resourceId: Int? = null, imageVector: ImageVector? = null, - tint: Color = MaterialTheme.colorScheme.secondary, + tint: Color = ElementTheme.colors.iconSecondary, backgroundTint: Color = ElementTheme.colors.temporaryColorBgSpecial, ) { Box( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/ComposerAlertMolecule.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/ComposerAlertMolecule.kt index 30944ead69..99d93834fe 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/ComposerAlertMolecule.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/ComposerAlertMolecule.kt @@ -58,7 +58,7 @@ fun ComposerAlertMolecule( ) val startColor = if (isCritical) ElementTheme.colors.bgCriticalSubtle else ElementTheme.colors.bgInfoSubtle val brush = Brush.verticalGradient( - listOf(startColor, ElementTheme.materialColors.background), + listOf(startColor, ElementTheme.colors.bgCanvasDefault), ) Box( modifier = Modifier diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/IconTitleSubtitleMolecule.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/IconTitleSubtitleMolecule.kt index d07f47b43c..9496f53993 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/IconTitleSubtitleMolecule.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/IconTitleSubtitleMolecule.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -51,7 +50,7 @@ fun IconTitleSubtitleMolecule( .fillMaxWidth(), textAlign = TextAlign.Center, style = ElementTheme.typography.fontHeadingMdBold, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) if (subTitle != null) { Spacer(Modifier.height(8.dp)) @@ -60,7 +59,7 @@ fun IconTitleSubtitleMolecule( modifier = Modifier.fillMaxWidth(), textAlign = TextAlign.Center, style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, ) } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/pages/HeaderFooterPage.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/pages/HeaderFooterPage.kt index 8a95340342..47b43fea40 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/pages/HeaderFooterPage.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/pages/HeaderFooterPage.kt @@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.imePadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.movableContentOf import androidx.compose.runtime.remember @@ -46,7 +45,7 @@ import io.element.android.libraries.designsystem.theme.components.Text fun HeaderFooterPage( modifier: Modifier = Modifier, paddingValues: PaddingValues = PaddingValues(20.dp), - containerColor: Color = MaterialTheme.colorScheme.background, + containerColor: Color = ElementTheme.colors.bgCanvasDefault, isScrollable: Boolean = false, background: @Composable () -> Unit = {}, topBar: @Composable () -> Unit = {}, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/background/LightGradientBackground.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/background/LightGradientBackground.kt index 274518f831..d33fa9f211 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/background/LightGradientBackground.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/background/LightGradientBackground.kt @@ -9,13 +9,13 @@ package io.element.android.libraries.designsystem.background import androidx.compose.foundation.Canvas import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.geometry.center import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.RadialGradientShader import androidx.compose.ui.graphics.ShaderBrush +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.PreviewsDayNight @@ -25,7 +25,7 @@ import io.element.android.libraries.designsystem.preview.PreviewsDayNight @Composable fun LightGradientBackground( modifier: Modifier = Modifier, - backgroundColor: Color = MaterialTheme.colorScheme.background, + backgroundColor: Color = ElementTheme.colors.bgCanvasDefault, firstColor: Color = Color(0x1E0DBD8B), secondColor: Color = Color(0x001273EB), ratio: Float = 642 / 775f, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt index 5e3aebd656..b86fdd8db5 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/Bloom.kt @@ -477,7 +477,7 @@ internal fun BloomPreview() { } .bloom( hash = blurhash, - background = ElementTheme.materialColors.background, + background = ElementTheme.colors.bgCanvasDefault, blurSize = DpSize(430.dp, 430.dp), offset = DpOffset(24.dp, 24.dp), clipToSize = if (topAppBarHeight > 0) DpSize(430.dp, topAppBarHeight.toDp()) else DpSize.Zero, @@ -554,9 +554,9 @@ internal fun BloomInitialsPreview(@PreviewParameter(InitialsColorIntProvider::cl // Workaround to display a very subtle bloom for avatars with very soft colors Color(0xFFF9F9F9) } else { - ElementTheme.materialColors.background + ElementTheme.colors.bgCanvasDefault }, - bottomSoftEdgeColor = ElementTheme.materialColors.background, + bottomSoftEdgeColor = ElementTheme.colors.bgCanvasDefault, blurSize = DpSize(256.dp, 256.dp), ), contentAlignment = Alignment.Center diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/LabelledCheckbox.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/LabelledCheckbox.kt index 554050511e..3f25a69eb0 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/LabelledCheckbox.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/LabelledCheckbox.kt @@ -9,11 +9,11 @@ package io.element.android.libraries.designsystem.components import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup import io.element.android.libraries.designsystem.theme.components.Checkbox @@ -38,7 +38,7 @@ fun LabelledCheckbox( ) Text( text = text, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) } } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/ProgressDialog.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/ProgressDialog.kt index 8e27661359..f5d8a50ce0 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/ProgressDialog.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/ProgressDialog.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.ElementThemedPreview import io.element.android.libraries.designsystem.preview.PreviewGroup @@ -64,13 +65,13 @@ fun ProgressDialog( when (type) { is ProgressDialogType.Indeterminate -> { CircularProgressIndicator( - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.iconPrimary ) } is ProgressDialogType.Determinate -> { CircularProgressIndicator( progress = { type.progress }, - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.iconPrimary ) } } @@ -93,7 +94,7 @@ private fun ProgressDialogContent( onCancelClick: () -> Unit = {}, progressIndicator: @Composable () -> Unit = { CircularProgressIndicator( - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.iconPrimary ) } ) { @@ -114,7 +115,7 @@ private fun ProgressDialogContent( Spacer(modifier = Modifier.height(22.dp)) Text( text = text, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) } if (showCancelButton) { diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/button/MainActionButton.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/button/MainActionButton.kt index b8b4a31259..537c1f639f 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/button/MainActionButton.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/components/button/MainActionButton.kt @@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.widthIn import androidx.compose.material3.LocalContentColor -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ripple import androidx.compose.runtime.Composable import androidx.compose.runtime.remember @@ -58,17 +57,16 @@ fun MainActionButton( .widthIn(min = 76.dp, max = 96.dp), horizontalAlignment = Alignment.CenterHorizontally, ) { - val tintColor = if (enabled) LocalContentColor.current else MaterialTheme.colorScheme.secondary Icon( imageVector = imageVector, contentDescription = contentDescription, - tint = tintColor, + tint = if (enabled) LocalContentColor.current else ElementTheme.colors.iconDisabled, ) Spacer(modifier = Modifier.height(14.dp)) Text( title, style = ElementTheme.typography.fontBodyMdMedium.copy(hyphens = Hyphens.Auto), - color = tintColor, + color = if (enabled) LocalContentColor.current else ElementTheme.colors.textDisabled, overflow = TextOverflow.Visible, textAlign = TextAlign.Center, ) diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ColorAliases.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ColorAliases.kt index 29d3633cc0..77ac8d6dd6 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ColorAliases.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ColorAliases.kt @@ -7,7 +7,6 @@ package io.element.android.libraries.designsystem.theme -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color import io.element.android.compound.annotations.CoreColorToken @@ -24,13 +23,13 @@ import kotlinx.collections.immutable.persistentMapOf * Room list. */ @Composable -fun MaterialTheme.roomListRoomName() = colorScheme.primary +fun ElementTheme.roomListRoomName() = colors.textPrimary @Composable -fun MaterialTheme.roomListRoomMessage() = colorScheme.secondary +fun ElementTheme.roomListRoomMessage() = colors.textSecondary @Composable -fun MaterialTheme.roomListRoomMessageDate() = colorScheme.secondary +fun ElementTheme.roomListRoomMessageDate() = colors.textSecondary val SemanticColors.unreadIndicator get() = iconAccentTertiary @@ -181,9 +180,9 @@ internal fun ColorAliasesPreview() = ElementPreview { backgroundColor = Color.Black, foregroundColor = Color.White, colors = persistentMapOf( - "roomListRoomName" to MaterialTheme.roomListRoomName(), - "roomListRoomMessage" to MaterialTheme.roomListRoomMessage(), - "roomListRoomMessageDate" to MaterialTheme.roomListRoomMessageDate(), + "roomListRoomName" to ElementTheme.roomListRoomName(), + "roomListRoomMessage" to ElementTheme.roomListRoomMessage(), + "roomListRoomMessageDate" to ElementTheme.roomListRoomMessageDate(), "unreadIndicator" to ElementTheme.colors.unreadIndicator, "placeholderBackground" to ElementTheme.colors.placeholderBackground, "messageFromMeBackground" to ElementTheme.colors.messageFromMeBackground, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementThemeApp.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementThemeApp.kt index 2c69b8575a..0944664074 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementThemeApp.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/ElementThemeApp.kt @@ -17,6 +17,7 @@ import io.element.android.compound.theme.ElementTheme import io.element.android.compound.theme.Theme import io.element.android.compound.theme.isDark import io.element.android.compound.theme.mapToTheme +import io.element.android.features.enterprise.api.EnterpriseService import io.element.android.libraries.preferences.api.store.AppPreferencesStore /** @@ -29,6 +30,7 @@ import io.element.android.libraries.preferences.api.store.AppPreferencesStore @Composable fun ElementThemeApp( appPreferencesStore: AppPreferencesStore, + enterpriseService: EnterpriseService, content: @Composable () -> Unit, ) { val theme by remember { @@ -44,8 +46,12 @@ fun ElementThemeApp( } ) } + val compoundLight = remember { enterpriseService.semanticColorsLight() } + val compoundDark = remember { enterpriseService.semanticColorsDark() } ElementTheme( darkTheme = theme.isDark(), content = content, + compoundLight = compoundLight, + compoundDark = compoundDark, ) } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/AlertDialogContent.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/AlertDialogContent.kt index 7936c25fcb..51fe275ee1 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/AlertDialogContent.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/AlertDialogContent.kt @@ -159,7 +159,7 @@ internal fun SimpleAlertDialogContent( // most cases, TextButtons should be used for dismiss and confirm buttons. // TextButtons will not consume this provided content color value, and will used their // own defined or default colors. - buttonContentColor = MaterialTheme.colorScheme.primary, + buttonContentColor = ElementTheme.colors.textPrimary, applyPaddingToContents = applyPaddingToContents, ) } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/Button.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/Button.kt index 4a198379ca..8b1ca52515 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/Button.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/Button.kt @@ -314,7 +314,7 @@ internal enum class ButtonStyle { contentColor = if (destructive) { ElementTheme.colors.textCriticalPrimary } else { - if (LocalContentColor.current.isSpecified) LocalContentColor.current else ElementTheme.materialColors.primary + if (LocalContentColor.current.isSpecified) LocalContentColor.current else ElementTheme.colors.textPrimary }, disabledContainerColor = Color.Transparent, disabledContentColor = getDisabledContentColor(destructive), diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/SearchBar.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/SearchBar.kt index 99f9f1a556..e75b7727eb 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/SearchBar.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/SearchBar.kt @@ -106,7 +106,7 @@ fun SearchBar( Icon( imageVector = CompoundIcons.Search(), contentDescription = stringResource(CommonStrings.action_search), - tint = ElementTheme.materialColors.tertiary, + tint = ElementTheme.colors.iconTertiary, ) } } @@ -138,7 +138,7 @@ fun SearchBar( Text( text = stringResource(CommonStrings.common_no_results), textAlign = TextAlign.Center, - color = ElementTheme.materialColors.tertiary, + color = ElementTheme.colors.textSecondary, modifier = Modifier.fillMaxWidth() ) } diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/DatePickerPreview.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/DatePickerPreview.kt index e207657d2c..dbfb0b29a6 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/DatePickerPreview.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/DatePickerPreview.kt @@ -10,10 +10,10 @@ package io.element.android.libraries.designsystem.theme.components.previews import androidx.compose.material3.AlertDialogDefaults import androidx.compose.material3.DatePicker import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.rememberDatePickerState import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.architecture.coverage.ExcludeFromCoverage import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight @@ -48,7 +48,7 @@ private fun ContentToPreview() { shape = AlertDialogDefaults.shape, containerColor = AlertDialogDefaults.containerColor, tonalElevation = AlertDialogDefaults.TonalElevation, - buttonContentColor = MaterialTheme.colorScheme.primary, + buttonContentColor = ElementTheme.colors.textPrimary, iconContentColor = AlertDialogDefaults.iconContentColor, titleContentColor = AlertDialogDefaults.titleContentColor, textContentColor = AlertDialogDefaults.textContentColor, diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/TimePickerPreview.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/TimePickerPreview.kt index 9513a2468f..57ecb9c967 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/TimePickerPreview.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/theme/components/previews/TimePickerPreview.kt @@ -9,12 +9,12 @@ package io.element.android.libraries.designsystem.theme.components.previews import androidx.compose.material3.AlertDialogDefaults import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.TimePicker import androidx.compose.material3.TimePickerLayoutType import androidx.compose.material3.rememberTimePickerState import androidx.compose.runtime.Composable import androidx.compose.ui.tooling.preview.Preview +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.designsystem.preview.ElementPreviewDark import io.element.android.libraries.designsystem.preview.ElementPreviewLight import io.element.android.libraries.designsystem.preview.ElementThemedPreview @@ -35,7 +35,7 @@ internal fun TimePickerHorizontalPreview() { shape = AlertDialogDefaults.shape, containerColor = AlertDialogDefaults.containerColor, tonalElevation = AlertDialogDefaults.TonalElevation, - buttonContentColor = MaterialTheme.colorScheme.primary, + buttonContentColor = ElementTheme.colors.textPrimary, iconContentColor = AlertDialogDefaults.iconContentColor, titleContentColor = AlertDialogDefaults.titleContentColor, textContentColor = AlertDialogDefaults.textContentColor, @@ -57,7 +57,7 @@ internal fun TimePickerVerticalLightPreview() { shape = AlertDialogDefaults.shape, containerColor = AlertDialogDefaults.containerColor, tonalElevation = AlertDialogDefaults.TonalElevation, - buttonContentColor = MaterialTheme.colorScheme.primary, + buttonContentColor = ElementTheme.colors.textPrimary, iconContentColor = AlertDialogDefaults.iconContentColor, titleContentColor = AlertDialogDefaults.titleContentColor, textContentColor = AlertDialogDefaults.textContentColor, @@ -83,7 +83,7 @@ internal fun TimePickerVerticalDarkPreview() { shape = AlertDialogDefaults.shape, containerColor = AlertDialogDefaults.containerColor, tonalElevation = AlertDialogDefaults.TonalElevation, - buttonContentColor = MaterialTheme.colorScheme.primary, + buttonContentColor = ElementTheme.colors.textPrimary, iconContentColor = AlertDialogDefaults.iconContentColor, titleContentColor = AlertDialogDefaults.titleContentColor, textContentColor = AlertDialogDefaults.textContentColor, diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt index 936955008d..fa9cf5156c 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/AvatarActionBottomSheet.kt @@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.runtime.rememberCoroutineScope @@ -97,7 +96,7 @@ private fun AvatarActionBottomSheetContent( Text( text = stringResource(action.titleResId), style = ElementTheme.typography.fontBodyLgRegular, - color = if (action.destructive) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.primary, + color = if (action.destructive) ElementTheme.colors.textCriticalPrimary else ElementTheme.colors.textPrimary, ) }, leadingContent = ListItemContent.Icon(IconSource.Resource(action.iconResourceId)), diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/EditableAvatarView.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/EditableAvatarView.kt index 9f7583972f..1a0cd53f6d 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/EditableAvatarView.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/EditableAvatarView.kt @@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.ripple import androidx.compose.runtime.Composable import androidx.compose.runtime.remember @@ -27,6 +26,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.unit.dp +import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.libraries.designsystem.components.avatar.Avatar import io.element.android.libraries.designsystem.components.avatar.AvatarData @@ -79,7 +79,7 @@ fun EditableAvatarView( modifier = Modifier .align(Alignment.BottomEnd) .clip(CircleShape) - .background(MaterialTheme.colorScheme.primary) + .background(ElementTheme.colors.iconPrimary) .size(24.dp), contentAlignment = Alignment.Center, ) { @@ -87,7 +87,7 @@ fun EditableAvatarView( modifier = Modifier.size(16.dp), imageVector = CompoundIcons.EditSolid(), contentDescription = null, - tint = MaterialTheme.colorScheme.onPrimary, + tint = ElementTheme.colors.iconOnSolidPrimary, ) } } diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/InviteSenderView.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/InviteSenderView.kt index a081a990a5..57c500a1aa 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/InviteSenderView.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/InviteSenderView.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp @@ -40,7 +39,7 @@ fun InviteSenderView( Text( text = inviteSender.annotatedString(), style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, ) } } diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt index 6aea3b6dfd..55833caf59 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/MatrixUserHeader.kt @@ -77,14 +77,14 @@ private fun MatrixUserHeaderContent( maxLines = 1, style = ElementTheme.typography.fontHeadingSmMedium, overflow = TextOverflow.Ellipsis, - color = ElementTheme.materialColors.primary, + color = ElementTheme.colors.textPrimary, ) // Id if (matrixUser.displayName.isNullOrEmpty().not()) { Text( text = matrixUser.userId.value, style = ElementTheme.typography.fontBodyMdRegular, - color = ElementTheme.materialColors.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis ) diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SelectedRoom.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SelectedRoom.kt index e43c52f5b0..11f6b74b95 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SelectedRoom.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SelectedRoom.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp +import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons import io.element.android.libraries.designsystem.components.avatar.AvatarSize import io.element.android.libraries.designsystem.components.avatar.CompositeAvatar @@ -65,21 +66,21 @@ fun SelectedRoom( ) } Surface( - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.iconPrimary, modifier = Modifier - .clip(CircleShape) - .size(20.dp) - .align(Alignment.TopEnd) - .clickable( - indication = ripple(), - interactionSource = remember { MutableInteractionSource() }, - onClick = { onRemoveRoom(roomInfo) } - ), + .clip(CircleShape) + .size(20.dp) + .align(Alignment.TopEnd) + .clickable( + indication = ripple(), + interactionSource = remember { MutableInteractionSource() }, + onClick = { onRemoveRoom(roomInfo) } + ), ) { Icon( imageVector = CompoundIcons.Close(), contentDescription = stringResource(id = CommonStrings.action_remove), - tint = MaterialTheme.colorScheme.onPrimary, + tint = ElementTheme.colors.iconOnSolidPrimary, modifier = Modifier.padding(2.dp) ) } diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnresolvedUserRow.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnresolvedUserRow.kt index 028c31ec78..dfccefa116 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnresolvedUserRow.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnresolvedUserRow.kt @@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -58,7 +57,7 @@ fun UnresolvedUserRow( text = id, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, style = ElementTheme.typography.fontBodyLgMedium, ) @@ -75,12 +74,11 @@ fun UnresolvedUserRow( .size(18.dp) .align(Alignment.Top) .padding(2.dp), - tint = MaterialTheme.colorScheme.error, + tint = ElementTheme.colors.iconCriticalPrimary, ) - Text( text = stringResource(CommonStrings.common_invite_unknown_profile), - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodySmRegular.copy(lineHeight = 16.sp), ) } diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnsavedAvatar.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnsavedAvatar.kt index b78f256deb..bbbf014e99 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnsavedAvatar.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UnsavedAvatar.kt @@ -67,7 +67,7 @@ fun UnsavedAvatar( modifier = Modifier .align(Alignment.Center) .size(40.dp), - tint = MaterialTheme.colorScheme.secondary, + tint = ElementTheme.colors.iconSecondary, ) } } diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UserRow.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UserRow.kt index 2889c33f99..2f5874b664 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UserRow.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/UserRow.kt @@ -12,7 +12,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -51,14 +50,14 @@ internal fun UserRow( text = name, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, style = ElementTheme.typography.fontBodyLgRegular, ) // Id subtext?.let { Text( text = subtext, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodySmRegular, diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/reply/InReplyToView.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/reply/InReplyToView.kt index ed30daf76f..3fb4ddd74a 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/reply/InReplyToView.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/reply/InReplyToView.kt @@ -140,7 +140,7 @@ private fun ReplyToErrorContent( Text( text = data.message, style = ElementTheme.typography.fontBodyMdRegular, - color = MaterialTheme.colorScheme.error, + color = ElementTheme.colors.textCriticalPrimary, maxLines = 2, overflow = TextOverflow.Ellipsis, ) @@ -171,7 +171,7 @@ private fun ReplyToContentText(metadata: InReplyToMetadata?) { if (iconResourceId != null) { Icon( resourceId = iconResourceId, - tint = MaterialTheme.colorScheme.secondary, + tint = ElementTheme.colors.iconSecondary, contentDescription = null, modifier = Modifier.size(16.dp) ) @@ -182,7 +182,7 @@ private fun ReplyToContentText(metadata: InReplyToMetadata?) { style = ElementTheme.typography.fontBodyMdRegular, fontStyle = fontStyle, textAlign = TextAlign.Start, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 2, overflow = TextOverflow.Ellipsis, ) diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/sender/SenderName.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/sender/SenderName.kt index 0c0f4e4e2d..d59e9cf24f 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/sender/SenderName.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/messages/sender/SenderName.kt @@ -10,7 +10,6 @@ package io.element.android.libraries.matrix.ui.messages.sender import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.RowScope -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -77,7 +76,7 @@ private fun RowScope.MainText( val color = when (mode) { is SenderNameMode.Timeline -> mode.mainColor SenderNameMode.ActionList, - SenderNameMode.Reply -> MaterialTheme.colorScheme.primary + SenderNameMode.Reply -> ElementTheme.colors.textPrimary } Text( modifier = modifier.clipToBounds(), @@ -108,7 +107,7 @@ private fun RowScope.SecondaryText( modifier = modifier.clipToBounds(), text = text, style = style, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, ) diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/model/InviteSender.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/model/InviteSender.kt index 265668f0f6..a9295576e1 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/model/InviteSender.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/model/InviteSender.kt @@ -7,7 +7,6 @@ package io.element.android.libraries.matrix.ui.model -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.Immutable import androidx.compose.ui.platform.LocalContext @@ -15,6 +14,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.font.FontWeight +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.designsystem.components.avatar.AvatarData import io.element.android.libraries.designsystem.components.avatar.AvatarSize import io.element.android.libraries.matrix.api.core.UserId @@ -37,7 +37,7 @@ data class InviteSender( AnnotatedString.Range( SpanStyle( fontWeight = FontWeight.Medium, - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.textPrimary ), start = senderNameStart, end = senderNameStart + displayName.length diff --git a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt index 451569233f..2b3fcb144d 100644 --- a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt +++ b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDeleteConfirmationBottomSheet.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -141,7 +140,7 @@ private fun MediaRow( // Info Text( text = state.mediaInfo.mimeType + " - " + state.mediaInfo.formattedFileSize, - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodySmRegular, diff --git a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt index 90baecb988..5d4b67a411 100644 --- a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt +++ b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/details/MediaDetailsBottomSheet.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -165,7 +164,7 @@ private fun SenderRow( // Id Text( text = mediaInfo.senderId?.value.orEmpty(), - color = MaterialTheme.colorScheme.secondary, + color = ElementTheme.colors.textSecondary, maxLines = 1, overflow = TextOverflow.Ellipsis, style = ElementTheme.typography.fontBodyMdRegular, diff --git a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/audio/MediaAudioView.kt b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/audio/MediaAudioView.kt index 226aa85234..119cf8d3e7 100644 --- a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/audio/MediaAudioView.kt +++ b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/audio/MediaAudioView.kt @@ -25,7 +25,6 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.GraphicEq -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.derivedStateOf @@ -261,13 +260,13 @@ private fun ExoPlayerMediaAudioView( modifier = Modifier .size(72.dp) .clip(CircleShape) - .background(MaterialTheme.colorScheme.onBackground), + .background(ElementTheme.colors.iconPrimary), contentAlignment = Alignment.Center, ) { Icon( imageVector = Icons.Outlined.GraphicEq, contentDescription = null, - tint = MaterialTheme.colorScheme.background, + tint = ElementTheme.colors.iconOnSolidPrimary, modifier = Modifier .size(32.dp), ) @@ -335,7 +334,7 @@ private fun AudioInfoView( style = ElementTheme.typography.fontBodyMdRegular, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.textPrimary ) } if (info != null) { @@ -346,7 +345,7 @@ private fun AudioInfoView( style = ElementTheme.typography.fontBodyLgRegular, overflow = TextOverflow.Ellipsis, textAlign = TextAlign.Center, - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.textPrimary ) Spacer(modifier = Modifier.height(4.dp)) Text( @@ -354,7 +353,7 @@ private fun AudioInfoView( style = ElementTheme.typography.fontBodyMdRegular, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.textPrimary ) } } diff --git a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/file/MediaFileView.kt b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/file/MediaFileView.kt index 7cc48dbd69..7f8a7bd5ae 100644 --- a/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/file/MediaFileView.kt +++ b/libraries/mediaviewer/impl/src/main/kotlin/io/element/android/libraries/mediaviewer/impl/local/file/MediaFileView.kt @@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.outlined.GraphicEq -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Alignment @@ -72,13 +71,13 @@ fun MediaFileView( modifier = Modifier .size(72.dp) .clip(CircleShape) - .background(MaterialTheme.colorScheme.onBackground), + .background(ElementTheme.colors.iconPrimary), contentAlignment = Alignment.Center, ) { Icon( imageVector = if (isAudio) Icons.Outlined.GraphicEq else CompoundIcons.Attachment(), contentDescription = null, - tint = MaterialTheme.colorScheme.background, + tint = ElementTheme.colors.iconOnSolidPrimary, modifier = Modifier .size(32.dp) .rotate(if (isAudio) 0f else -45f), @@ -92,7 +91,7 @@ fun MediaFileView( style = ElementTheme.typography.fontBodyLgRegular, overflow = TextOverflow.Ellipsis, textAlign = TextAlign.Center, - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.textPrimary ) Spacer(modifier = Modifier.height(4.dp)) Text( @@ -100,7 +99,7 @@ fun MediaFileView( style = ElementTheme.typography.fontBodyMdRegular, maxLines = 1, overflow = TextOverflow.Ellipsis, - color = MaterialTheme.colorScheme.primary + color = ElementTheme.colors.textPrimary ) } } diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ComposerModeView.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ComposerModeView.kt index bd5451b397..1299f99463 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ComposerModeView.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ComposerModeView.kt @@ -88,7 +88,7 @@ private fun EditingModeView( Icon( imageVector = CompoundIcons.Edit(), contentDescription = null, - tint = ElementTheme.materialColors.secondary, + tint = ElementTheme.colors.iconSecondary, modifier = Modifier .padding(vertical = 8.dp) .size(16.dp), @@ -97,7 +97,7 @@ private fun EditingModeView( text = text, style = ElementTheme.typography.fontBodySmRegular, textAlign = TextAlign.Start, - color = ElementTheme.materialColors.secondary, + color = ElementTheme.colors.textSecondary, modifier = Modifier .padding(vertical = 8.dp) .weight(1f) @@ -105,7 +105,7 @@ private fun EditingModeView( Icon( imageVector = CompoundIcons.Close(), contentDescription = stringResource(CommonStrings.action_close), - tint = ElementTheme.materialColors.secondary, + tint = ElementTheme.colors.iconSecondary, modifier = Modifier .padding(top = 8.dp, bottom = 8.dp, start = 16.dp, end = 12.dp) .size(16.dp) @@ -140,7 +140,7 @@ private fun ReplyToModeView( Icon( imageVector = CompoundIcons.Close(), contentDescription = stringResource(CommonStrings.action_close), - tint = MaterialTheme.colorScheme.secondary, + tint = ElementTheme.colors.iconSecondary, modifier = Modifier .padding(end = 4.dp, top = 4.dp, start = 8.dp, bottom = 16.dp) .size(16.dp) diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ElementRichTextEditorStyle.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ElementRichTextEditorStyle.kt index f7ff275e3a..bf13b8016c 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ElementRichTextEditorStyle.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/ElementRichTextEditorStyle.kt @@ -27,9 +27,9 @@ object ElementRichTextEditorStyle { return baseStyle.copy( text = baseStyle.text.copy( color = if (hasFocus) { - ElementTheme.materialColors.primary + ElementTheme.colors.textPrimary } else { - ElementTheme.materialColors.secondary + ElementTheme.colors.textSecondary }, lineHeight = TextUnit.Unspecified, includeFontPadding = true, diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/VoiceMessagePreview.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/VoiceMessagePreview.kt index 4e69a1b6a6..d965a3d0d6 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/VoiceMessagePreview.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/components/VoiceMessagePreview.kt @@ -84,7 +84,7 @@ internal fun VoiceMessagePreview( Text( text = time.formatShort(), - color = ElementTheme.materialColors.secondary, + color = ElementTheme.colors.textSecondary, style = ElementTheme.typography.fontBodySmMedium, maxLines = 1, overflow = TextOverflow.Ellipsis, diff --git a/tests/uitests/src/test/kotlin/base/ScreenshotTest.kt b/tests/uitests/src/test/kotlin/base/ScreenshotTest.kt index 28b66b70dd..02ffa418a3 100644 --- a/tests/uitests/src/test/kotlin/base/ScreenshotTest.kt +++ b/tests/uitests/src/test/kotlin/base/ScreenshotTest.kt @@ -11,7 +11,6 @@ import android.content.res.Configuration import android.os.LocaleList import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration @@ -55,7 +54,7 @@ object ScreenshotTest { ElementTheme { Box( modifier = Modifier - .background(MaterialTheme.colorScheme.background) + .background(ElementTheme.colors.bgCanvasDefault) ) { preview() } diff --git a/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Day_3_en.png b/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Day_3_en.png index 9cb1f42f41..0a814f0569 100644 --- a/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Day_3_en.png +++ b/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Day_3_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1521e7abc43b6cee8d783e395f9ab67295bfab09acfaa26f271f6583a6c008e2 -size 59831 +oid sha256:815354f4bd3ed435a335b5ec5ac84054e31c0f072733d35e35f337dded866b72 +size 59837 diff --git a/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Night_3_en.png b/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Night_3_en.png index 5c69f0e415..d930e04db5 100644 --- a/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Night_3_en.png +++ b/tests/uitests/src/test/snapshots/images/features.messages.impl_MessagesView_Night_3_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9dcf745eec6b0cdf29be48bd1d7e637fbd7fb4d70a42f0c55f0fd53ad5d70106 -size 59235 +oid sha256:a780225b2b136773a6421f5ad5b31adbd91e9a8ce90a13c8e12c5f11264f4422 +size 58951 diff --git a/tests/uitests/src/test/snapshots/images/features.networkmonitor.api.ui_Indicator_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.networkmonitor.api.ui_Indicator_Day_0_en.png new file mode 100644 index 0000000000..789520675b --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/features.networkmonitor.api.ui_Indicator_Day_0_en.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b62c398c035a386bdaba180f3090e122b78131c741cd6fdb97ad533137b6a15e +size 5531 diff --git a/tests/uitests/src/test/snapshots/images/features.networkmonitor.api.ui_Indicator_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.networkmonitor.api.ui_Indicator_Night_0_en.png new file mode 100644 index 0000000000..7eff425d13 --- /dev/null +++ b/tests/uitests/src/test/snapshots/images/features.networkmonitor.api.ui_Indicator_Night_0_en.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e55da84c46cd5d7f211f7323425f561b234c50144b8477c348015828b5656be +size 5386 diff --git a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Day_0_en.png index 59eed4a5cc..7e4912ced9 100644 --- a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8a2a1910e21509ebbaf5117e2abdef0dee6bb301afeeae821d0240a72e5ef721 +oid sha256:2ad2339fc746eb2d97fd6c1ea654984623438b54dc3ecb0da6a57483c5daaa49 size 21538 diff --git a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Night_0_en.png index 9afe1b7630..44f3691d4b 100644 --- a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollAnswerViewEndedSelected_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4051a95ba6a727fe0f688bd56e14739ddc617b9b3466b80c6bc60c90f91f4a4b -size 21123 +oid sha256:4de996d888d1fab1ad4bc9373bea12caf7466c55dbb8dc94b31fcad214c75297 +size 21122 diff --git a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Day_0_en.png index 374113b566..0c5435cb6a 100644 --- a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d4d192e27e8f705f1049e63e6cd9759830526e43132502033fd198d9216346a -size 47244 +oid sha256:55966ba3d9945307cc2ed1f8a52078c89bf9b47e66cd7db0f48ef9f6949240bb +size 47241 diff --git a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Night_0_en.png index 53fea58d96..8cc6df8496 100644 --- a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewCreatorEnded_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58b7377a27c180c531168e48819e903554f1d85525626ab4b6d79dab7f322c43 -size 45889 +oid sha256:d87df9b84ac158cfff84a2ad261d6446213a39b1435e4aecbd41e544cc3e42df +size 45888 diff --git a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Day_0_en.png b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Day_0_en.png index 374113b566..0c5435cb6a 100644 --- a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Day_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Day_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d4d192e27e8f705f1049e63e6cd9759830526e43132502033fd198d9216346a -size 47244 +oid sha256:55966ba3d9945307cc2ed1f8a52078c89bf9b47e66cd7db0f48ef9f6949240bb +size 47241 diff --git a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Night_0_en.png b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Night_0_en.png index 53fea58d96..8cc6df8496 100644 --- a/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Night_0_en.png +++ b/tests/uitests/src/test/snapshots/images/features.poll.api.pollcontent_PollContentViewEnded_Night_0_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:58b7377a27c180c531168e48819e903554f1d85525626ab4b6d79dab7f322c43 -size 45889 +oid sha256:d87df9b84ac158cfff84a2ad261d6446213a39b1435e4aecbd41e544cc3e42df +size 45888 diff --git a/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Day_2_en.png b/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Day_2_en.png index 139444ef1d..4f17fe2903 100644 --- a/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Day_2_en.png +++ b/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Day_2_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d964de0d0cc6b2210690c99f77bfd70d41173f71893a2c072565101a84982583 -size 66203 +oid sha256:dcdda50ce353819cfcd87063e2b7232d9b6da727f2d4cabb59868ac70037c5d3 +size 66381 diff --git a/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Night_2_en.png b/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Night_2_en.png index d9d0bab7bc..58f7bfe9b0 100644 --- a/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Night_2_en.png +++ b/tests/uitests/src/test/snapshots/images/features.rageshake.impl.bugreport_BugReportView_Night_2_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:de1bc2159d3c9fe8ddfa2b1c078b66a40a839e45f9c33f8744aeaec58f5a238e -size 63800 +oid sha256:ee6b493921182340691ef43e5f4a8783831fb3bcd0daf4ca565458e46c8c914c +size 63884 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.button_MainActionButton_Buttons_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.button_MainActionButton_Buttons_en.png index 31b2ae723a..d0fe56b36a 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.button_MainActionButton_Buttons_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.button_MainActionButton_Buttons_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:48b55e3d045eff0f2129394ea64bb5bc4962278a8feeb13323f5eed09d95596f -size 22300 +oid sha256:18a7b8395fe7791689d7cc028bd1b73d5b0a90bbcd10f5f8cc8e7542e36ba0bd +size 22136 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceCheckbox_Preferences_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceCheckbox_Preferences_en.png index 51871d2096..bf4fec1755 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceCheckbox_Preferences_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceCheckbox_Preferences_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cc52445bf4196bb91d137b43e01d1ba547191a15ea4f61b09e2b7cbb323821df -size 64870 +oid sha256:9aec79c842bea8e2bff03d39ccc08b8e022c66947679257359a922a531183ece +size 65623 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSlide_Preferences_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSlide_Preferences_en.png index 7e76795ad0..ea437e5a39 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSlide_Preferences_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSlide_Preferences_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a035426d751113cfad1cb77522ad9c7cad37caccb310b013ebe6d9bf95e23ccd -size 23779 +oid sha256:3133a21de407cb4e3dcf0017230dd4e26a27916ccc7e73845fe035246d784aae +size 23747 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSwitch_Preferences_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSwitch_Preferences_en.png index a6ae052e1a..ae95fe00d6 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSwitch_Preferences_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceSwitch_Preferences_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:13e77179a17c1ae2587fd9a109787dd7ebea58837c318aeeed00bbeb28a70dca -size 36610 +oid sha256:4679de706ba1c71ba3203d32f25d5e2246428f8ba6adb6627df96678838b6214 +size 35989 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextDark_Preferences_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextDark_Preferences_en.png index e4c9c82c3c..4d5de359f3 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextDark_Preferences_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextDark_Preferences_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6432b9d7e491fd647898a8c1adfe65dff5141494ceb6801ca17dfd3c908f262 -size 34450 +oid sha256:2c622f64093c06231a22bc3b206d27610972433a1863196b37f2047e02cb0569 +size 34700 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextLight_Preferences_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextLight_Preferences_en.png index dd33b70f5d..353dab0ba8 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextLight_Preferences_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextLight_Preferences_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:53a1978d02b8229ba18a75b0c8e05d9a9aa4934815a82b0da865100fd38bfb10 -size 34934 +oid sha256:01449dad70b533fe07cfdc38315483122314ca517880dbf889bcb5595e794d96 +size 35187 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeDark_Preferences_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeDark_Preferences_en.png index e591a037b4..c39da11444 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeDark_Preferences_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeDark_Preferences_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9d072307f919575d403399dfe8b31ee13a9821495565bd9450768411cd837408 -size 36943 +oid sha256:f4eea08600173cdffd22ddfe56d4e57a8fd32db5a96356fe8cd73677055d1efc +size 37215 diff --git a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeLight_Preferences_en.png b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeLight_Preferences_en.png index 84e35bc145..ded1096506 100644 --- a/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeLight_Preferences_en.png +++ b/tests/uitests/src/test/snapshots/images/libraries.designsystem.components.preferences_PreferenceTextWithEndBadgeLight_Preferences_en.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7832924770983aecd3a81d01569ef74c6d3d2f92fb19efb23449ebf619152ad9 -size 37057 +oid sha256:51b2e2ca072662a4feb7b34c50d4601b0a68a86a1b62601cb546754da926869a +size 37314 diff --git a/tools/templates/files/fileTemplates/Template Presentation Classes.kt.child.2.kt b/tools/templates/files/fileTemplates/Template Presentation Classes.kt.child.2.kt index 0080f8d905..c4f3b1b5b2 100644 --- a/tools/templates/files/fileTemplates/Template Presentation Classes.kt.child.2.kt +++ b/tools/templates/files/fileTemplates/Template Presentation Classes.kt.child.2.kt @@ -1,12 +1,12 @@ #if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end import androidx.compose.foundation.layout.Box -import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter +import io.element.android.compound.theme.ElementTheme import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.PreviewsDayNight import io.element.android.libraries.designsystem.theme.components.Text @@ -19,7 +19,7 @@ fun ${NAME}View( Box(modifier, contentAlignment = Alignment.Center) { Text( "${NAME} feature view", - color = MaterialTheme.colorScheme.primary, + color = ElementTheme.colors.textPrimary, ) } }