GradientFloatingActionButton use textActionAccent for enterprise build.
This commit is contained in:
parent
846201df78
commit
5dcc13236b
1 changed files with 16 additions and 4 deletions
|
|
@ -36,10 +36,12 @@ import androidx.compose.ui.graphics.Shape
|
||||||
import androidx.compose.ui.graphics.graphicsLayer
|
import androidx.compose.ui.graphics.graphicsLayer
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import io.element.android.compound.annotations.CoreColorToken
|
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.CompoundIcons
|
||||||
import io.element.android.compound.tokens.generated.internal.LightColorTokens
|
import io.element.android.compound.tokens.generated.internal.LightColorTokens
|
||||||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
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
|
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||||
|
|
||||||
@OptIn(CoreColorToken::class)
|
@OptIn(CoreColorToken::class)
|
||||||
|
|
@ -50,6 +52,16 @@ fun GradientFloatingActionButton(
|
||||||
shape: Shape = RoundedCornerShape(25),
|
shape: Shape = RoundedCornerShape(25),
|
||||||
content: @Composable () -> Unit,
|
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 {
|
val linearShaderBrush = remember {
|
||||||
object : ShaderBrush() {
|
object : ShaderBrush() {
|
||||||
override fun createShader(size: Size): Shader {
|
override fun createShader(size: Size): Shader {
|
||||||
|
|
@ -57,8 +69,8 @@ fun GradientFloatingActionButton(
|
||||||
from = Offset(size.width, size.height),
|
from = Offset(size.width, size.height),
|
||||||
to = Offset(size.width, 0f),
|
to = Offset(size.width, 0f),
|
||||||
colors = listOf(
|
colors = listOf(
|
||||||
LightColorTokens.colorBlue900,
|
color2,
|
||||||
LightColorTokens.colorGreen700,
|
color1,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -71,8 +83,8 @@ fun GradientFloatingActionButton(
|
||||||
center = size.center,
|
center = size.center,
|
||||||
radius = size.width / 2,
|
radius = size.width / 2,
|
||||||
colors = listOf(
|
colors = listOf(
|
||||||
LightColorTokens.colorGreen700,
|
color1,
|
||||||
LightColorTokens.colorBlue900,
|
color2,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue