mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
use the proper logo
This commit is contained in:
7 files changed
+67
-202
No files matched your search
@@ -464,54 +464,59 @@ data class ColorPalette(
|
||||
val innerColors: List<Pair<Float, Color>>,
|
||||
)
|
||||
|
||||
data class BrandPalette(
|
||||
data class AnimatedIconSpec(
|
||||
val lightPalette: ColorPalette,
|
||||
val darkPalette: ColorPalette,
|
||||
|
||||
@param:DrawableRes val innerId: Int,
|
||||
@param:DrawableRes val outerId: Int,
|
||||
)
|
||||
|
||||
data class BrandPalette(
|
||||
@param:DrawableRes val darkLogo: Int,
|
||||
@param:DrawableRes val lightLogo: Int,
|
||||
|
||||
@param:StringRes val title: Int,
|
||||
val titleFont: TextStyle,
|
||||
val animatedIcon: AnimatedIconSpec? = null,
|
||||
)
|
||||
|
||||
val geodeColorPalette = BrandPalette(
|
||||
lightPalette = ColorPalette(
|
||||
outerColors = listOf(
|
||||
0.0f to Color(0xfff5b11d),
|
||||
0.10f to Color(0xfff0834d),
|
||||
0.24f to Color(0xffe85f6b),
|
||||
0.49f to Color(0xffc9659e),
|
||||
1.0f to Color(0xffb9588f)
|
||||
animatedIcon = AnimatedIconSpec(
|
||||
lightPalette = ColorPalette(
|
||||
outerColors = listOf(
|
||||
0.0f to Color(0xfff5b11d),
|
||||
0.10f to Color(0xfff0834d),
|
||||
0.24f to Color(0xffe85f6b),
|
||||
0.49f to Color(0xffc9659e),
|
||||
1.0f to Color(0xffb9588f)
|
||||
),
|
||||
innerColors = listOf(
|
||||
0.48f to Color(0xfff2ce00),
|
||||
0.63f to Color(0xfff4b97e),
|
||||
0.73f to Color(0xfff7b66a),
|
||||
1.0f to Color(0xffeb8fac)
|
||||
)
|
||||
),
|
||||
innerColors = listOf(
|
||||
0.48f to Color(0xfff2ce00),
|
||||
0.63f to Color(0xfff4b97e),
|
||||
0.73f to Color(0xfff7b66a),
|
||||
1.0f to Color(0xffeb8fac)
|
||||
)
|
||||
),
|
||||
darkPalette = ColorPalette(
|
||||
outerColors = listOf(
|
||||
0.0f to Color(0xfffffdff),
|
||||
0.08f to Color(0xffF2EAF5),
|
||||
0.12f to Color(0xffEDE5EF),
|
||||
0.31f to Color(0xffCDB5CD),
|
||||
0.49f to Color(0xffBA9BBC),
|
||||
1.0f to Color(0xff8D7ACF),
|
||||
darkPalette = ColorPalette(
|
||||
outerColors = listOf(
|
||||
0.0f to Color(0xfffffdff),
|
||||
0.08f to Color(0xffF2EAF5),
|
||||
0.12f to Color(0xffEDE5EF),
|
||||
0.31f to Color(0xffCDB5CD),
|
||||
0.49f to Color(0xffBA9BBC),
|
||||
1.0f to Color(0xff8D7ACF),
|
||||
),
|
||||
innerColors = listOf(
|
||||
0.48f to Color(0xffffffff),
|
||||
0.63f to Color(0xfff5e4c2),
|
||||
0.73f to Color(0xffe5c7ad),
|
||||
1.0f to Color(0xffb790a9),
|
||||
)
|
||||
),
|
||||
innerColors = listOf(
|
||||
0.48f to Color(0xffffffff),
|
||||
0.63f to Color(0xfff5e4c2),
|
||||
0.73f to Color(0xffe5c7ad),
|
||||
1.0f to Color(0xffb790a9),
|
||||
)
|
||||
innerId = R.drawable.geode_monochrome_inner,
|
||||
outerId = R.drawable.geode_monochrome_outer,
|
||||
),
|
||||
innerId = R.drawable.geode_monochrome_inner,
|
||||
outerId = R.drawable.geode_monochrome_outer,
|
||||
darkLogo = R.drawable.geode_base,
|
||||
lightLogo = R.drawable.geode_base_light,
|
||||
title = R.string.launcher_title,
|
||||
@@ -519,42 +524,8 @@ val geodeColorPalette = BrandPalette(
|
||||
)
|
||||
|
||||
val sapphireColorPalette = BrandPalette(
|
||||
lightPalette = ColorPalette(
|
||||
outerColors = listOf(
|
||||
0.0f to Color(0xff906FFF),
|
||||
0.08f to Color(0xff9E81FF),
|
||||
0.12f to Color(0xffAB8DFF),
|
||||
0.31f to Color(0xffBE89FF),
|
||||
0.49f to Color(0xff979BD7),
|
||||
1.0f to Color(0xff558DDA),
|
||||
),
|
||||
innerColors = listOf(
|
||||
0.48f to Color(0xffFFB65C),
|
||||
0.63f to Color(0xffFFADA4),
|
||||
0.73f to Color(0xffF0A3A4),
|
||||
1.0f to Color(0xffD066A6),
|
||||
)
|
||||
),
|
||||
darkPalette = ColorPalette(
|
||||
outerColors = listOf(
|
||||
0.0f to Color(0xfffffdff),
|
||||
0.08f to Color(0xffF2EAF5),
|
||||
0.12f to Color(0xffEDE5EF),
|
||||
0.31f to Color(0xffC0B5CD),
|
||||
0.49f to Color(0xff9B9DBC),
|
||||
1.0f to Color(0xff558DDA),
|
||||
),
|
||||
innerColors = listOf(
|
||||
0.48f to Color(0xffFFF9F5),
|
||||
0.63f to Color(0xffF2DCD3),
|
||||
0.73f to Color(0xffDBA7A8),
|
||||
1.0f to Color(0xffD066A6),
|
||||
)
|
||||
),
|
||||
innerId = R.drawable.sapphire_monochrome_inner,
|
||||
outerId = R.drawable.sapphire_monochrome_outer,
|
||||
darkLogo = R.drawable.sapphire_base,
|
||||
lightLogo = R.drawable.sapphire_base_light,
|
||||
darkLogo = R.drawable.sapphire_full,
|
||||
lightLogo = R.drawable.sapphire_full,
|
||||
title = R.string.application_icon_sapphire,
|
||||
titleFont = sapphireTitleStyle
|
||||
)
|
||||
@@ -616,11 +587,11 @@ fun SapphireLogoAnimatedPreview() {
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AnimatedLogo(modifier: Modifier = Modifier, basePalette: BrandPalette) {
|
||||
fun AnimatedLogo(modifier: Modifier = Modifier, spec: AnimatedIconSpec) {
|
||||
val theme = LocalTheme.current
|
||||
|
||||
val colorPalette = if (theme == LIGHT) basePalette.lightPalette
|
||||
else basePalette.darkPalette
|
||||
val colorPalette = if (theme == LIGHT) spec.lightPalette
|
||||
else spec.darkPalette
|
||||
|
||||
val innerColorPalette = colorPalette.innerColors
|
||||
val outerColorPalette = colorPalette.outerColors
|
||||
@@ -652,7 +623,7 @@ fun AnimatedLogo(modifier: Modifier = Modifier, basePalette: BrandPalette) {
|
||||
|
||||
Box(modifier = modifier) {
|
||||
Icon(
|
||||
painter = painterResource(basePalette.innerId),
|
||||
painter = painterResource(spec.innerId),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.graphicsLayer(compositingStrategy = CompositingStrategy.Offscreen)
|
||||
@@ -665,7 +636,7 @@ fun AnimatedLogo(modifier: Modifier = Modifier, basePalette: BrandPalette) {
|
||||
}
|
||||
)
|
||||
Icon(
|
||||
painter = painterResource(basePalette.outerId),
|
||||
painter = painterResource(spec.outerId),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.graphicsLayer(compositingStrategy = CompositingStrategy.Offscreen)
|
||||
@@ -689,21 +660,31 @@ fun GeodeLogo(modifier: Modifier = Modifier, shouldAnimate: Boolean = false, bas
|
||||
) {
|
||||
val theme = LocalTheme.current
|
||||
|
||||
Crossfade(
|
||||
targetState = shouldAnimate,
|
||||
animationSpec = tween(durationMillis = 1000, easing = FastOutSlowInEasing),
|
||||
label="logo fade"
|
||||
) { screen ->
|
||||
when (screen) {
|
||||
true -> AnimatedLogo(modifier = Modifier.size(64.dp, 64.dp), basePalette = basePalette)
|
||||
false -> Image(
|
||||
painterResource(if (theme == LIGHT)
|
||||
basePalette.lightLogo else basePalette.darkLogo
|
||||
),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(64.dp, 64.dp)
|
||||
)
|
||||
if (basePalette.animatedIcon != null) {
|
||||
Crossfade(
|
||||
targetState = shouldAnimate,
|
||||
animationSpec = tween(durationMillis = 1000, easing = FastOutSlowInEasing),
|
||||
label="logo fade"
|
||||
) { screen ->
|
||||
when (screen) {
|
||||
true -> AnimatedLogo(modifier = Modifier.size(64.dp, 64.dp), spec = basePalette.animatedIcon)
|
||||
false -> Image(
|
||||
painterResource(if (theme == LIGHT)
|
||||
basePalette.lightLogo else basePalette.darkLogo
|
||||
),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(64.dp, 64.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Image(
|
||||
painterResource(if (theme == LIGHT)
|
||||
basePalette.lightLogo else basePalette.darkLogo
|
||||
),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(84.dp, 84.dp)
|
||||
)
|
||||
}
|
||||
|
||||
Text(
|
||||
|
||||
Reference in new issue
Block a user