Skip to content

Commit 3f6ec44

Browse files
authored
Merge pull request #5626 from element-hq/bma/brandColor
Fix issue on brand color override
2 parents 38448f7 + a7ffe80 commit 3f6ec44

File tree

9 files changed

+50
-10
lines changed

9 files changed

+50
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=element-x-android&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=element-x-android)
33
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=element-x-android&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=element-x-android)
44
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=element-x-android&metric=bugs)](https://sonarcloud.io/summary/new_code?id=element-x-android)
5-
[![codecov](https://codecov.io/github/element-hq/element-x-android/branch/develop/graph/badge.svg?token=ecwvia7amV)](https://codecov.io/github/vector-im/element-x-android)
5+
[![codecov](https://codecov.io/github/element-hq/element-x-android/branch/develop/graph/badge.svg?token=ecwvia7amV)](https://codecov.io/github/element-hq/element-x-android)
66
[![Element X Android Matrix room #element-x-android:matrix.org](https://img.shields.io/matrix/element-x-android:matrix.org.svg?label=%23element-x-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#element-x-android:matrix.org)
77
[![Localazy](https://img.shields.io/endpoint?url=https%3A%2F%2Fconnect.localazy.com%2Fstatus%2Felement%2Fdata%3Fcontent%3Dall%26title%3Dlocalazy%26logo%3Dtrue)](https://localazy.com/p/element)
88

enterprise

features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenter.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import androidx.compose.runtime.remember
2121
import androidx.compose.runtime.rememberCoroutineScope
2222
import androidx.compose.runtime.setValue
2323
import androidx.compose.runtime.snapshots.SnapshotStateList
24+
import androidx.compose.ui.graphics.toArgb
2425
import dev.zacsweers.metro.Inject
2526
import io.element.android.features.enterprise.api.EnterpriseService
2627
import io.element.android.features.preferences.impl.developer.tracing.toLogLevel
@@ -140,7 +141,11 @@ class DeveloperSettingsPresenter(
140141
}
141142
is DeveloperSettingsEvents.ChangeBrandColor -> coroutineScope.launch {
142143
showColorPicker = false
143-
val color = event.color?.value?.toHexString(HexFormat.UpperCase)?.substring(2, 8)
144+
val color = event.color
145+
?.toArgb()
146+
?.toHexString(HexFormat.UpperCase)
147+
?.substring(2, 8)
148+
?.padStart(7, '#')
144149
enterpriseService.overrideBrandColor(sessionId, color)
145150
}
146151
is DeveloperSettingsEvents.SetShowColorPicker -> {

features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/developer/DeveloperSettingsPresenterTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class DeveloperSettingsPresenterTest {
208208
assertThat(awaitItem().showColorPicker).isFalse()
209209
skipItems(1)
210210
overrideBrandColorResult.assertions().isCalledOnce()
211-
.with(value(A_SESSION_ID), value("00FF00"))
211+
.with(value(A_SESSION_ID), value("#00FF00"))
212212
}
213213
}
214214

libraries/compound/src/main/assets/theme.iife.js

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Files inside this package are generated automatically from the Compound project (https://github.com/vector-im/compound-design-tokens) and will be batch-replaced when new tokens are generated.
1+
Files inside this package are generated automatically from the Compound project (https://github.com/element-hq/compound-design-tokens) and will be batch-replaced when new tokens are generated.

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/auth/RustHomeServerLoginCompatibilityChecker.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ package io.element.android.libraries.matrix.impl.auth
1010

1111
import dev.zacsweers.metro.AppScope
1212
import dev.zacsweers.metro.ContributesBinding
13-
import dev.zacsweers.metro.Inject
1413
import io.element.android.libraries.core.extensions.runCatchingExceptions
1514
import io.element.android.libraries.matrix.api.auth.HomeServerLoginCompatibilityChecker
1615
import io.element.android.libraries.matrix.impl.ClientBuilderProvider
1716
import io.element.android.libraries.matrix.impl.certificates.UserCertificatesProvider
1817
import timber.log.Timber
1918

2019
@ContributesBinding(AppScope::class)
21-
@Inject
2220
class RustHomeServerLoginCompatibilityChecker(
2321
private val clientBuilderProvider: ClientBuilderProvider,
2422
private val userCertificatesProvider: UserCertificatesProvider,

tests/konsist/src/test/kotlin/io/element/android/tests/konsist/KonsistDiTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import com.lemonappdev.konsist.api.verify.assertTrue
1616
import dev.zacsweers.metro.Assisted
1717
import dev.zacsweers.metro.ContributesBinding
1818
import dev.zacsweers.metro.Inject
19-
import org.junit.Ignore
2019
import org.junit.Test
2120

2221
class KonsistDiTest {
@@ -37,7 +36,6 @@ class KonsistDiTest {
3736
}
3837
}
3938

40-
@Ignore("Disabled to give time to branch and private module to remove the annotation")
4139
@Test
4240
fun `class annotated with @ContributesBinding does not need to be annotated with @Inject anymore`() {
4341
Konsist

tools/compound/import_tokens.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ if [ -d tmpCompound ]; then
2727
fi
2828
mkdir tmpCompound
2929
pushd tmpCompound
30-
git clone --branch "${BRANCH}" https://github.com/vector-im/compound-design-tokens
30+
git clone --branch "${BRANCH}" https://github.com/element-hq/compound-design-tokens
3131

3232
echo "Copying files from tokens repository..."
3333
rm -R ../libraries/compound/src/main/res/drawable
3434
cp -R compound-design-tokens/assets/android/res/drawable ../libraries/compound/src/main/res/
3535
cp -R compound-design-tokens/assets/android/src/* ../libraries/compound/src/main/kotlin/io/element/android/compound/tokens/generated/
36+
cp -R compound-design-tokens/assets/android/res/theme.iife.js ../libraries/compound/src/main/assets/theme.iife.js
3637
popd
3738

3839
echo "Adding autoMirrored attribute..."

0 commit comments

Comments
 (0)