feat(brand): новый 3D-логотип (монограмма R) + лого/иконка под цветовую тему
Логотип: монограмма-R пользователя отрендерена в матовый 3D через routerai (gpt-5.4-image), один мастер перекрашен под 8 тем (recolor по яркости, форма идентична). - Внутри приложения: AppMark показывает перекрашенный 3D-логотип текущей палитры (LocalThemePalette + ThemePalette.logoRes, drawable logo_<тема>). - Иконка лаунчера следует теме: 8 adaptive-иконок (ic_fg_<тема> + ic_bg_<тема>) и 8 activity-alias в манифесте; LauncherIconManager включает alias выбранной темы, гасит остальные (ровно один активен, guard против лишних миганий). Переключение — в MainActivity по LaunchedEffect(paletteId). На ColorOS иконка может обновляться с задержкой — особенность системы. Скрипты генерации в design/logos (ключ routerai — вне репо, ~/.routerai_key).
This commit is contained in:
@@ -23,29 +23,19 @@ import androidx.compose.material3.Text
|
||||
fun brandGradient(): Brush = Brush.linearGradient(listOf(BrandGradientStart, BrandGradientEnd))
|
||||
|
||||
/**
|
||||
* Иконка-марка приложения: градиентный squircle с монограммой «R».
|
||||
* Марка приложения: объёмная 3D-монограмма «R», перекрашенная под текущую тему.
|
||||
*/
|
||||
@Composable
|
||||
fun AppMark(
|
||||
size: Dp = 76.dp,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val radius = (size.value * 0.29f).dp
|
||||
val colors = RadiolaTheme.colors
|
||||
Box(
|
||||
modifier = modifier
|
||||
.size(size)
|
||||
.clip(RoundedCornerShape(radius))
|
||||
.background(colors.brandGradient),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Text(
|
||||
text = "R",
|
||||
color = colors.bgBase,
|
||||
fontWeight = FontWeight.Black,
|
||||
fontSize = (size.value * 0.62f).sp
|
||||
)
|
||||
}
|
||||
val palette = RadiolaTheme.palette
|
||||
androidx.compose.foundation.Image(
|
||||
painter = androidx.compose.ui.res.painterResource(palette.logoRes),
|
||||
contentDescription = "radiOLA",
|
||||
modifier = modifier.size(size)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.radiola.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import com.radiola.R
|
||||
|
||||
/**
|
||||
* Цветовые темы приложения. radiOLA всегда тёмная — палитры различаются оттенком
|
||||
@@ -112,6 +113,19 @@ enum class ThemePalette(
|
||||
),
|
||||
;
|
||||
|
||||
/** Перекрашенный под эту тему 3D-логотип (drawable). */
|
||||
val logoRes: Int
|
||||
get() = when (this) {
|
||||
FOREST -> R.drawable.logo_forest
|
||||
OCEAN -> R.drawable.logo_ocean
|
||||
SUNSET -> R.drawable.logo_sunset
|
||||
AMETHYST -> R.drawable.logo_amethyst
|
||||
NEON -> R.drawable.logo_neon
|
||||
AMBER -> R.drawable.logo_amber
|
||||
ICE -> R.drawable.logo_ice
|
||||
ROSE -> R.drawable.logo_rose
|
||||
}
|
||||
|
||||
companion object {
|
||||
/** Палитра по сохранённому id (фолбэк — «Лес»). */
|
||||
fun fromId(id: String?): ThemePalette = entries.firstOrNull { it.id == id } ?: FOREST
|
||||
|
||||
@@ -33,10 +33,14 @@ data class RadiolaColors(
|
||||
|
||||
// По умолчанию — фирменная палитра «Лес».
|
||||
val LocalRadiolaColors = staticCompositionLocalOf { ThemePalette.FOREST.colors }
|
||||
// Текущая палитра целиком — чтобы лого/иконка выбирали свой перекрашенный вариант.
|
||||
val LocalThemePalette = staticCompositionLocalOf { ThemePalette.FOREST }
|
||||
|
||||
object RadiolaTheme {
|
||||
val colors: RadiolaColors
|
||||
@Composable get() = LocalRadiolaColors.current
|
||||
val palette: ThemePalette
|
||||
@Composable get() = LocalThemePalette.current
|
||||
}
|
||||
|
||||
// Material ColorScheme из наших токенов — чтобы Material-компоненты тоже следовали палитре.
|
||||
@@ -64,7 +68,10 @@ fun RadiolaTheme(
|
||||
) {
|
||||
// Приложение всегда тёмное; палитра выбирается пользователем.
|
||||
val colors = palette.colors
|
||||
CompositionLocalProvider(LocalRadiolaColors provides colors) {
|
||||
CompositionLocalProvider(
|
||||
LocalRadiolaColors provides colors,
|
||||
LocalThemePalette provides palette
|
||||
) {
|
||||
MaterialTheme(
|
||||
colorScheme = schemeOf(colors),
|
||||
typography = Typography,
|
||||
|
||||
Reference in New Issue
Block a user