GradientFloatingActionButton use textActionAccent for enterprise build.
This commit is contained in:
committed by
Benoit Marty
parent
846201df78
commit
5dcc13236b
@@ -36,10 +36,12 @@ import androidx.compose.ui.graphics.Shape
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.unit.dp
|
||||
import io.element.android.compound.annotations.CoreColorToken
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
import io.element.android.compound.tokens.generated.CompoundIcons
|
||||
import io.element.android.compound.tokens.generated.internal.LightColorTokens
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
import io.element.android.libraries.designsystem.theme.LocalIsEnterpriseBuild
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
|
||||
@OptIn(CoreColorToken::class)
|
||||
@@ -50,6 +52,16 @@ fun GradientFloatingActionButton(
|
||||
shape: Shape = RoundedCornerShape(25),
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
val color1 = if (LocalIsEnterpriseBuild.current) {
|
||||
ElementTheme.colors.textActionAccent
|
||||
} else {
|
||||
LightColorTokens.colorGreen700
|
||||
}
|
||||
val color2 = if (LocalIsEnterpriseBuild.current) {
|
||||
ElementTheme.colors.textActionAccent
|
||||
} else {
|
||||
LightColorTokens.colorBlue900
|
||||
}
|
||||
val linearShaderBrush = remember {
|
||||
object : ShaderBrush() {
|
||||
override fun createShader(size: Size): Shader {
|
||||
@@ -57,8 +69,8 @@ fun GradientFloatingActionButton(
|
||||
from = Offset(size.width, size.height),
|
||||
to = Offset(size.width, 0f),
|
||||
colors = listOf(
|
||||
LightColorTokens.colorBlue900,
|
||||
LightColorTokens.colorGreen700,
|
||||
color2,
|
||||
color1,
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -71,8 +83,8 @@ fun GradientFloatingActionButton(
|
||||
center = size.center,
|
||||
radius = size.width / 2,
|
||||
colors = listOf(
|
||||
LightColorTokens.colorGreen700,
|
||||
LightColorTokens.colorBlue900,
|
||||
color1,
|
||||
color2,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user