mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-05 22:36:34 +00:00
feat(healthchat): drop Element links, labs, bug reports and location sharing
Bloom gradient fades the brand blue instead of Compound's green.
This commit is contained in:
+23
-1
@@ -12,6 +12,7 @@ import androidx.compose.ui.graphics.Color
|
||||
import dev.zacsweers.metro.AppScope
|
||||
import dev.zacsweers.metro.ContributesBinding
|
||||
import io.element.android.compound.colors.SemanticColorsLightDark
|
||||
import io.element.android.compound.tokens.generated.SemanticColors
|
||||
import io.element.android.features.enterprise.api.BugReportUrl
|
||||
import io.element.android.features.enterprise.api.EnterpriseService
|
||||
import io.element.android.libraries.androidutils.json.JsonProvider
|
||||
@@ -64,7 +65,7 @@ class DefaultEnterpriseService(
|
||||
}
|
||||
|
||||
override fun semanticColorsFlow(sessionId: SessionId?): Flow<SemanticColorsLightDark> {
|
||||
return flowOf(SemanticColorsLightDark.default)
|
||||
return flowOf(healthChatSemanticColors)
|
||||
}
|
||||
|
||||
override fun firebasePushGateway(): String? = null
|
||||
@@ -77,6 +78,27 @@ class DefaultEnterpriseService(
|
||||
override fun getNoisyNotificationChannelId(sessionId: SessionId): String? = null
|
||||
}
|
||||
|
||||
/** HealthChat brand blue, the launcher background colour. */
|
||||
private val healthChatBrandBlue = Color(0xFF12325C)
|
||||
|
||||
/**
|
||||
* The subtle gradient (home screen bloom, highlighted timeline item) fades the brand blue out at the
|
||||
* opacities Compound uses for its green stops; stop 6 stays transparent. Every other token, including the
|
||||
* accent colours, is Compound's default: only the bloom changes.
|
||||
*/
|
||||
private fun SemanticColors.withHealthChatBloom() = copy(
|
||||
gradientSubtleStop1 = healthChatBrandBlue.copy(alpha = 0.41f),
|
||||
gradientSubtleStop2 = healthChatBrandBlue.copy(alpha = 0.23f),
|
||||
gradientSubtleStop3 = healthChatBrandBlue.copy(alpha = 0.11f),
|
||||
gradientSubtleStop4 = healthChatBrandBlue.copy(alpha = 0.06f),
|
||||
gradientSubtleStop5 = healthChatBrandBlue.copy(alpha = 0.03f),
|
||||
)
|
||||
|
||||
internal val healthChatSemanticColors = SemanticColorsLightDark(
|
||||
light = SemanticColorsLightDark.default.light.withHealthChatBloom(),
|
||||
dark = SemanticColorsLightDark.default.dark.withHealthChatBloom(),
|
||||
)
|
||||
|
||||
/**
|
||||
* HealthChat is locked to its own homeserver: this is the only account provider users can sign in to.
|
||||
*/
|
||||
|
||||
+15
-2
@@ -8,6 +8,7 @@
|
||||
|
||||
package io.element.android.features.enterprise.impl
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import app.cash.turbine.test
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import io.element.android.compound.colors.SemanticColorsLightDark
|
||||
@@ -23,6 +24,7 @@ import io.element.android.libraries.matrix.test.accountprovider.anAccountProvide
|
||||
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||
import io.element.android.tests.testutils.lambda.value
|
||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import kotlinx.serialization.json.Json
|
||||
@@ -61,11 +63,22 @@ class DefaultEnterpriseServiceTest {
|
||||
val defaultEnterpriseService = createDefaultEnterpriseService()
|
||||
defaultEnterpriseService.semanticColorsFlow(null).test {
|
||||
val initialState = awaitItem()
|
||||
assertThat(initialState).isEqualTo(SemanticColorsLightDark.default)
|
||||
assertThat(initialState).isEqualTo(healthChatSemanticColors)
|
||||
awaitComplete()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `semanticColorsFlow only changes the subtle gradient to the HealthChat blue`() = runTest {
|
||||
val colors = createDefaultEnterpriseService().semanticColorsFlow(null).first()
|
||||
val default = SemanticColorsLightDark.default
|
||||
assertThat(colors.light.gradientSubtleStop1).isEqualTo(Color(0xFF12325C).copy(alpha = 0.41f))
|
||||
assertThat(colors.dark.gradientSubtleStop5).isEqualTo(Color(0xFF12325C).copy(alpha = 0.03f))
|
||||
assertThat(colors.light.gradientSubtleStop6).isEqualTo(default.light.gradientSubtleStop6)
|
||||
assertThat(colors.light.bgAccentRest).isEqualTo(default.light.bgAccentRest)
|
||||
assertThat(colors.dark.bgAccentRest).isEqualTo(default.dark.bgAccentRest)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `brandColorsFlow always emits null`() = runTest {
|
||||
val defaultEnterpriseService = createDefaultEnterpriseService()
|
||||
@@ -81,7 +94,7 @@ class DefaultEnterpriseServiceTest {
|
||||
val defaultEnterpriseService = createDefaultEnterpriseService()
|
||||
defaultEnterpriseService.semanticColorsFlow(A_SESSION_ID).test {
|
||||
val initialState = awaitItem()
|
||||
assertThat(initialState).isEqualTo(SemanticColorsLightDark.default)
|
||||
assertThat(initialState).isEqualTo(healthChatSemanticColors)
|
||||
awaitComplete()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user