feat(splash+icon): фон иконки-градиент под тему + темо-зависимый сплэш

- Подложка adaptive-иконки: градиент под акцент темы + радиальное свечение + мягкая
  тень от логотипа (ic_bg_<тема>, было плоским цветом). Иконку-лого не трогал.
- Сплэш под выбранную тему: системный сплэш Android 12+ нельзя перекрасить под выбор
  пользователя (alias-тема на ColorOS игнорится), поэтому системный = просто тёмный
  (splash_transparent), а красивый сплэш рисуем сами на Compose (SplashOverlay):
  3D-лого + акцентное свечение + тень + анимация, цвет берём из текущей темы.
- Тему на старте читаем синхронно из SharedPreferences (мгновенно, без блокировки кадра).
- Ускорен холодный старт до первого кадра 1.48с→1.11с: сплэш рисуется на первом
  дешёвом кадре, тяжёлый контент (ViewModels/плеер) композится под ним; старт
  PlayerService уведён с критического пути. Остаток — оверхед debug-сборки.
This commit is contained in:
nk
2026-06-07 16:57:01 +03:00
parent 01729e0a52
commit d63c1d4187
40 changed files with 293 additions and 29 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Прозрачная «иконка» системного сплэша: на холодном старте показываем только
тёмный фон (без зелёной R), а тематический логотип со свечением рисуем сами
поверх на Compose (SplashOverlay), когда уже знаем выбранную тему. -->
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<size android:width="1dp" android:height="1dp" />
</shape>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_forest" />
<background android:drawable="@drawable/ic_bg_forest" />
<foreground android:drawable="@drawable/ic_fg_forest" />
<monochrome android:drawable="@drawable/ic_fg_forest" />
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_amber"/>
<background android:drawable="@drawable/ic_bg_amber"/>
<foreground android:drawable="@drawable/ic_fg_amber"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_amber"/>
<background android:drawable="@drawable/ic_bg_amber"/>
<foreground android:drawable="@drawable/ic_fg_amber"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_amethyst"/>
<background android:drawable="@drawable/ic_bg_amethyst"/>
<foreground android:drawable="@drawable/ic_fg_amethyst"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_amethyst"/>
<background android:drawable="@drawable/ic_bg_amethyst"/>
<foreground android:drawable="@drawable/ic_fg_amethyst"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_forest"/>
<background android:drawable="@drawable/ic_bg_forest"/>
<foreground android:drawable="@drawable/ic_fg_forest"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_forest"/>
<background android:drawable="@drawable/ic_bg_forest"/>
<foreground android:drawable="@drawable/ic_fg_forest"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_ice"/>
<background android:drawable="@drawable/ic_bg_ice"/>
<foreground android:drawable="@drawable/ic_fg_ice"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_ice"/>
<background android:drawable="@drawable/ic_bg_ice"/>
<foreground android:drawable="@drawable/ic_fg_ice"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_neon"/>
<background android:drawable="@drawable/ic_bg_neon"/>
<foreground android:drawable="@drawable/ic_fg_neon"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_neon"/>
<background android:drawable="@drawable/ic_bg_neon"/>
<foreground android:drawable="@drawable/ic_fg_neon"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_ocean"/>
<background android:drawable="@drawable/ic_bg_ocean"/>
<foreground android:drawable="@drawable/ic_fg_ocean"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_ocean"/>
<background android:drawable="@drawable/ic_bg_ocean"/>
<foreground android:drawable="@drawable/ic_fg_ocean"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_rose"/>
<background android:drawable="@drawable/ic_bg_rose"/>
<foreground android:drawable="@drawable/ic_fg_rose"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_rose"/>
<background android:drawable="@drawable/ic_bg_rose"/>
<foreground android:drawable="@drawable/ic_fg_rose"/>
</adaptive-icon>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_forest" />
<background android:drawable="@drawable/ic_bg_forest" />
<foreground android:drawable="@drawable/ic_fg_forest" />
<monochrome android:drawable="@drawable/ic_fg_forest" />
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_sunset"/>
<background android:drawable="@drawable/ic_bg_sunset"/>
<foreground android:drawable="@drawable/ic_fg_sunset"/>
</adaptive-icon>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_bg_sunset"/>
<background android:drawable="@drawable/ic_bg_sunset"/>
<foreground android:drawable="@drawable/ic_fg_sunset"/>
</adaptive-icon>

View File

@@ -11,7 +11,53 @@
тёмный фон + наша иконка, затем переход в основную тему. -->
<style name="Theme.Radiola.Splash" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/brand_bg</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo</item>
<!-- Прозрачная иконка: системный сплэш = только тёмный фон (без зелёной R).
Тематический логотип со свечением рисуем сами (SplashOverlay) — система
на Android 12+ не даёт менять иконку сплэша под выбранную тему. -->
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_transparent</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<!-- Сплэш под каждую тему (задаётся через android:theme нужного activity-alias).
Активен alias текущей темы → холодный старт показывает её цвет и лого. -->
<style name="Theme.Radiola.Splash.Forest" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_forest</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_forest</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<style name="Theme.Radiola.Splash.Ocean" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_ocean</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_ocean</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<style name="Theme.Radiola.Splash.Sunset" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_sunset</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_sunset</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<style name="Theme.Radiola.Splash.Amethyst" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_amethyst</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_amethyst</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<style name="Theme.Radiola.Splash.Neon" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_neon</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_neon</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<style name="Theme.Radiola.Splash.Amber" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_amber</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_amber</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<style name="Theme.Radiola.Splash.Ice" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_ice</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_ice</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
<style name="Theme.Radiola.Splash.Rose" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/ic_bg_rose</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_logo_rose</item>
<item name="postSplashScreenTheme">@style/Theme.Radiola</item>
</style>
</resources>