Merge pull request #5626 from element-hq/bma/brandColor
Fix issue on brand color override
This commit is contained in:
commit
bfbb1c74ee
9 changed files with 50 additions and 10 deletions
|
|
@ -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://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://matrix.to/#/#element-x-android:matrix.org)
|
||||||
[](https://localazy.com/p/element)
|
[](https://localazy.com/p/element)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 87a96ca96b08c2074f3a95f8040b3acf5529b99d
|
Subproject commit 6207ddc1cb7dac7fdb6212c0158497a1d9752c75
|
||||||
|
|
@ -21,6 +21,7 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.runtime.snapshots.SnapshotStateList
|
import androidx.compose.runtime.snapshots.SnapshotStateList
|
||||||
|
import androidx.compose.ui.graphics.toArgb
|
||||||
import dev.zacsweers.metro.Inject
|
import dev.zacsweers.metro.Inject
|
||||||
import io.element.android.features.enterprise.api.EnterpriseService
|
import io.element.android.features.enterprise.api.EnterpriseService
|
||||||
import io.element.android.features.preferences.impl.developer.tracing.toLogLevel
|
import io.element.android.features.preferences.impl.developer.tracing.toLogLevel
|
||||||
|
|
@ -140,7 +141,11 @@ class DeveloperSettingsPresenter(
|
||||||
}
|
}
|
||||||
is DeveloperSettingsEvents.ChangeBrandColor -> coroutineScope.launch {
|
is DeveloperSettingsEvents.ChangeBrandColor -> coroutineScope.launch {
|
||||||
showColorPicker = false
|
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)
|
enterpriseService.overrideBrandColor(sessionId, color)
|
||||||
}
|
}
|
||||||
is DeveloperSettingsEvents.SetShowColorPicker -> {
|
is DeveloperSettingsEvents.SetShowColorPicker -> {
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ class DeveloperSettingsPresenterTest {
|
||||||
assertThat(awaitItem().showColorPicker).isFalse()
|
assertThat(awaitItem().showColorPicker).isFalse()
|
||||||
skipItems(1)
|
skipItems(1)
|
||||||
overrideBrandColorResult.assertions().isCalledOnce()
|
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.AppScope
|
||||||
import dev.zacsweers.metro.ContributesBinding
|
import dev.zacsweers.metro.ContributesBinding
|
||||||
import dev.zacsweers.metro.Inject
|
|
||||||
import io.element.android.libraries.core.extensions.runCatchingExceptions
|
import io.element.android.libraries.core.extensions.runCatchingExceptions
|
||||||
import io.element.android.libraries.matrix.api.auth.HomeServerLoginCompatibilityChecker
|
import io.element.android.libraries.matrix.api.auth.HomeServerLoginCompatibilityChecker
|
||||||
import io.element.android.libraries.matrix.impl.ClientBuilderProvider
|
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
|
import timber.log.Timber
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
|
||||||
class RustHomeServerLoginCompatibilityChecker(
|
class RustHomeServerLoginCompatibilityChecker(
|
||||||
private val clientBuilderProvider: ClientBuilderProvider,
|
private val clientBuilderProvider: ClientBuilderProvider,
|
||||||
private val userCertificatesProvider: UserCertificatesProvider,
|
private val userCertificatesProvider: UserCertificatesProvider,
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import com.lemonappdev.konsist.api.verify.assertTrue
|
||||||
import dev.zacsweers.metro.Assisted
|
import dev.zacsweers.metro.Assisted
|
||||||
import dev.zacsweers.metro.ContributesBinding
|
import dev.zacsweers.metro.ContributesBinding
|
||||||
import dev.zacsweers.metro.Inject
|
import dev.zacsweers.metro.Inject
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class KonsistDiTest {
|
class KonsistDiTest {
|
||||||
|
|
@ -37,7 +36,6 @@ class KonsistDiTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Ignore("Disabled to give time to branch and private module to remove the annotation")
|
|
||||||
@Test
|
@Test
|
||||||
fun `class annotated with @ContributesBinding does not need to be annotated with @Inject anymore`() {
|
fun `class annotated with @ContributesBinding does not need to be annotated with @Inject anymore`() {
|
||||||
Konsist
|
Konsist
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,13 @@ if [ -d tmpCompound ]; then
|
||||||
fi
|
fi
|
||||||
mkdir tmpCompound
|
mkdir tmpCompound
|
||||||
pushd 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..."
|
echo "Copying files from tokens repository..."
|
||||||
rm -R ../libraries/compound/src/main/res/drawable
|
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/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/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
|
popd
|
||||||
|
|
||||||
echo "Adding autoMirrored attribute..."
|
echo "Adding autoMirrored attribute..."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue