Unofficial YouTube Music / Spotify Premium client for Android, built in Liquid Glass. Audio effects, Spotify Connect, listening history, 8 languages. Rust core on librespot.
Kotlin alternativeandroidandroid-applicationclientglassmorphisminnertubelibrespotliquid-glassspotifyspotify-connectspotifyapiyoutube-musicyoutube-playerytdlnis
One switch for animated covers, with Spotify or Apple Music as their source
Leloniof81af8af94f0
diff --git a/app/src/main/java/dev/lelonio/square/data/PreferencesStore.kt b/app/src/main/java/dev/lelonio/square/data/PreferencesStore.ktindex fba8f94..f5febea 100644--- a/app/src/main/java/dev/lelonio/square/data/PreferencesStore.kt+++ b/app/src/main/java/dev/lelonio/square/data/PreferencesStore.kt@@ -89,12 +89,13 @@ class PreferencesStore(context: Context) {private val _canvasEnabled = MutableStateFlow(prefs.getBoolean(KEY_CANVAS, true))/**- * Whether a track's looping clip is fetched and played at all.+ * Whether covers move at all, from either source; see [animatedCoverSource].** On by default: it is the thing the player is built around. Off is for the- * listener who wants the artwork and nothing moving — and it is not only a+ * listener who wants the artwork and nothing moving, and it is not only a* drawing decision, since with this off no clip is asked for and the data- * is not spent either.+ * is not spent either. Kept under its old key: whoever had Canvas off has+ * every moving cover off now, which is what they were asking for.*/val canvasEnabled: StateFlow<Boolean> = _canvasEnabled.asStateFlow()@@ -103,6 +104,26 @@ class PreferencesStore(context: Context) {prefs.edit().putBoolean(KEY_CANVAS, value).apply()}+ /** Where the moving covers come from; see [animatedCoverSource]. */+ enum class CoverSource { SPOTIFY, APPLE_MUSIC }++ private val _animatedCoverSource = MutableStateFlow(+ CoverSource.entries.firstOrNull { it.name == prefs.getString(KEY_COVER_SOURCE, null) } ?: CoverSource.SPOTIFY,+ )++ /**+ * Which catalogue's moving covers are shown: Spotify's Canvas clips or+ * Apple Music's animated artwork. One or the other, so turning Canvas+ * off no longer left some records moving anyway, as Apple's motion did+ * whenever there was no clip.+ */+ val animatedCoverSource: StateFlow<CoverSource> = _animatedCoverSource.asStateFlow()++ fun setAnimatedCoverSource(value: CoverSource) {+ _animatedCoverSource.value = value+ prefs.edit().putString(KEY_COVER_SOURCE, value.name).apply()+ }+private val _keepPlayingOnClose = MutableStateFlow(prefs.getBoolean(KEY_KEEP_PLAYING, false))/**@@ -277,6 +298,7 @@ class PreferencesStore(context: Context) {const val KEY_DEVICE_ID = "device_id"const val KEY_ONBOARDED = "onboarded"const val KEY_CANVAS = "canvas_enabled"+ const val KEY_COVER_SOURCE = "animated_cover_source"const val KEY_KEEP_PLAYING = "keep_playing_on_close"const val KEY_SPONSOR_BLOCK = "sponsor_block"const val KEY_AUTOPLAY_INFINITE = "autoplay_infinite"diff --git a/app/src/main/java/dev/lelonio/square/ui/SquareApp.kt b/app/src/main/java/dev/lelonio/square/ui/SquareApp.ktindex a4c2b1f..ef36dc8 100644--- a/app/src/main/java/dev/lelonio/square/ui/SquareApp.kt+++ b/app/src/main/java/dev/lelonio/square/ui/SquareApp.kt@@ -1018,8 +1018,9 @@ fun SquareApp(// Turned off, no clip is ever asked for — which is the point of the switch:// it saves the video as well as hiding it.val canvasEnabled by preferences.canvasEnabled.collectAsStateWithLifecycle()+ val coverSource by preferences.animatedCoverSource.collectAsStateWithLifecycle()- LaunchedEffect(playback.mediaId, backend, canvasEnabled, offlineNow) {+ LaunchedEffect(playback.mediaId, backend, canvasEnabled, coverSource, offlineNow) {val uri = playback.mediaIdcanvas = null// Offline means offline, including for the things that are only@@ -1028,6 +1029,7 @@ fun SquareApp(// that came down with the download.if (uri != null &&canvasEnabled &&+ coverSource == dev.lelonio.square.data.PreferencesStore.CoverSource.SPOTIFY &&backend == dev.lelonio.square.backend.BackendId.SPOTIFY) {// After the song, not beside it: a Canvas is a video, and fetching@@ -3038,7 +3040,12 @@ fun SquareApp(catalogPalette = nowPlayingArt?.inkPalette.orEmpty(),onClipColumns = { clipColumns = it },coverHeroUrl = nowPlayingArt?.heroUrl,- coverMotionUrl = nowPlayingArt?.motionUrl,+ // Apple's moving cover only when that is the+ // source chosen, and moving covers are on.+ coverMotionUrl = nowPlayingArt?.motionUrl.takeIf {+ canvasEnabled &&+ coverSource == dev.lelonio.square.data.PreferencesStore.CoverSource.APPLE_MUSIC+ },coverSquareUrl = nowPlayingArt?.coverUrl,// Spotify's cover is the fallback, not the// first draft: while the catalogue is stilldiff --git a/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.kt b/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.ktindex 8cb1541..7714479 100644--- a/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.kt+++ b/app/src/main/java/dev/lelonio/square/ui/settings/SettingsScreen.kt@@ -475,7 +475,8 @@ fun SettingsScreen(// Spotify's own, served by its access point: on another source there is// no clip to ask for and nothing this switch could turn off.- if (shown == SettingsPage.Playback && showSpotify) item("canvas") {+ // On either source: Apple's moving covers play over YouTube Music too.+ if (shown == SettingsPage.Playback) item("canvas") {CanvasSection(backdrop)}@@ -1302,6 +1303,7 @@ private fun CanvasSection(backdrop: Backdrop) {(context.applicationContext as dev.lelonio.square.SquareApplication).preferences}val enabled by store.canvasEnabled.collectAsStateWithLifecycle()+ val source by store.animatedCoverSource.collectAsStateWithLifecycle()Section(stringResource(R.string.canvas)) {DownloadSwitch(diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xmlindex 94dc24b..e889904 100644--- a/app/src/main/res/values-de/strings.xml+++ b/app/src/main/res/values-de/strings.xml@@ -465,8 +465,8 @@<string name="daylist_schedule">Wird alle paar Stunden aktualisiert</string><string name="daily_mix_schedule">Wird täglich aktualisiert</string><string name="weekly_schedule">Wird wöchentlich aktualisiert</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Loop-Clips zeigen</string>+ <string name="canvas">Animierte Cover</string>+ <string name="canvas_show">Animierte Cover anzeigen</string><string name="canvas_note">Das kurze Video, das manche Titel mitbringen. Aus wird es auch nicht geladen.</string><string name="show_all">Alle anzeigen</string><string name="show_less">Weniger anzeigen</string>@@ -542,4 +542,7 @@<string name="widget_description">Aktuelle Wiedergabe, Steuerung und deine letzten Playlists</string><string name="widget_nothing_playing">Es läuft nichts</string><string name="widget_open_app">Square öffnen</string>+ <string name="animated_cover_source">Quelle</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xmlindex 14e297a..96b9142 100644--- a/app/src/main/res/values-es/strings.xml+++ b/app/src/main/res/values-es/strings.xml@@ -465,8 +465,8 @@<string name="daylist_schedule">Se actualiza cada pocas horas</string><string name="daily_mix_schedule">Se actualiza a diario</string><string name="weekly_schedule">Se actualiza cada semana</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Mostrar clips en bucle</string>+ <string name="canvas">Portadas animadas</string>+ <string name="canvas_show">Mostrar portadas animadas</string><string name="canvas_note">El vídeo corto que traen algunas canciones. Desactivado, tampoco se descarga.</string><string name="show_all">Mostrar todo</string><string name="show_less">Mostrar menos</string>@@ -548,4 +548,7 @@<string name="widget_description">Lo que suena, sus controles y tus playlists recientes</string><string name="widget_nothing_playing">No suena nada</string><string name="widget_open_app">Abrir Square</string>+ <string name="animated_cover_source">Fuente</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xmlindex 449c117..68b33ee 100644--- a/app/src/main/res/values-fr/strings.xml+++ b/app/src/main/res/values-fr/strings.xml@@ -465,8 +465,8 @@<string name="daylist_schedule">Mise à jour toutes les quelques heures</string><string name="daily_mix_schedule">Mise à jour quotidienne</string><string name="weekly_schedule">Mise à jour hebdomadaire</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Afficher les clips en boucle</string>+ <string name="canvas">Pochettes animées</string>+ <string name="canvas_show">Afficher les pochettes animées</string><string name="canvas_note">La courte vidéo que portent certains titres. Désactivé, elle n\'est pas téléchargée non plus.</string><string name="show_all">Tout afficher</string><string name="show_less">Afficher moins</string>@@ -542,4 +542,7 @@<string name="widget_description">En cours de lecture, les commandes et tes playlists récentes</string><string name="widget_nothing_playing">Rien en cours de lecture</string><string name="widget_open_app">Ouvrir Square</string>+ <string name="animated_cover_source">Source</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xmlindex 9148926..3563c2b 100644--- a/app/src/main/res/values-hi/strings.xml+++ b/app/src/main/res/values-hi/strings.xml@@ -480,8 +480,8 @@<string name="daylist_schedule">हर कुछ घंटों में अपडेट होता है</string><string name="daily_mix_schedule">रोजाना अपडेट होता है</string><string name="weekly_schedule">हर हफ्ते अपडेट होता है</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">लूप क्लिप दिखाएँ</string>+ <string name="canvas">एनिमेटेड कवर</string>+ <string name="canvas_show">एनिमेटेड कवर दिखाएँ</string><string name="canvas_note">कुछ गानों के साथ आने वाला छोटा वीडियो. बंद होने पर डाउनलोड भी नहीं होता.</string><string name="show_all">सभी दिखाएँ</string><string name="show_less">कम दिखाएँ</string>@@ -557,4 +557,7 @@<string name="widget_description">अभी चल रहा गाना, उसके कंट्रोल और आपकी हाल की प्लेलिस्ट</string><string name="widget_nothing_playing">कुछ नहीं चल रहा</string><string name="widget_open_app">Square खोलें</string>+ <string name="animated_cover_source">स्रोत</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xmlindex 3f7e3ff..1c7b03d 100644--- a/app/src/main/res/values-it/strings.xml+++ b/app/src/main/res/values-it/strings.xml@@ -466,8 +466,8 @@<string name="daylist_schedule">Si aggiorna ogni poche ore</string><string name="daily_mix_schedule">Si aggiorna ogni giorno</string><string name="weekly_schedule">Si aggiorna ogni settimana</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Mostra i video in loop</string>+ <string name="canvas">Copertine animate</string>+ <string name="canvas_show">Mostra copertine animate</string><string name="canvas_note">Il breve video che alcuni brani portano con sé. Disattivato, non viene nemmeno scaricato.</string><string name="show_all">Mostra tutto</string><string name="show_less">Mostra meno</string>@@ -579,4 +579,7 @@<string name="widget_description">In riproduzione, i controlli e le tue playlist recenti</string><string name="widget_nothing_playing">Niente in riproduzione</string><string name="widget_open_app">Apri Square</string>+ <string name="animated_cover_source">Sorgente</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xmlindex 1a3e5d5..f238718 100644--- a/app/src/main/res/values-pt/strings.xml+++ b/app/src/main/res/values-pt/strings.xml@@ -465,8 +465,8 @@<string name="daylist_schedule">Atualiza a cada poucas horas</string><string name="daily_mix_schedule">Atualiza diariamente</string><string name="weekly_schedule">Atualiza semanalmente</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Mostrar clipes em loop</string>+ <string name="canvas">Capas animadas</string>+ <string name="canvas_show">Mostrar capas animadas</string><string name="canvas_note">O vídeo curto que algumas faixas trazem. Desligado, também não é baixado.</string><string name="show_all">Mostrar tudo</string><string name="show_less">Mostrar menos</string>@@ -542,4 +542,7 @@<string name="widget_description">O que está tocando, os controles e suas playlists recentes</string><string name="widget_nothing_playing">Nada tocando</string><string name="widget_open_app">Abrir o Square</string>+ <string name="animated_cover_source">Fonte</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xmlindex f5eee59..033d1f8 100644--- a/app/src/main/res/values-ru/strings.xml+++ b/app/src/main/res/values-ru/strings.xml@@ -486,8 +486,8 @@<string name="daylist_schedule">Обновляется каждые несколько часов</string><string name="daily_mix_schedule">Обновляется ежедневно</string><string name="weekly_schedule">Обновляется еженедельно</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Показывать зацикленные клипы</string>+ <string name="canvas">Анимированные обложки</string>+ <string name="canvas_show">Показывать анимированные обложки</string><string name="canvas_note">Короткое видео, которое есть у некоторых треков. Если выключено, оно и не скачивается.</string><string name="show_all">Показать все</string><string name="show_less">Свернуть</string>@@ -571,4 +571,7 @@<string name="widget_description">Что играет, управление и ваши недавние плейлисты</string><string name="widget_nothing_playing">Ничего не играет</string><string name="widget_open_app">Открыть Square</string>+ <string name="animated_cover_source">Источник</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xmlindex f62df71..bc0d05d 100644--- a/app/src/main/res/values-tr/strings.xml+++ b/app/src/main/res/values-tr/strings.xml@@ -478,8 +478,8 @@<string name="daylist_schedule">Birkaç saatte bir güncellenir</string><string name="daily_mix_schedule">Günlük güncellenir</string><string name="weekly_schedule">Haftalık güncellenir</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Döngü kliplerini göster</string>+ <string name="canvas">Hareketli kapaklar</string>+ <string name="canvas_show">Hareketli kapakları göster</string><string name="canvas_note">Bazı şarkıların getirdiği kısa video. Kapalıyken indirilmez de.</string><string name="show_all">Tümünü göster</string><string name="show_less">Daha az göster</string>@@ -555,4 +555,7 @@<string name="widget_description">Çalan şarkı, kontrolleri ve son çalma listelerin</string><string name="widget_nothing_playing">Hiçbir şey çalmıyor</string><string name="widget_open_app">Square’i aç</string>+ <string name="animated_cover_source">Kaynak</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xmlindex 5e6b171..af06a0e 100644--- a/app/src/main/res/values/strings.xml+++ b/app/src/main/res/values/strings.xml@@ -486,8 +486,8 @@<string name="daylist_schedule">Updates every few hours</string><string name="daily_mix_schedule">Updates daily</string><string name="weekly_schedule">Updates weekly</string>- <string name="canvas">Canvas</string>- <string name="canvas_show">Show looping clips</string>+ <string name="canvas">Animated covers</string>+ <string name="canvas_show">Show animated covers</string><string name="canvas_note">The short video some tracks come with. Off, none is downloaded either.</string><string name="show_all">Show all</string><string name="show_less">Show less</string>@@ -606,4 +606,7 @@<string name="widget_description">Now playing, its controls and your recent playlists</string><string name="widget_nothing_playing">Nothing playing</string><string name="widget_open_app">Open Square</string>+ <string name="animated_cover_source">Source</string>+ <string name="animated_cover_spotify">Spotify (Canvas)</string>+ <string name="animated_cover_apple">Apple Music</string></resources>