Merge pull request #5626 from element-hq/bma/brandColor
Fix issue on brand color override
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
[](https://sonarcloud.io/summary/new_code?id=element-x-android)
|
||||
[](https://sonarcloud.io/summary/new_code?id=element-x-android)
|
||||
[](https://sonarcloud.io/summary/new_code?id=element-x-android)
|
||||
[](https://codecov.io/github/vector-im/element-x-android)
|
||||
[](https://codecov.io/github/element-hq/element-x-android)
|
||||
[](https://matrix.to/#/#element-x-android:matrix.org)
|
||||
[](https://localazy.com/p/element)
|
||||
|
||||
|
||||
Submodule enterprise updated: 87a96ca96b...6207ddc1cb
@@ -21,6 +21,7 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.runtime.snapshots.SnapshotStateList
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import dev.zacsweers.metro.Inject
|
||||
import io.element.android.features.enterprise.api.EnterpriseService
|
||||
import io.element.android.features.preferences.impl.developer.tracing.toLogLevel
|
||||
@@ -140,7 +141,11 @@ class DeveloperSettingsPresenter(
|
||||
}
|
||||
is DeveloperSettingsEvents.ChangeBrandColor -> coroutineScope.launch {
|
||||
showColorPicker = false
|
||||
val color = event.color?.value?.toHexString(HexFormat.UpperCase)?.substring(2, 8)
|
||||
val color = event.color
|
||||
?.toArgb()
|
||||
?.toHexString(HexFormat.UpperCase)
|
||||
?.substring(2, 8)
|
||||
?.padStart(7, '#')
|
||||
enterpriseService.overrideBrandColor(sessionId, color)
|
||||
}
|
||||
is DeveloperSettingsEvents.SetShowColorPicker -> {
|
||||
|
||||
@@ -208,7 +208,7 @@ class DeveloperSettingsPresenterTest {
|
||||
assertThat(awaitItem().showColorPicker).isFalse()
|
||||
skipItems(1)
|
||||
overrideBrandColorResult.assertions().isCalledOnce()
|
||||
.with(value(A_SESSION_ID), value("00FF00"))
|
||||
.with(value(A_SESSION_ID), value("#00FF00"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
38
libraries/compound/src/main/assets/theme.iife.js
Normal file
38
libraries/compound/src/main/assets/theme.iife.js
Normal file
File diff suppressed because one or more lines are too long
@@ -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.
|
||||
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.
|
||||
|
||||
@@ -10,7 +10,6 @@ package io.element.android.libraries.matrix.impl.auth
|
||||
|
||||
import dev.zacsweers.metro.AppScope
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
import dev.zacsweers.metro.Inject
|
||||
import io.element.android.libraries.core.extensions.runCatchingExceptions
|
||||
import io.element.android.libraries.matrix.api.auth.HomeServerLoginCompatibilityChecker
|
||||
import io.element.android.libraries.matrix.impl.ClientBuilderProvider
|
||||
@@ -18,7 +17,6 @@ import io.element.android.libraries.matrix.impl.certificates.UserCertificatesPro
|
||||
import timber.log.Timber
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
@Inject
|
||||
class RustHomeServerLoginCompatibilityChecker(
|
||||
private val clientBuilderProvider: ClientBuilderProvider,
|
||||
private val userCertificatesProvider: UserCertificatesProvider,
|
||||
|
||||
@@ -16,7 +16,6 @@ import com.lemonappdev.konsist.api.verify.assertTrue
|
||||
import dev.zacsweers.metro.Assisted
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
import dev.zacsweers.metro.Inject
|
||||
import org.junit.Ignore
|
||||
import org.junit.Test
|
||||
|
||||
class KonsistDiTest {
|
||||
@@ -37,7 +36,6 @@ class KonsistDiTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("Disabled to give time to branch and private module to remove the annotation")
|
||||
@Test
|
||||
fun `class annotated with @ContributesBinding does not need to be annotated with @Inject anymore`() {
|
||||
Konsist
|
||||
|
||||
@@ -27,12 +27,13 @@ if [ -d tmpCompound ]; then
|
||||
fi
|
||||
mkdir tmpCompound
|
||||
pushd tmpCompound
|
||||
git clone --branch "${BRANCH}" https://github.com/vector-im/compound-design-tokens
|
||||
git clone --branch "${BRANCH}" https://github.com/element-hq/compound-design-tokens
|
||||
|
||||
echo "Copying files from tokens repository..."
|
||||
rm -R ../libraries/compound/src/main/res/drawable
|
||||
cp -R compound-design-tokens/assets/android/res/drawable ../libraries/compound/src/main/res/
|
||||
cp -R compound-design-tokens/assets/android/src/* ../libraries/compound/src/main/kotlin/io/element/android/compound/tokens/generated/
|
||||
cp -R compound-design-tokens/assets/android/res/theme.iife.js ../libraries/compound/src/main/assets/theme.iife.js
|
||||
popd
|
||||
|
||||
echo "Adding autoMirrored attribute..."
|
||||
|
||||
Reference in New Issue
Block a user