Introduce "Black" theme and refactor theme handling

* Add `Theme.Black` to the `Theme` enum and update `isDark()` to include it.
* Refactor `ElementTheme` to accept a `Theme` object instead of a `darkTheme` boolean, allowing for more specific color mapping (e.g., setting `bgCanvasDefault` to `Color.Black` for the Black theme).
* Update `AdvancedSettingsPresenter` and `AdvancedSettingsState` to include "Black" as a user-selectable theme option.
* Adjust `ElementThemeApp` and `MaterialTextPreview` to handle the expanded theme selection.
* Add `ElementPreviewBlack` and update existing preview components to support the new theme.
* Update Konsist tests to ensure `@PreviewsDayNight` annotated functions don't have "BlackPreview" suffix.
This commit is contained in:
Timur Gilfanov 2026-03-23 15:26:16 +04:00
parent fdbe518db3
commit a96c146d30
23 changed files with 121 additions and 36 deletions

View file

@ -26,6 +26,7 @@ import androidx.compose.ui.semantics.Role
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.theme.Theme
import io.element.android.features.messages.impl.timeline.components.event.TimelineItemAspectRatioBox
import io.element.android.libraries.designsystem.components.blurhash.blurHashBackground
import io.element.android.libraries.designsystem.preview.ElementPreview
@ -49,7 +50,7 @@ fun ProtectedView(
.background(Color(0x99000000)),
contentAlignment = Alignment.Center,
) {
ElementTheme(darkTheme = false, applySystemBarsUpdate = false) {
ElementTheme(theme = Theme.Light, applySystemBarsUpdate = false) {
// Not using a button to be able to have correct size
Text(
modifier = Modifier