diff --git a/CHANGELOG.md b/CHANGELOG.md index 485caa21..7983d959 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 6.5.0 +- Updated Translations +- Added new Card Style - Brat +- Improved existing card styles +- Removed underused customization options +- Miscellaneous UI fixes + ## 6.4.2 - Updated Translations - Performance improvements diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index ba7d31b4..f6611d30 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -23,8 +23,8 @@ plugins { } val appName = "Rush" -val appVersionName = "6.4.2" -val appVersionCode = 6420 +val appVersionName = "6.5.0" +val appVersionCode = 6500 val gitHash = execute("git", "rev-parse", "HEAD").take(7) diff --git a/androidApp/src/foss/java/com/shub39/rush/billing/BillingHandlerImpl.kt b/androidApp/src/foss/java/com/shub39/rush/billing/BillingHandlerImpl.kt index cc3781c6..39e5d5fa 100644 --- a/androidApp/src/foss/java/com/shub39/rush/billing/BillingHandlerImpl.kt +++ b/androidApp/src/foss/java/com/shub39/rush/billing/BillingHandlerImpl.kt @@ -20,7 +20,7 @@ import com.shub39.rush.shared.core.interfaces.BillingHandler import com.shub39.rush.shared.core.interfaces.SubscriptionResult class BillingHandlerImpl : BillingHandler { - override suspend fun isProUser(): Boolean = true + override suspend fun isProUser(): Boolean = false - override suspend fun userResult(): SubscriptionResult = SubscriptionResult.Subscribed + override suspend fun userResult(): SubscriptionResult = SubscriptionResult.NotSubscribed } diff --git a/androidApp/src/main/java/com/shub39/rush/app/App.kt b/androidApp/src/main/java/com/shub39/rush/app/App.kt index 00e22276..f45def98 100644 --- a/androidApp/src/main/java/com/shub39/rush/app/App.kt +++ b/androidApp/src/main/java/com/shub39/rush/app/App.kt @@ -119,8 +119,6 @@ fun App() { }, state = shareState, onAction = shareVM::onAction, - isProUser = globalState.isProUser, - onShowPaywall = { backStack.add(Routes.PaywallPage) }, ) } @@ -135,7 +133,6 @@ fun App() { onNavigateBack = { if (backStack.size != 1) backStack.removeLastOrNull() }, - isProUser = globalState.isProUser, onShowPaywall = { backStack.add(Routes.PaywallPage) }, onUpdateNotificationAccess = { globalVM.onAction(GlobalAction.OnCheckNotificationAccess) diff --git a/desktopApp/src/commonMain/kotlin/com/shub39/rush/app/App.kt b/desktopApp/src/commonMain/kotlin/com/shub39/rush/app/App.kt index 959554d3..b9bb0587 100644 --- a/desktopApp/src/commonMain/kotlin/com/shub39/rush/app/App.kt +++ b/desktopApp/src/commonMain/kotlin/com/shub39/rush/app/App.kt @@ -111,8 +111,6 @@ fun App() { onDismiss = { if (backStack.size != 1) backStack.removeLastOrNull() }, state = shareState, onAction = shareVM::onAction, - isProUser = globalState.isProUser, - onShowPaywall = {}, ) } @@ -127,7 +125,6 @@ fun App() { onNavigateBack = { if (backStack.size != 1) backStack.removeLastOrNull() }, - isProUser = globalState.isProUser, onShowPaywall = {}, onUpdateNotificationAccess = { globalVM.onAction(GlobalAction.OnCheckNotificationAccess) diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png index 73e2caaa..0d324a6d 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png index d9c972d1..35336f06 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png index 1410cb49..9d4f4378 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png index e395d84c..4066bbb2 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png index 9be6ee3e..a69ccf6c 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png index 28b91117..45970c1c 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png differ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5edc41a7..929b1913 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,8 @@ targetSdk = "37" compileSdk = "37" accompanist = "0.37.3" colorpicker = "1.2.0" -compose-multiplatform = "1.12.0-alpha02" +compose-multiplatform = "1.12.0-beta02" +material3 = "1.12.0-alpha03" filekit = "0.14.2" materialkolor = "4.1.1" splashscreen = "1.2.0" @@ -14,32 +15,32 @@ datastore = "1.2.1" koin = "4.2.2" koin-plugin = "1.0.1" ksoup = "0.2.6" -ktor = "3.5.0" +ktor = "3.5.1" kotlin = "2.4.0" ksp = "2.3.9" -landscapist = "2.10.0" +landscapist = "2.11.0" activity-compose = "1.13.0" navigation = "1.1.1" kmpalette = "3.1.0" -room3 = "3.0.0-rc01" +room3 = "3.0.0" serialization = "1.11.0" androidx-lifecycle = "2.10.0" -zoomable = "2.12.0" +zoomable = "2.13.0" coroutines = "1.11.0" -purchases = "10.10.0" +purchases = "10.13.0" junit = "4.13.2" junit-version = "1.3.0" -spotless = "8.7.0" +spotless = "8.8.0" ktfmt = "0.61" build-config = "6.0.10" -sqlite = "2.6.2" +sqlite = "2.7.0" nucleus = "1.15.7" [libraries] # CMP compose-components-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "compose-multiplatform" } compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "compose-multiplatform" } -compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "compose-multiplatform" } +compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "material3" } compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "compose-multiplatform" } compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "compose-multiplatform" } compose-ui-tooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "compose-multiplatform" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 8bdaf60c..b1b8ef56 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7e7d24f6..a9db1155 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,9 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index adff685a..249efbb0 100755 --- a/gradlew +++ b/gradlew @@ -20,7 +20,7 @@ ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -29,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index e509b2dd..8508ef68 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -19,12 +19,12 @@ @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -51,7 +51,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -65,29 +65,18 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :execute @rem Setup the command line -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/Util.kt b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/Util.kt index 0ebe6125..7da4de21 100644 --- a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/Util.kt +++ b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/Util.kt @@ -16,6 +16,12 @@ */ package com.shub39.rush.shared.core +import kotlin.enums.enumEntries + +inline fun > valueOfOrNull(name: String): T? { + return enumEntries().firstOrNull { it.name == name } +} + private val titleCleanupPatterns = listOf( Regex( diff --git a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/AlbumArtShape.kt b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/AlbumArtShape.kt index f3afb268..18c784b1 100644 --- a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/AlbumArtShape.kt +++ b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/AlbumArtShape.kt @@ -37,5 +37,5 @@ enum class AlbumArtShape { SOFT_BURST, PUFFY_DIAMOND, BUN, - HEART, + RECTANGLE, } diff --git a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/CardFit.kt b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/CardFit.kt deleted file mode 100644 index 3ac81b6a..00000000 --- a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/CardFit.kt +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2026 Shubham Gorai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.shub39.rush.shared.core.enums - -enum class CardFit { - FIT, - STANDARD, -} diff --git a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/CardTheme.kt b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/CardTheme.kt index bcd83757..37fe5f33 100644 --- a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/CardTheme.kt +++ b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/enums/CardTheme.kt @@ -25,5 +25,5 @@ enum class CardTheme { HYPNOTIC, QUOTE, MESSY, - CHAT, + BRAT, } diff --git a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/interfaces/SharePagePreferences.kt b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/interfaces/SharePagePreferences.kt index 279d918e..12c8e6d4 100644 --- a/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/interfaces/SharePagePreferences.kt +++ b/shared/core/src/commonMain/kotlin/com/shub39/rush/shared/core/interfaces/SharePagePreferences.kt @@ -18,17 +18,11 @@ package com.shub39.rush.shared.core.interfaces import com.shub39.rush.shared.core.enums.AlbumArtShape import com.shub39.rush.shared.core.enums.CardColors -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.core.enums.CardTheme import com.shub39.rush.shared.core.enums.CornerRadius -import com.shub39.rush.shared.core.enums.Fonts import kotlinx.coroutines.flow.Flow interface SharePagePreferences { - fun getCardFitFlow(): Flow - - suspend fun updateCardFit(newCardFit: CardFit) - fun getCardBackgroundFlow(): Flow suspend fun updateCardBackground(newCardBackground: Int) @@ -49,18 +43,10 @@ interface SharePagePreferences { suspend fun updateCardRoundness(newCardRoundness: CornerRadius) - fun getCardFontFlow(): Flow - - suspend fun updateCardFont(newCardFont: Fonts) - fun getAlbumArtShapeFlow(): Flow suspend fun updateAlbumArtShape(shape: AlbumArtShape) - fun showRushBranding(): Flow - - suspend fun updateRushBranding(newPref: Boolean) - fun getFullscreenShare(): Flow suspend fun updateFullscreenShare(newPref: Boolean) diff --git a/shared/logic/src/commonMain/composeResources/files/changelog.json b/shared/logic/src/commonMain/composeResources/files/changelog.json index 4167250e..5dd07d48 100644 --- a/shared/logic/src/commonMain/composeResources/files/changelog.json +++ b/shared/logic/src/commonMain/composeResources/files/changelog.json @@ -1,4 +1,14 @@ [ + { + "version": "6.5.0", + "changes": [ + "Updated Translations", + "Added new Card Style - Brat", + "Improved existing card styles", + "Removed underused customization options", + "Miscellaneous UI fixes" + ] + }, { "version": "6.4.2", "changes": [ @@ -64,12 +74,5 @@ "changes": [ "Fixed UI bug in share cards" ] - }, - { - "version": "6.2.0", - "changes": [ - "Fixed Expressive Syllables causing crashes", - "Fixed UI inconsistencies" - ] } ] \ No newline at end of file diff --git a/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/LyricsPagePreferencesImpl.kt b/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/LyricsPagePreferencesImpl.kt index cb7e3bb0..dc653307 100644 --- a/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/LyricsPagePreferencesImpl.kt +++ b/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/LyricsPagePreferencesImpl.kt @@ -25,11 +25,11 @@ import androidx.datastore.preferences.core.edit import androidx.datastore.preferences.core.floatPreferencesKey import androidx.datastore.preferences.core.intPreferencesKey import androidx.datastore.preferences.core.stringPreferencesKey -import com.shub39.rush.shared.core.RushLogger import com.shub39.rush.shared.core.enums.CardColors import com.shub39.rush.shared.core.enums.LyricsAlignment import com.shub39.rush.shared.core.enums.LyricsBackground import com.shub39.rush.shared.core.interfaces.LyricsPagePreferences +import com.shub39.rush.shared.core.valueOfOrNull import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map @@ -67,7 +67,8 @@ class LyricsPagePreferencesImpl(private val dataStore: DataStore) : override fun getLyricsBackgroundFlow(): Flow = dataStore.data.map { - LyricsBackground.valueOf(it[lyricsBackground] ?: LyricsBackground.SOLID_COLOR.name) + valueOfOrNull(it[lyricsBackground] ?: LyricsBackground.SOLID_COLOR.name) + ?: LyricsBackground.SOLID_COLOR } override suspend fun updateLyricsBackground(background: LyricsBackground) { @@ -109,7 +110,7 @@ class LyricsPagePreferencesImpl(private val dataStore: DataStore) : override fun getLyricsColorFlow(): Flow = dataStore.data.map { preferences -> - CardColors.valueOf(preferences[lyricsColor] ?: CardColors.MUTED.name) + valueOfOrNull(preferences[lyricsColor] ?: CardColors.MUTED.name) ?: CardColors.MUTED } override suspend fun updateLyricsColor(new: CardColors) { @@ -139,16 +140,8 @@ class LyricsPagePreferencesImpl(private val dataStore: DataStore) : override fun getLyricAlignmentFlow(): Flow = dataStore.data.map { prefs -> - try { - val alignment = prefs[lyricAlignment] ?: LyricsAlignment.START.toString() - LyricsAlignment.entries.find { it.toString() == alignment } ?: LyricsAlignment.START - } catch (e: Exception) { - RushLogger.e( - "LyricsPagePreferencesImpl", - "Error getting lyric alignment: ${e.message}", - ) - LyricsAlignment.START - } + val alignment = prefs[lyricAlignment] ?: LyricsAlignment.START.name + valueOfOrNull(alignment) ?: LyricsAlignment.START } override suspend fun updateLyricAlignment(alignment: LyricsAlignment) { diff --git a/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/OtherPreferencesImpl.kt b/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/OtherPreferencesImpl.kt index f198e889..324e2a8d 100644 --- a/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/OtherPreferencesImpl.kt +++ b/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/OtherPreferencesImpl.kt @@ -22,12 +22,12 @@ import androidx.datastore.preferences.core.booleanPreferencesKey import androidx.datastore.preferences.core.edit import androidx.datastore.preferences.core.intPreferencesKey import androidx.datastore.preferences.core.stringPreferencesKey -import com.shub39.rush.shared.core.RushLogger import com.shub39.rush.shared.core.enums.AppTheme import com.shub39.rush.shared.core.enums.Fonts import com.shub39.rush.shared.core.enums.PaletteStyle import com.shub39.rush.shared.core.enums.SortOrder import com.shub39.rush.shared.core.interfaces.OtherPreferences +import com.shub39.rush.shared.core.valueOfOrNull import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map @@ -58,7 +58,7 @@ class OtherPreferencesImpl(private val datastore: DataStore) : Othe override fun getAppThemePrefFlow(): Flow = datastore.data.map { preferences -> val theme = preferences[appTheme] ?: AppTheme.SYSTEM.name - AppTheme.valueOf(theme) + valueOfOrNull(theme) ?: AppTheme.SYSTEM } override suspend fun updateAppThemePref(pref: AppTheme) { @@ -69,8 +69,7 @@ class OtherPreferencesImpl(private val datastore: DataStore) : Othe datastore.data.map { preferences -> try { preferences[seedColor] ?: 0xFFFFFF - } catch (e: Exception) { - RushLogger.e("OtherPreferencesImpl", "Error getting seed color: ${e.message}") + } catch (_: Exception) { 0xFFFFFF } } @@ -88,12 +87,8 @@ class OtherPreferencesImpl(private val datastore: DataStore) : Othe override fun getPaletteStyle(): Flow = datastore.data.map { preferences -> - try { - PaletteStyle.valueOf(preferences[paletteStyle] ?: PaletteStyle.TONALSPOT.name) - } catch (e: Exception) { - RushLogger.e("OtherPreferencesImpl", "Error getting palette style: ${e.message}") - PaletteStyle.TONALSPOT - } + valueOfOrNull(preferences[paletteStyle] ?: PaletteStyle.TONALSPOT.name) + ?: PaletteStyle.TONALSPOT } override suspend fun updatePaletteStyle(style: PaletteStyle) { @@ -103,7 +98,7 @@ class OtherPreferencesImpl(private val datastore: DataStore) : Othe override fun getSortOrderFlow(): Flow = datastore.data.map { preferences -> val order = preferences[sortOrder] ?: SortOrder.TITLE_ASC.name - SortOrder.valueOf(order.uppercase()) + valueOfOrNull(order.uppercase()) ?: SortOrder.TITLE_ASC } override suspend fun updateSortOrder(newSortOrder: SortOrder) { @@ -120,7 +115,7 @@ class OtherPreferencesImpl(private val datastore: DataStore) : Othe override fun getFontFlow(): Flow = datastore.data.map { prefs -> val font = prefs[selectedFont] ?: Fonts.FIGTREE.name - Fonts.valueOf(font) + valueOfOrNull(font) ?: Fonts.FIGTREE } override suspend fun updateFonts(font: Fonts) { diff --git a/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/SharePagePreferencesImpl.kt b/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/SharePagePreferencesImpl.kt index fe59be6d..64b39cb3 100644 --- a/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/SharePagePreferencesImpl.kt +++ b/shared/logic/src/commonMain/kotlin/com/shub39/rush/shared/logic/datastore/SharePagePreferencesImpl.kt @@ -26,11 +26,10 @@ import androidx.datastore.preferences.core.intPreferencesKey import androidx.datastore.preferences.core.stringPreferencesKey import com.shub39.rush.shared.core.enums.AlbumArtShape import com.shub39.rush.shared.core.enums.CardColors -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.core.enums.CardTheme import com.shub39.rush.shared.core.enums.CornerRadius -import com.shub39.rush.shared.core.enums.Fonts import com.shub39.rush.shared.core.interfaces.SharePagePreferences +import com.shub39.rush.shared.core.valueOfOrNull import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map @@ -43,29 +42,21 @@ class SharePagePreferencesImpl(private val dataStore: DataStore) : private val cardTheme = stringPreferencesKey("card_theme") private val cardBackground = intPreferencesKey("card_background") private val cardContent = intPreferencesKey("card_content") - private val cardFit = stringPreferencesKey("card_fit") - private val cardFont = stringPreferencesKey("card_font") private val albumArtShapeKey = stringPreferencesKey("album_art_shape") - private val rushBrandingKey = booleanPreferencesKey("rush_branding") private val fullscreenShareKey = booleanPreferencesKey("fullscreen_share") } override fun getAlbumArtShapeFlow(): Flow = dataStore.data.map { preferences -> - AlbumArtShape.valueOf(preferences[albumArtShapeKey] ?: AlbumArtShape.COOKIE_12.name) + valueOfOrNull( + preferences[albumArtShapeKey] ?: AlbumArtShape.COOKIE_12.name + ) ?: AlbumArtShape.COOKIE_12 } override suspend fun updateAlbumArtShape(shape: AlbumArtShape) { dataStore.edit { preferences -> preferences[albumArtShapeKey] = shape.name } } - override fun showRushBranding(): Flow = - dataStore.data.map { preferences -> preferences[rushBrandingKey] ?: true } - - override suspend fun updateRushBranding(newPref: Boolean) { - dataStore.edit { preferences -> preferences[rushBrandingKey] = newPref } - } - override fun getFullscreenShare(): Flow = dataStore.data.map { preferences -> preferences[fullscreenShareKey] ?: false } @@ -73,16 +64,6 @@ class SharePagePreferencesImpl(private val dataStore: DataStore) : dataStore.edit { preferences -> preferences[fullscreenShareKey] = newPref } } - override fun getCardFitFlow(): Flow = - dataStore.data.map { preferences -> - val cardFit = preferences[cardFit] ?: CardFit.FIT.name - CardFit.valueOf(cardFit) - } - - override suspend fun updateCardFit(newCardFit: CardFit) { - dataStore.edit { settings -> settings[cardFit] = newCardFit.name } - } - override fun getCardBackgroundFlow(): Flow = dataStore.data.map { preferences -> preferences[cardBackground] ?: Color.Black.toArgb() } @@ -100,7 +81,7 @@ class SharePagePreferencesImpl(private val dataStore: DataStore) : override fun getCardThemeFlow(): Flow = dataStore.data.map { preferences -> val theme = preferences[cardTheme] ?: CardTheme.SPOTIFY.name - CardTheme.valueOf(theme) + valueOfOrNull(theme) ?: CardTheme.SPOTIFY } override suspend fun updateCardTheme(newCardTheme: CardTheme) { @@ -110,7 +91,7 @@ class SharePagePreferencesImpl(private val dataStore: DataStore) : override fun getCardColorFlow(): Flow = dataStore.data.map { preferences -> val cardColor = preferences[cardColor] ?: CardColors.MUTED.name - CardColors.valueOf(cardColor) + valueOfOrNull(cardColor) ?: CardColors.MUTED } override suspend fun updateCardColor(newCardColor: CardColors) { @@ -120,20 +101,10 @@ class SharePagePreferencesImpl(private val dataStore: DataStore) : override fun getCardRoundnessFlow(): Flow = dataStore.data.map { preferences -> val cardRoundness = preferences[cardRoundness] ?: CornerRadius.ROUNDED.name - CornerRadius.valueOf(cardRoundness) + valueOfOrNull(cardRoundness) ?: CornerRadius.ROUNDED } override suspend fun updateCardRoundness(newCardRoundness: CornerRadius) { dataStore.edit { settings -> settings[cardRoundness] = newCardRoundness.name } } - - override fun getCardFontFlow(): Flow = - dataStore.data.map { prefs -> - val font = prefs[cardFont] ?: Fonts.FIGTREE.name - Fonts.valueOf(font) - } - - override suspend fun updateCardFont(newCardFont: Fonts) { - dataStore.edit { prefs -> prefs[cardFont] = newCardFont.name } - } } diff --git a/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/setting/Util.android.kt b/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/setting/Util.android.kt index 1ecb5c52..d1d942a0 100644 --- a/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/setting/Util.android.kt +++ b/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/setting/Util.android.kt @@ -96,7 +96,6 @@ actual fun ColumnScope.MaterialYouToggle( @Composable actual fun ColumnScope.PaletteStylePicker( modifier: Modifier, - enabled: Boolean, theme: Theme, onChange: (PaletteStyle) -> Unit, ) { @@ -145,7 +144,7 @@ actual fun ColumnScope.PaletteStylePicker( modifier = Modifier.size(50.dp) .clip(if (selected) MaterialShapes.VerySunny.toShape() else CircleShape) - .clickable(enabled = enabled) { onChange(style) }, + .clickable { onChange(style) }, contentAlignment = Alignment.Center, ) { Canvas(modifier = Modifier.matchParentSize()) { diff --git a/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.android.kt b/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.android.kt index 06ebb961..25ca1b40 100644 --- a/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.android.kt +++ b/shared/ui/src/androidMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.android.kt @@ -56,8 +56,6 @@ import rush.shared.ui.generated.resources.share actual fun SharePage( onDismiss: () -> Unit, state: SharePageState, - isProUser: Boolean, - onShowPaywall: () -> Unit, onAction: (SharePageAction) -> Unit, ) { val coroutineScope = rememberCoroutineScope() @@ -97,8 +95,6 @@ actual fun SharePage( ) }, onLaunchImagePicker = { imagePicker.launch() }, - isProUser = isProUser, - onShowPaywall = onShowPaywall, onShareImage = { coroutineScope.launch(Dispatchers.IO) { val graphicsLayer = diff --git a/shared/ui/src/commonMain/composeResources/drawable/dice.xml b/shared/ui/src/commonMain/composeResources/drawable/dice.xml new file mode 100644 index 00000000..8bd3b477 --- /dev/null +++ b/shared/ui/src/commonMain/composeResources/drawable/dice.xml @@ -0,0 +1,9 @@ + + + diff --git a/shared/ui/src/commonMain/composeResources/values-ar/strings.xml b/shared/ui/src/commonMain/composeResources/values-ar/strings.xml index 3f70bf3e..b6fbb49b 100644 --- a/shared/ui/src/commonMain/composeResources/values-ar/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-ar/strings.xml @@ -25,7 +25,6 @@ حدث خطأ سمة البطاقة ألوان البطاقة - حجم البطاقة زوايا البطاقة النسخ الاحتياطي استيراد أو تصدير قاعدة بيانات كلمات الأغاني المحفوظة @@ -48,8 +47,6 @@ مكتوم نابض بالحياة مخصص - ملائم - عادي نوعي Rushed Hypnotic @@ -78,14 +75,11 @@ تباعد الحروف رَأسِيّ اقتباس - خط البطاقة بيت شعري فوضوي - محادثة أنت تستخدم برنامج مجاني ومفتوح المصدر (FOSS) جميع الميزات متاحة. هذا الإصدار من التطبيق لا يدعم عمليات الشراء داخل التطبيق. إذا كان هذا التطبيق قد أضاف قيمة إلى حياتك، ادعمني بالتبرع على Rush Pro - افتح المزيد مع Pro فن الألبوم فقط شكل فن الألبوم فن ضبابي @@ -110,7 +104,6 @@ المظهر الكتابة الآخرون - اظهر علامة التطبيق مشاركة الشاشة الكاملة تحويل الى نظام كتابة اخر diff --git a/shared/ui/src/commonMain/composeResources/values-ca/strings.xml b/shared/ui/src/commonMain/composeResources/values-ca/strings.xml index 95e48a82..93d35cb6 100644 --- a/shared/ui/src/commonMain/composeResources/values-ca/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-ca/strings.xml @@ -25,7 +25,6 @@ S\u0027ha produït un error Tema de la targeta Colors de la targeta - Mida de la targeta Cantonades de la targeta Còpia de seguretat Importa o exporta la base de dades de lletres desades @@ -52,8 +51,6 @@ Apagat Viu Personalitzat - Ajusta - Estàndard Genèric Afanyat Hipnòtic @@ -80,14 +77,11 @@ Espaiat entre lletres Vertical Cita - Font de la targeta Estrofa Desordenat - Xat Estàs utilitzant la variant FOSS Totes les funcions estan desbloquejades. Aquesta variant de l\u0027aplicació no admet compres integrades. Si aquesta aplicació t\u0027ha aportat valor, dona\u0027m suport fent una donació a Rush Pro - Desbloqueja més amb Pro Només portada Forma de la portada de l\u0027àlbum Portada difuminada @@ -110,7 +104,6 @@ Aspecte Text Altres - Mostra la marca de l\u0027aplicació Compartició a pantalla completa Romanització Mostra les lletres romanitzades per a japonès, coreà, xinès, hindi, panjabi i llengües ciríl·liques diff --git a/shared/ui/src/commonMain/composeResources/values-de/strings.xml b/shared/ui/src/commonMain/composeResources/values-de/strings.xml index 9bf5e748..0b6f31ce 100644 --- a/shared/ui/src/commonMain/composeResources/values-de/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-de/strings.xml @@ -25,7 +25,6 @@ Ein Fehler ist aufgetreten Kartenthema Kartenfarben - Kartengröße Kartenecken Sicherung Importieren oder exportieren Sie die Datenbank der gesicherten Liedtexte @@ -37,7 +36,6 @@ Wiederherstellen Wiederherstellen aus der ausgewählten Exportdatei Datei auswählen - Standard Generisch Wählen Sie das Farbschema Erscheinungsbild @@ -56,7 +54,6 @@ Gedämpft Benutzerdefiniert Rushed - Angepasst Abgerundet Thema basierend auf Ihrem Hintergrundbild Schriftart der App auswählen @@ -72,9 +69,7 @@ Buchstabenabstände Vertikal Zitat - Kartenschriftart Zwei zeilig - Chat Vollbildansicht Liedtext-Anpassungen Systemleisten auf der Liedtextseite ausblenden @@ -84,7 +79,6 @@ Verschwommmendes Cover Sie benutzen die FOSS Variante Alle Funktionen sind freigeschaltet. Diese App-Variante unterstützt keine In-App-Käufe. Wenn diese App Ihr Leben bereichert hat, unterstützen Sie mich bitte mit einer Spende auf - Mit Pro noch mehr freischalten Nur Cover Form des Albumcovers Solide @@ -108,7 +102,6 @@ Aussehen Text Andere - App-Branding anzeigen Vollbild teilen Romanisierung Romanisierte Liedtexte für Japanisch, Koreanisch, Chinesisch, Hindi, Panjabi und kyrillische Sprachen anzeigen diff --git a/shared/ui/src/commonMain/composeResources/values-es/strings.xml b/shared/ui/src/commonMain/composeResources/values-es/strings.xml index 9b5c5408..335250da 100644 --- a/shared/ui/src/commonMain/composeResources/values-es/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-es/strings.xml @@ -25,7 +25,6 @@ Ocurrió un error Estilo de postal Color de postal - Tamaño de postal Esquinas de postal Copia de seguridad Importar o exportar la base de datos de letras guardadas @@ -48,8 +47,6 @@ Silenciado Vibrante Personalizado - Adaptada - Estándar Genérico Rushed Hipnótico @@ -78,14 +75,11 @@ Espaciado de letra Vertical Cita - Fuente de Tarjeta Copla Desorganizado - Mensajes Estás usando la variante FOSS Todas las características están desbloqueadas. Esta variante de la aplicación no soporta compras dentro de la app. Si esta aplicación le añadió valor a tu vida, ayúdame donando en Rush Pro - Desbloqueja más con Pro Solo Carátula Forma de la carátula Carátula borrosa @@ -108,7 +102,6 @@ Apariencia Texto Otros - Mostrar Marca de la App Compartición a pantalla completa Romanización Mostrar romanización para letra japonesa, coreana, china, hindi, punjabi y idiomas cirílicos diff --git a/shared/ui/src/commonMain/composeResources/values-et/strings.xml b/shared/ui/src/commonMain/composeResources/values-et/strings.xml index 6d1f6024..b46c8923 100644 --- a/shared/ui/src/commonMain/composeResources/values-et/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-et/strings.xml @@ -21,7 +21,6 @@ Võrguühendus puudub! Kaardi kujundus Kaardi värvid - Kaardi suurus Kaardi nurgad Varunda Impordi või ekspordi salvestatud laulusõnade andmekogu diff --git a/shared/ui/src/commonMain/composeResources/values-fa/strings.xml b/shared/ui/src/commonMain/composeResources/values-fa/strings.xml index feb911c2..5fbd4606 100644 --- a/shared/ui/src/commonMain/composeResources/values-fa/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-fa/strings.xml @@ -25,7 +25,6 @@ خطایی رخ داد پوسته کارت رنگ کارت - اندازه کارت گوشه‌های کارت پشتیبان گیری وارد یا صادر کردن پایگاه داده متن ترانه‌های ذخیره شده @@ -50,8 +49,6 @@ بیصدا لرزش سفارشی - متناسب - استاندارد عمومی عجله‌ای شد هیپنوتیزم کننده @@ -78,20 +75,17 @@ فاصله متن‌ها عمودی نقل قول - قلم کارت دوبیتی نامرتب - چت شما از نسخه نرم افزار آزاد (FOSS) استفاده می کنید تمام ویژگی ها باز هستند. این نسخه از اپلیکیشن از خریدهای درون برنامه ای پشتیبانی نمی کند. اگر این اپلیکیشن به زندگی شما ارزش افزوده است، با کمک مالی از من حمایت کنید Rush ویژه - باز کردن موارد بیشتر با نسخه ویژه فقط تصویر شکل جلد آلبوم تصویر محو جامد پس‌زمینه اشعار - متن + ساده همگام شده محو کردن اشعار همگام شده موج @@ -101,4 +95,23 @@ منحنی خطای کپی پیدا نشد + راش را به زبان خود ترجمه کنید + همگام سازی خط + هجی همگام سازی شده + تغییرات + چه چیز هایی تغییر کرده اند + ظاهر + متن + باقی + اشتراک گذاری تمام صفحه + لاتین سازی + نمایش متون لاتین شده برای زبان‌های ژاپنی، کره‌ای، چینی، هندی، پنجابی و سیریلیک + جستجو را باز کنید + پیشفرض + زبان + حرف های نشانه + تغییر سبک فونت بر اساس مدت زمان کلمه + پنهان کردن کنترل‌ها + پنهان کردن کنترل‌های متن ترانه پس از ۵ ثانیه + با پرداخت مبلغی هرچند کم از من حمایت کنید diff --git a/shared/ui/src/commonMain/composeResources/values-fr/strings.xml b/shared/ui/src/commonMain/composeResources/values-fr/strings.xml index 269e85b2..c7f58b67 100644 --- a/shared/ui/src/commonMain/composeResources/values-fr/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-fr/strings.xml @@ -25,7 +25,6 @@ Une erreur est survenue Thème de la carte Couleur de la carte - Taille de la carte Coins de la carte Sauvegarde Importer ou exporter la base de données de paroles sauvegardées @@ -42,7 +41,6 @@ Sélectionner la couleur de base Source En sourdine - Ajuster Générique Vif Personnalisé @@ -59,7 +57,6 @@ Apparence Palette AMOLED Sélectionnez la couleur depuis laquelle générer une palette de couleurs - Standard Style de palette Clair Sombre @@ -77,15 +74,12 @@ Couplet Citation Vertical - Police d\u0027écriture Désorganisé - Conversation Buy me a Coffee Traduire Vous utilisez la variante FOSS Toutes les fonctionnalités sont débloquées. Cette variante de l\u0027application ne supporte pas les achats intégrés. Si cette application vous est utile, soutenez moi en faisant un don sur Rush Pro - Débloquez plus de fonctionnalités avec Pro Art seul Forme de l\u0027art Art flouté diff --git a/shared/ui/src/commonMain/composeResources/values-hu/strings.xml b/shared/ui/src/commonMain/composeResources/values-hu/strings.xml index 4d995e8f..3691e3b8 100644 --- a/shared/ui/src/commonMain/composeResources/values-hu/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-hu/strings.xml @@ -25,7 +25,6 @@ Egy hiba lépett fel Kártya téma Kártya színek - Kártya méretek Kártya sarkai Biztonsági mentés Mentett dalszövegek adatbázisának importálása vagy exportálása @@ -50,8 +49,6 @@ Némítva Élénk Saját - Fit - Alapértelmezett Általános Rushed Hipnotikus @@ -78,12 +75,9 @@ Betűköz Függőleges Idézet - Kártya betűtípus Kuplé Rendetlen - Csevegés A FOSS variánst használod Minden funkció feloldva. Az alkalmazásnak ez a változata nem támogatja az alkalmazáson belüli vásárlásokat. Ha ez az alkalmazás értéket képvisel az életedben, támogass adományoddal a következő oldalon Rush Pro - Nyisson meg többet a Pro segítségével diff --git a/shared/ui/src/commonMain/composeResources/values-id/strings.xml b/shared/ui/src/commonMain/composeResources/values-id/strings.xml index c6c0f9d2..aeed6e3a 100644 --- a/shared/ui/src/commonMain/composeResources/values-id/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-id/strings.xml @@ -25,7 +25,6 @@ Terjadi Kesalahan Tema Kartu Warna Kartu - Ukuran Kartu Sudut Kartu Cadangkan Impor atau Ekspor basis data lirik yang disimpan @@ -48,8 +47,6 @@ Redup Cerah Kustom - Paskan - Standar Spotify Rushed Hipnotis @@ -76,19 +73,15 @@ Jarak huruf Vertikal Kutipan - Font Kartu Kuplet Berantakan - Obrolan Belikan saya kopi Terjemahkan Anda sedang menggunakan varian FOSS Semua fitur terkunci. Varian ini tidak mendukung pembelian dalam aplikasi. Jika aplikasi ini memberikan manfaat bagi hidup Anda, dukung saya dengan memberikan donasi di Rush Pro - Dapatkan fitur lebih banyak dengan Pro Tidak ditemukan Lainnya - Tampilkan Branding Aplikasi Latar Belakang Lirik Polos Tersinkronisasi diff --git a/shared/ui/src/commonMain/composeResources/values-is/strings.xml b/shared/ui/src/commonMain/composeResources/values-is/strings.xml new file mode 100644 index 00000000..045e125f --- /dev/null +++ b/shared/ui/src/commonMain/composeResources/values-is/strings.xml @@ -0,0 +1,3 @@ + + + diff --git a/shared/ui/src/commonMain/composeResources/values-it/strings.xml b/shared/ui/src/commonMain/composeResources/values-it/strings.xml index d9fa0952..03db052f 100644 --- a/shared/ui/src/commonMain/composeResources/values-it/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-it/strings.xml @@ -27,7 +27,6 @@ Si è verificato un errore Tema Card Colori Card - Dimensioni Card Rush Buy Me a Coffee (Supportami) Traduci @@ -49,7 +48,6 @@ Vivace Personalizzato Origine - Standard Generico Ipnotico Predefinito @@ -80,18 +78,14 @@ Sfondo testi Sincronizzato Sfoca testo sincronizzato - Font Card Seleziona colore base - Adatta Affrettato Nascondi barre di sistema nella pagina testi Citazione - Chat Accoppiato Disordinato Tutte le funzionalità sono sbloccate. Questa variante dell\u0027app non supporta gli acquisti in-app. Se questa app ha aggiunto valore alla tua vida, sostienimi con una donazione su Rush Pro - Sblocca di più con Pro Semplice Onda Gradiente @@ -108,7 +102,6 @@ Aspetto Testo Altri - Mostra Marchio dell\u0027App Condivisione a schermo intero Romanizzazione Mostra i testi in caratteri latini per le lingue giapponese, coreana, cinese, hindi, punjabi e cirillica diff --git a/shared/ui/src/commonMain/composeResources/values-iw/strings.xml b/shared/ui/src/commonMain/composeResources/values-iw/strings.xml index 487678fd..72a67056 100644 --- a/shared/ui/src/commonMain/composeResources/values-iw/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-iw/strings.xml @@ -28,7 +28,6 @@ מקור מושתק מלא חיות - התאנה מהפנטת מעוגל Rushed @@ -49,7 +48,6 @@ זוגות זה ריק פה לא ניתן היה לקבל את המילים מ-LRCLIB - גודל כרטיס בקשה נכשלה רצועה שגיאת רשת @@ -59,7 +57,6 @@ Rush אין חיבור אינטרנט! קצוות כרטיס - גופן כרטיס ייצוא שירים אל הורדות/Rush התאמה אישית של האפליקציה בדרכים שונות מותאם אישית @@ -71,7 +68,6 @@ בחר קובץ ריווח אותיות לוח צבעים Amoled - סטנדרטי Spotify ברירת מחדל Material עיצוב @@ -79,7 +75,6 @@ טעינת מילות השיר גאוניות הסתר סרגלי מערכת בדף מילות השיר מבולגן - צ\u0027אט תרגם קנה לי קפה diff --git a/shared/ui/src/commonMain/composeResources/values-ja/strings.xml b/shared/ui/src/commonMain/composeResources/values-ja/strings.xml index 5f299719..0df49e1b 100644 --- a/shared/ui/src/commonMain/composeResources/values-ja/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-ja/strings.xml @@ -27,7 +27,6 @@ ネットワークエラー カードテーマ カードカラー - カードサイズ カード角丸 バックアップ 保存した歌詞のデータベースをインポート・エクスポート @@ -51,8 +50,6 @@ ミュート 鮮やか カスタム - フィット - 標準 Rushed ヒプノティック 角丸 @@ -78,14 +75,16 @@ 文字間隔 縦書き 引用 - カードフォント 対句 雑然 - チャット FOSSバージョンを使用中 すべての機能がアンロックされています。このアプリバージョンはアプリ内購入をサポートしていません。このアプリがあなたの生活に価値を加えた場合は、以下で寄付をしてサポートしてください Rush Pro - Proでさらに機能をアンロック コピーエラー 見つかりません + テキスト + その他 + ローマ字 + 言語 + システムの言語 diff --git a/shared/ui/src/commonMain/composeResources/values-ko/strings.xml b/shared/ui/src/commonMain/composeResources/values-ko/strings.xml index 9c111455..f2fba911 100644 --- a/shared/ui/src/commonMain/composeResources/values-ko/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-ko/strings.xml @@ -24,7 +24,6 @@ 오류가 발생했습니다 카드 테마 카드 색상 - 카드 크기 카드 모서리 백업 저장된 가사 데이터베이스를 가져오거나 내보내기 @@ -49,8 +48,6 @@ 음소거됨 선명함 사용자 지정 - 맞춤 - 표준 일반 Rush 스타일 최면 효과 @@ -77,5 +74,4 @@ 글자 간격 수직 따옴표 - 카드 글꼴 diff --git a/shared/ui/src/commonMain/composeResources/values-pl/strings.xml b/shared/ui/src/commonMain/composeResources/values-pl/strings.xml index 2179818f..4cb538a5 100644 --- a/shared/ui/src/commonMain/composeResources/values-pl/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-pl/strings.xml @@ -25,7 +25,6 @@ Wystąpił błąd Motyw Karty Kolory Karty - Rozmiar Karty Rogi Karty Kopia zapasowa Importuj lub Eksportuj bazę danych z zapisanymi tekstami piosenek @@ -50,8 +49,6 @@ Wyciszony Żywy Niestandardowy - Dopasuj - Standardowy Typowy Pospieszny Hipnotyzujący @@ -76,9 +73,7 @@ Wysokość wiersza Odstęp między literami Pionowy - Czcionka Karty Rush Pro - Odblokuj więcej z Pro Tło tekstu piosenki Zsynchronizowany Fala @@ -90,7 +85,6 @@ Cytat Dwuwiersz Nieuporządkowany - Czat Używasz wariantu FOSS Wszystkie funkcje są odblokowane. Ten wariant aplikacji nie obsługuje płatności. Jeżeli ta aplikacja przydała ci się, wspomóż mnie wysyłając dotację na Tylko okładka @@ -108,7 +102,6 @@ Zsynchronizowane sylabami Lista zmian Wygląd - Pokazuj wizerunek marki Pełnoekranowe udostępnianie Transkrypcja Pokazuj transkrypcję tekstów piosenek dla Japońskiego, Koreańskiego, Chińskiego, Hindi, Punjabi i Cyrylicy diff --git a/shared/ui/src/commonMain/composeResources/values-pt-rBR/strings.xml b/shared/ui/src/commonMain/composeResources/values-pt-rBR/strings.xml index cbd55a52..f3eb38f0 100644 --- a/shared/ui/src/commonMain/composeResources/values-pt-rBR/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-pt-rBR/strings.xml @@ -25,7 +25,6 @@ Ocorreu um erro Tema do Cartão Cores do Cartão - Tamanho do Cartão Cantos do Cartão Backup Importar ou Exportar o banco de dados de letras salvas @@ -50,8 +49,6 @@ Mudo Vibrante Personalizado - Ajustar - Padrão Genérico Rushed (apressado) Hipnótico @@ -78,14 +75,11 @@ Espaçamento de letras Vertical Citação - Fonte de card Par de versos Bagunçado - Chat Você está usando la versão FOSS Todas as funções estão desbloqueadas. Essa versão do aplicativo não suporta compras no app. Se este app agregou valor em sua vida, me apoie com uma doação Funções Rush Pro - Desbloqueie mais com o Rush Pro Apenas capa Formato da capa do álbum Capa borrada @@ -108,5 +102,4 @@ Aparência Texto Outros - Mostrar logomarca do app diff --git a/shared/ui/src/commonMain/composeResources/values-pt/strings.xml b/shared/ui/src/commonMain/composeResources/values-pt/strings.xml index e6006212..e2466374 100644 --- a/shared/ui/src/commonMain/composeResources/values-pt/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-pt/strings.xml @@ -25,7 +25,6 @@ Ocorreu um erro Tema do cartão Cores do cartão - Tamanho do cartão Cantos do cartão Backup Importar ou exportar a base de dados de letras gravadas @@ -50,8 +49,6 @@ Mudo Vibrante Personalizado - Ajustar - Padrão Genérico Rushed (apressado) Hipnótico @@ -78,14 +75,11 @@ Espaçamento de letras Vertical Citação - Fonte de card Par de versos Bagunçado - Chat Usa a variante FOSS Todas as funções estão desbloqueadas. Esta versão da app não apoia compras na app. Se esta app agregou valor na sua vida, apoie-me com uma doação Funções Rush Pro - Desbloqueie mais com o Rush Pro Apenas capa Formato da capa do álbum Capa borrada @@ -108,5 +102,4 @@ Aparência Texto Outros - Mostrar logomarca da app diff --git a/shared/ui/src/commonMain/composeResources/values-ro-rRO/strings.xml b/shared/ui/src/commonMain/composeResources/values-ro-rRO/strings.xml index c20eb6ef..7d939c8e 100644 --- a/shared/ui/src/commonMain/composeResources/values-ro-rRO/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-ro-rRO/strings.xml @@ -25,7 +25,6 @@ A apărut o eroare Temă card Culori card - Dimensiune card Colțuri card Backup Importă sau exportă baza de date cu versurile salvate @@ -48,8 +47,6 @@ Pale Vibrant Personalizat - Potrivire - Standard Grăbit Hipnotic Rotunjit @@ -76,13 +73,10 @@ Mărimea fontului Înălțimea liniei Spațierea literelor - Fontul cardului Dezordonat - Chat Folosești varianta FOSS Toate caracteristicile sunt deblocate. Această variantă a aplicației nu suportă achiziții în aplicație. Dacă această aplicație ți-a adus valoare vieții, susține-mă donându-mi Rush Pro - Deblochează mai multe cu Pro Doar coperta albumului Forma copertei albumului Copertă blurată @@ -103,7 +97,6 @@ Aspect Text Altele - Afișează brandingul aplicației Romanizare Arată versuri romanizate pentru limbile japoneză, coreeană, chineză, hindi, punjabi și cele chirilice Deschide Căutarea diff --git a/shared/ui/src/commonMain/composeResources/values-ru/strings.xml b/shared/ui/src/commonMain/composeResources/values-ru/strings.xml index 88982e92..dee70bd7 100644 --- a/shared/ui/src/commonMain/composeResources/values-ru/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-ru/strings.xml @@ -33,7 +33,6 @@ Ошибка Тема карточки Цвета карточки - Размер карточки Сохранение и восстановление О приложении Экспорт песен в выбранную папку @@ -49,8 +48,6 @@ Заглушенный Яркий Собственный - Соответствие - Стандартный Гипнотический Тема Material Тема основанная на цветах ваших обоев @@ -70,16 +67,13 @@ Размер шрифта Расстояние между строками Ширина строки - Шрифт карты Куплет Цитата Вертикально - Чат Перевести Вы используете FOSS-версию Все функции разблокированы. Эта версия приложения не поддерживает встроенные покупки. Если приложение сделало вашу жизнь лучше, поддержите меня донатом на Премиум - Разблокировать Pro-функции Rush Купи мне кофе Восстановить из выбранного экспортированного файла @@ -110,7 +104,6 @@ Выглядит Текст Остальные - Показать бренд приложения Показывать латинизированные тексты песен на японском, корейском, китайском, хинди, пенджабском и кириллическом языках Открыть поиск По умолчанию системы diff --git a/shared/ui/src/commonMain/composeResources/values-sr/strings.xml b/shared/ui/src/commonMain/composeResources/values-sr/strings.xml index 90420513..58c604c9 100644 --- a/shared/ui/src/commonMain/composeResources/values-sr/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-sr/strings.xml @@ -24,7 +24,6 @@ Desila se greška Tema kartice Boje kartice - Veličina kartice Uglovi kartice Bekap Uvezi ili izvezi bazu sačuvanih tekstova @@ -49,8 +48,6 @@ Utišano Jarko Prilagođeno - Uvrstaj - Standardno Generično Rushovano Hipnotičko @@ -77,14 +74,11 @@ Razmak između slova Vertikalno Citat - Font kartice Distih Neuredno - Čet Koristiš FOSS varijantu Sve funkcije su otključane. Ova verzija aplikacije ne podržava kupovine u aplikaciji. Ako vam ova aplikacija znači u životu, podržite me donacijom Rush Pro‎ - Otključaj više uz Pro Samo omot Oblik omota albuma Zamagljen omot @@ -107,6 +101,5 @@ Izgled Tekst Ostalo - Prikaži brending aplikacije Nije moguće dobiti tekst od LRCLIB-a diff --git a/shared/ui/src/commonMain/composeResources/values-th/strings.xml b/shared/ui/src/commonMain/composeResources/values-th/strings.xml index 5ff3461f..77261f1c 100644 --- a/shared/ui/src/commonMain/composeResources/values-th/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-th/strings.xml @@ -25,7 +25,6 @@ เกิดข้อผิดพลาดขึ้น ธีมการ์ด สีการ์ด - ขนาดการ์ด มุมการ์ด สำรองข้อมูล นำเข้าหรือส่งออกข้อมูลของเนื้อเพลงที่บันทึกไว้ @@ -50,8 +49,6 @@ ปิด ความสดใส กำหนดเอง - พอดี - มาตรฐาน ทั่วไป เร่งรีบ สะกดจิต @@ -78,14 +75,11 @@ ระยะห่างระหว่างตัวอักษร แนวตั้ง คำ - ฟอนต์การ์ด บทกลอน ยุ่งเหยิง - แชท คุณกำลังใช้ตัวแปร FOSS ทุกฟีเจอร์ถูกปลดล็อกแล้ว แอปพลิเคชันรุ่นนี้ไม่รองรับการซื้อในแอปพลิเคชัน หากแอปนี้ให้ความสะดวกกับชีวิตของคุณ โปรดสนับสนุนเราโดยการบริจาค Rush Pro - ปลดล็อกเพิ่มเติมด้วยโปร เพียงแค่ศิลปะ รูปทรงของภาพปกอัลบั้ม เบลอรูปภาพ @@ -108,7 +102,6 @@ หน้าตา ข้อความ อื่นๆ - แสดงแบรนด์ของแอป แชร์ทั้งหน้าจอ อักษรโรมัน แสดงเนื้อเพลงแบบโรมาไนซ์สำหรับภาษาญี่ปุ่น เกาหลี จีน ฮินดี ปัญจาบ และซีริลลิก diff --git a/shared/ui/src/commonMain/composeResources/values-tr/strings.xml b/shared/ui/src/commonMain/composeResources/values-tr/strings.xml index 5ea2f606..08d027b9 100644 --- a/shared/ui/src/commonMain/composeResources/values-tr/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-tr/strings.xml @@ -25,7 +25,6 @@ Bir hata oluştu Kart Teması Kart Renkleri - Kart Boyutu Kart Köşeleri Yedekle Kaydedilen şarkı sözleri veritabanını içe veya dışa aktar @@ -48,8 +47,6 @@ Soluk Canlı Özel - Sığdır - Standart Spotify Teması Hızlandırılmış Hipnotik @@ -72,7 +69,6 @@ Orta Hizalama Şarkı Sözü Ayarları - Kart Fontu Alıntı Kıta Dikey @@ -86,7 +82,6 @@ Sadece Kapak Albüm Kapak Şekli Senkronize - Premium ile daha fazlasının kilidini açın Dalga Yumuşak Geçiş Bu arkaplan mevcut çalan şarkınızı görselleştirir diff --git a/shared/ui/src/commonMain/composeResources/values-uk/strings.xml b/shared/ui/src/commonMain/composeResources/values-uk/strings.xml index 5f753d06..e7027902 100644 --- a/shared/ui/src/commonMain/composeResources/values-uk/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-uk/strings.xml @@ -25,7 +25,6 @@ Сталася помилка Тема Картки Кольори Картки - Розмір Картки Кути Картки Резервне копіювання Імпортувати або Експортувати базу даних збережених текстів @@ -48,8 +47,6 @@ Приглушений Яскравий Користувацький - Вписати - Стандартний Загальний Rushed Гіпнотичний @@ -78,14 +75,11 @@ Відстань між літерами Вертикальний Цитата - Шрифт картки Куплет Брудний - Чат Ви використовуєте варіант FOSS Всі функції розблоковані. Ця версія програми не підтримує внутрішньопрограмні покупки. Якщо ця програма додала цінності у ваше життя, підтримайте мене, зробивши пожертву на Rush Pro - Розблокуйте більше можливостей з Pro Підтримайте мене пожертвою Перекладіть Rush своєю мовою Тільки обкладинки @@ -108,5 +102,4 @@ Вигляд Текст Інші - Показувати брендинг додатку diff --git a/shared/ui/src/commonMain/composeResources/values-zh-rCN/strings.xml b/shared/ui/src/commonMain/composeResources/values-zh-rCN/strings.xml index c7f82393..cd8dfd4c 100644 --- a/shared/ui/src/commonMain/composeResources/values-zh-rCN/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-zh-rCN/strings.xml @@ -25,7 +25,6 @@ 发生错误 卡片主题 卡片颜色 - 卡片尺寸 卡片边角 备份 导入或导出已保存歌词的数据库 @@ -55,8 +54,6 @@ 柔和 鲜艳 自定义 - 适应 - 标准 通用 快速 涟漪 @@ -77,15 +74,12 @@ 引用 对句 选择应用程序字体 - 卡片字体 赞助 翻译 你正在使用FOSS版本 全部功能均已解锁。此版本应用无需内购。如果此软件帮助了你,请考虑通过以下途径支持作者: Rush Pro - 在Pro中发现更多 杂乱 - 对话 仅封面 专辑封面样式 封面颜色 @@ -93,7 +87,7 @@ 歌词背景 仅歌词 歌词滚动 - 已播放歌词模糊 + 模糊已同步的歌词 未找到 复制错误 此背景可视化当前播放的歌曲 @@ -104,13 +98,15 @@ 行同步 音节同步 更新日志 - 更新日志 + 变更内容 外观 文本 其他 - 显示应用品牌 全屏分享 - 罗马音 - 显示日语、韩语、中文、印地语、旁遮普语和西里尔语言的罗马化歌词 + 罗马化 + 显示日语、韩语、汉语、印地语、旁遮普语和西里尔语言的罗马化歌词 打开搜索 + 系统默认 + 语言 + 将Rush翻译至你的语言 diff --git a/shared/ui/src/commonMain/composeResources/values-zh-rTW/strings.xml b/shared/ui/src/commonMain/composeResources/values-zh-rTW/strings.xml index 24e4ebfb..4b6cfe71 100644 --- a/shared/ui/src/commonMain/composeResources/values-zh-rTW/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values-zh-rTW/strings.xml @@ -25,7 +25,6 @@ 發生錯誤 卡片主題 卡片色彩 - 卡片大小 卡片邊角 還原 選擇檔案 @@ -34,7 +33,6 @@ 選擇種子顏色 來源 自訂 - 適應 重試 跟隨系統 明亮 @@ -55,7 +53,6 @@ 選擇顏色以生成調色盤 柔和 鮮豔 - 標準 通用 快速 催眠 @@ -64,7 +61,6 @@ 以各種方式自訂應用程式 在AMOLED顯示幕上提供最佳體驗 正在載入Genius歌詞 - 卡片字體 基於壁紙的主題 Amoled調色板 自訂歌詞 @@ -84,7 +80,6 @@ 全部功能已解鎖。此版本應用程式無需內購。如果此軟體幫助了你,請考慮透過以下途徑支持作者: 請作者喝杯咖啡 雜亂 - 在Pro中發現更多 僅封面 專輯封面樣式 封面模糊 @@ -96,6 +91,22 @@ 曲線 複製錯誤 未找到 - 聊天 同步 + 將Rush翻譯至你的語言 + 封面顏色 + 僅歌詞 + 行同步 + 音節同步 + 更新日誌 + 變更內容 + 外觀 + 文本 + 其他 + 全屏分享 + 羅馬化 + 顯示日語、韓語、漢語、印地語、旁遮普語和西里爾語言的羅馬化歌詞 + 打開檢索 + 系統預設 + 語言 + 模糊已同步的歌詞 diff --git a/shared/ui/src/commonMain/composeResources/values/strings.xml b/shared/ui/src/commonMain/composeResources/values/strings.xml index ac6cf932..08aaded6 100644 --- a/shared/ui/src/commonMain/composeResources/values/strings.xml +++ b/shared/ui/src/commonMain/composeResources/values/strings.xml @@ -25,7 +25,6 @@ An Error occurred Card Theme Card Colors - Card Size Card Corners Backup Import or Export the database of saved lyrics @@ -52,8 +51,6 @@ Muted Vibrant Custom - Fit - Standard Generic Rushed Hypnotic @@ -80,14 +77,12 @@ Letter spacing Vertical Quote - Card Font Couplet Messy - Chat + Brat You are using the FOSS variant All features are unlocked. This variant of the app does not support In-App Purchases. If this app added value to your life, Support me by donating on Rush Pro - Unlock more with Pro Only Art Album art shape Blurred Art @@ -110,7 +105,6 @@ Looks Text Others - Show App Branding Full Screen Share Romanization Show romanized lyrics for Japanese, Korean, Chinese, Hindi, Punjabi, and Cyrillic languages diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/EnumExt.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/EnumExt.kt index 6e909cf4..e944c366 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/EnumExt.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/EnumExt.kt @@ -17,16 +17,17 @@ package com.shub39.rush.shared.ui import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialShapes import androidx.compose.material3.toShape import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.graphics.Shape import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp import com.shub39.rush.shared.core.enums.AlbumArtShape import com.shub39.rush.shared.core.enums.AppTheme import com.shub39.rush.shared.core.enums.CardColors -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.core.enums.CardTheme import com.shub39.rush.shared.core.enums.CornerRadius import com.shub39.rush.shared.core.enums.Fonts @@ -59,8 +60,6 @@ fun LyricsBackground.toStringRes(): StringResource { expect val allBackgrounds: List -val premiumCards: List = listOf(HYPNOTIC, MESSY, QUOTE, CHAT) - val audioDependentBackgrounds: List = listOf(WAVE, GRADIENT, CURVE) fun PaletteStyle.toMPaletteStyle(): com.materialkolor.PaletteStyle { @@ -117,13 +116,6 @@ fun CardColors.toStringRes(): StringResource { } } -fun CardFit.toStringRes(): StringResource { - return when (this) { - FIT -> Res.string.fit - STANDARD -> Res.string.standard - } -} - fun CardTheme.toStringRes(): StringResource { return when (this) { SPOTIFY -> Res.string.spotify @@ -134,7 +126,7 @@ fun CardTheme.toStringRes(): StringResource { HYPNOTIC -> Res.string.hypnotic QUOTE -> Res.string.quote MESSY -> Res.string.messy - CHAT -> Res.string.chat + BRAT -> Res.string.brat } } @@ -174,7 +166,7 @@ fun Fonts.toFontRes(): FontResource? { OPEN_SANS -> Res.font.open_sans OUTFIT -> Res.font.outfit QUICKSAND -> Res.font.quicksand - JOSH -> Res.font.jost + JOSH -> Res.font.jost // Josh is very important to us. He was almost declared dead... GOOGLE_SANS -> Res.font.google_sans_flex } } @@ -182,26 +174,26 @@ fun Fonts.toFontRes(): FontResource? { @Composable fun AlbumArtShape.toMaterialShape(): Shape { return when (this) { - CIRCLE -> MaterialShapes.Circle - SUNNY -> MaterialShapes.Sunny - VERY_SUNNY -> MaterialShapes.VerySunny - SQUARE -> MaterialShapes.Square - SLANTED -> MaterialShapes.Slanted - ARCH -> MaterialShapes.Arch - PILL -> MaterialShapes.Pill - PENTAGON -> MaterialShapes.Pentagon - GEM -> MaterialShapes.Gem - COOKIE_4 -> MaterialShapes.Cookie4Sided - COOKIE_6 -> MaterialShapes.Cookie6Sided - COOKIE_9 -> MaterialShapes.Cookie9Sided - COOKIE_12 -> MaterialShapes.Cookie12Sided - CLOVER_4 -> MaterialShapes.Clover4Leaf - CLOVER_8 -> MaterialShapes.Clover8Leaf - GHOSTISH -> MaterialShapes.Ghostish - FLOWER -> MaterialShapes.Flower - SOFT_BURST -> MaterialShapes.SoftBurst - PUFFY_DIAMOND -> MaterialShapes.PuffyDiamond - BUN -> MaterialShapes.Bun - HEART -> MaterialShapes.Heart - }.toShape() + CIRCLE -> MaterialShapes.Circle.toShape() + SUNNY -> MaterialShapes.Sunny.toShape() + VERY_SUNNY -> MaterialShapes.VerySunny.toShape() + SQUARE -> MaterialShapes.Square.toShape() + SLANTED -> MaterialShapes.Slanted.toShape() + ARCH -> MaterialShapes.Arch.toShape() + PILL -> MaterialShapes.Pill.toShape() + PENTAGON -> MaterialShapes.Pentagon.toShape() + GEM -> MaterialShapes.Gem.toShape() + COOKIE_4 -> MaterialShapes.Cookie4Sided.toShape() + COOKIE_6 -> MaterialShapes.Cookie6Sided.toShape() + COOKIE_9 -> MaterialShapes.Cookie9Sided.toShape() + COOKIE_12 -> MaterialShapes.Cookie12Sided.toShape() + CLOVER_4 -> MaterialShapes.Clover4Leaf.toShape() + CLOVER_8 -> MaterialShapes.Clover8Leaf.toShape() + GHOSTISH -> MaterialShapes.Ghostish.toShape() + FLOWER -> MaterialShapes.Flower.toShape() + SOFT_BURST -> MaterialShapes.SoftBurst.toShape() + PUFFY_DIAMOND -> MaterialShapes.PuffyDiamond.toShape() + BUN -> MaterialShapes.Bun.toShape() + RECTANGLE -> RoundedCornerShape(0.dp) + } } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/Util.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/Util.kt index 0e07ccc7..1819cae4 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/Util.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/Util.kt @@ -43,8 +43,8 @@ expect suspend fun Clipboard.copyToClipboard(text: String) fun WindowSizeClass.isExpanded(): Boolean = this.widthSizeClass == WindowWidthSizeClass.Expanded -fun Map.sortMapByKeys(): Map { - val sortedEntries = this.entries.toList().sortedBy { it.key } +fun Map.sortMapByKeys(take: Int = 16): Map { + val sortedEntries = this.entries.toList().sortedBy { it.key }.take(take) val sortedMap = LinkedHashMap() for (entry in sortedEntries) { sortedMap[entry.key] = entry.value diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/component/ListSelect.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/component/ListSelect.kt index 6484c94c..c0166618 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/component/ListSelect.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/component/ListSelect.kt @@ -19,8 +19,10 @@ package com.shub39.rush.shared.ui.component import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.material3.ButtonGroupDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.material3.ToggleButton @@ -54,15 +56,39 @@ fun ListSelect( Column(modifier = modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) { Text(text = title, style = MaterialTheme.typography.titleMedium) - FlowRow { - options.forEach { option -> - ToggleButton( - checked = option == selected, - onCheckedChange = { onSelectedChange(option) }, - content = { labelProvider(option) }, - colors = ToggleButtonDefaults.tonalToggleButtonColors(), - modifier = Modifier.padding(horizontal = 2.dp), - ) + if (options.size > 3) { + FlowRow { + options.forEach { option -> + ToggleButton( + checked = option == selected, + onCheckedChange = { onSelectedChange(option) }, + content = { labelProvider(option) }, + colors = ToggleButtonDefaults.tonalToggleButtonColors(), + modifier = Modifier.padding(horizontal = 2.dp), + ) + } + } + } else { + Row( + horizontalArrangement = + Arrangement.spacedBy(ButtonGroupDefaults.ConnectedSpaceBetween) + ) { + options.forEachIndexed { index, option -> + ToggleButton( + checked = option == selected, + onCheckedChange = { onSelectedChange(option) }, + content = { labelProvider(option) }, + colors = ToggleButtonDefaults.tonalToggleButtonColors(), + modifier = Modifier.weight(1f), + shapes = + when (index) { + 0 -> ButtonGroupDefaults.connectedLeadingButtonShapes() + options.lastIndex -> + ButtonGroupDefaults.connectedTrailingButtonShapes() + else -> ButtonGroupDefaults.connectedMiddleButtonShapes() + }, + ) + } } } } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/component/Scrollbar.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/component/Scrollbar.kt deleted file mode 100644 index fe63bf9f..00000000 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/component/Scrollbar.kt +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2026 Shubham Gorai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.shub39.rush.shared.ui.component - -import androidx.compose.animation.core.animateFloatAsState -import androidx.compose.foundation.lazy.LazyListState -import androidx.compose.material3.MaterialTheme -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.drawWithContent -import androidx.compose.ui.geometry.CornerRadius -import androidx.compose.ui.geometry.Offset -import androidx.compose.ui.geometry.Size -import androidx.compose.ui.unit.Dp -import androidx.compose.ui.unit.dp - -@Composable -fun Modifier.simpleVerticalScrollbar(state: LazyListState, width: Dp = 4.dp): Modifier { - - val targetAlpha = if (state.isScrollInProgress) .7f else 0f - - val alpha by - animateFloatAsState( - targetValue = targetAlpha, - animationSpec = MaterialTheme.motionScheme.fastEffectsSpec(), - ) - - val firstIndex by - animateFloatAsState( - targetValue = state.layoutInfo.visibleItemsInfo.firstOrNull()?.index?.toFloat() ?: 0f, - animationSpec = MaterialTheme.motionScheme.fastSpatialSpec(), - ) - - val lastIndex by - animateFloatAsState( - targetValue = state.layoutInfo.visibleItemsInfo.lastOrNull()?.index?.toFloat() ?: 0f, - animationSpec = MaterialTheme.motionScheme.fastSpatialSpec(), - ) - - val color = MaterialTheme.colorScheme.tertiary - - return drawWithContent { - drawContent() - - val itemsCount = state.layoutInfo.totalItemsCount - - if (itemsCount > 0 && alpha > 0f) { - val scrollbarTop = firstIndex / itemsCount * size.height - val scrollBottom = (lastIndex + 1f) / itemsCount * size.height - val scrollbarHeight = scrollBottom - scrollbarTop - drawRoundRect( - cornerRadius = CornerRadius(width.toPx() / 2, width.toPx() / 2), - color = color, - topLeft = Offset(size.width - width.toPx(), scrollbarTop), - size = Size(width.toPx(), scrollbarHeight), - alpha = alpha, - ) - } - } -} diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/lyrics/section/LyricsPage.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/lyrics/section/LyricsPage.kt index b981a8c7..bd617bbe 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/lyrics/section/LyricsPage.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/lyrics/section/LyricsPage.kt @@ -111,7 +111,6 @@ import com.shub39.rush.shared.ui.lyrics.component.SyllableSyncedLyrics import com.shub39.rush.shared.ui.lyrics.getCardColors import com.shub39.rush.shared.ui.lyrics.getHypnoticColors import com.shub39.rush.shared.ui.lyrics.getWaveColors -import com.shub39.rush.shared.ui.theme.flexFontEmphasis import com.shub39.rush.shared.ui.theme.flexFontRounded import com.shub39.rush.shared.ui.toAlignment import kotlin.time.Duration.Companion.milliseconds @@ -316,8 +315,9 @@ fun LyricsPage( Text( text = lyricsState.song.title, - style = MaterialTheme.typography.headlineMedium, - fontFamily = flexFontEmphasis(), + style = + MaterialTheme.typography.headlineMedium + .copy(fontFamily = flexFontRounded()), maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = @@ -328,7 +328,6 @@ fun LyricsPage( text = lyricsState.song.artists, style = MaterialTheme.typography.titleMedium, fontFamily = flexFontRounded(), - fontWeight = FontWeight.Bold, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.basicMarquee(), @@ -429,7 +428,7 @@ fun LyricsPage( text = lyricsState.song.title, style = MaterialTheme.typography.titleLarge.copy( - fontFamily = flexFontEmphasis() + fontFamily = flexFontRounded() ), maxLines = 1, overflow = TextOverflow.Ellipsis, diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/saved/SavedPage.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/saved/SavedPage.kt index 03b02b05..a051e5e9 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/saved/SavedPage.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/saved/SavedPage.kt @@ -23,23 +23,27 @@ import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutVertically import androidx.compose.foundation.background import androidx.compose.foundation.basicMarquee -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.asPaddingValues import androidx.compose.foundation.layout.calculateEndPadding import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.BottomAppBar import androidx.compose.material3.ButtonGroupDefaults +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.LargeFlexibleTopAppBar @@ -72,7 +76,6 @@ import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl import com.shub39.rush.shared.ui.component.Empty import com.shub39.rush.shared.ui.component.PageFill -import com.shub39.rush.shared.ui.component.simpleVerticalScrollbar import com.shub39.rush.shared.ui.isExpanded import com.shub39.rush.shared.ui.saved.component.SavedPageActions import com.shub39.rush.shared.ui.saved.component.SongCard @@ -195,8 +198,10 @@ fun SavedPage( when (order) { SortOrder.DATE_ADDED -> ButtonGroupDefaults.connectedLeadingButtonShapes() + SortOrder.TITLE_ASC -> ButtonGroupDefaults.connectedMiddleButtonShapes() + SortOrder.TITLE_DESC -> ButtonGroupDefaults.connectedTrailingButtonShapes() }, @@ -219,21 +224,32 @@ fun SavedPage( exit = slideOutVertically { it / 2 }, ) { if (state.currentSong != null) { - BottomAppBar( - contentPadding = PaddingValues(start = 16.dp, end = 16.dp, top = 8.dp), + val insets = WindowInsets.systemBars.asPaddingValues() + + Card( + onClick = { onNavigateToLyrics() }, + shape = CircleShape, modifier = - Modifier.clip(RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp)) - .clickable { onNavigateToLyrics() }, - contentColor = Color(state.extractedColors.cardContentMuted), - containerColor = Color(state.extractedColors.cardBackgroundMuted), + Modifier.padding( + start = 16.dp, + end = 16.dp, + bottom = insets.calculateBottomPadding() + 8.dp, + ), + colors = + CardDefaults.cardColors( + contentColor = Color(state.extractedColors.cardContentMuted), + containerColor = + Color(state.extractedColors.cardBackgroundMuted), + ), ) { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), + modifier = Modifier.padding(8.dp).fillMaxWidth(), ) { ArtFromUrl( imageUrl = state.currentSong.artUrl, - modifier = Modifier.size(50.dp).clip(MaterialTheme.shapes.small), + modifier = Modifier.size(60.dp).clip(CircleShape), ) Column { @@ -283,18 +299,15 @@ fun SavedPage( AnimatedContent(targetState = state.sortOrder) { sortOrder -> val songs = when (sortOrder) { - SortOrder.DATE_ADDED -> state.songsByTime - SortOrder.TITLE_ASC -> state.songsAsc - SortOrder.TITLE_DESC -> state.songsDesc + DATE_ADDED -> state.songsByTime + TITLE_ASC -> state.songsAsc + TITLE_DESC -> state.songsDesc } val listState = rememberLazyListState() LazyColumn( state = listState, - modifier = - Modifier.fillMaxSize() - .simpleVerticalScrollbar(listState) - .animateContentSize(), + modifier = Modifier.fillMaxSize().animateContentSize(), contentPadding = PaddingValues( top = paddingValues.calculateTopPadding() + 16.dp, diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/SettingsGraph.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/SettingsGraph.kt index 5cb1555d..c0d1aca4 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/SettingsGraph.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/SettingsGraph.kt @@ -65,7 +65,6 @@ private val configuration = SavedStateConfiguration { fun SettingsGraph( notificationAccess: Boolean, state: SettingsPageState, - isProUser: Boolean, action: (SettingsPageAction) -> Unit, onNavigateBack: () -> Unit, onShowPaywall: () -> Unit, @@ -107,8 +106,6 @@ fun SettingsGraph( state = state, onAction = action, onNavigateBack = { if (backStack.size != 1) backStack.removeLastOrNull() }, - onShowPaywall = onShowPaywall, - isProUser = isProUser, ) } @@ -138,7 +135,6 @@ private fun Preview() { state = SettingsPageState(), action = {}, onNavigateBack = {}, - isProUser = true, onShowPaywall = {}, onUpdateNotificationAccess = {}, ) diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/Util.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/Util.kt index 1abe0946..6b4ed85e 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/Util.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/Util.kt @@ -33,7 +33,6 @@ expect fun ColumnScope.MaterialYouToggle( @Composable expect fun ColumnScope.PaletteStylePicker( modifier: Modifier = Modifier, - enabled: Boolean, theme: Theme, onChange: (PaletteStyle) -> Unit, ) diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/section/LookAndFeelPage.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/section/LookAndFeelPage.kt index 4f92e906..e18a1610 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/section/LookAndFeelPage.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/setting/section/LookAndFeelPage.kt @@ -21,22 +21,18 @@ import androidx.compose.foundation.background import androidx.compose.foundation.basicMarquee import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.material3.Button import androidx.compose.material3.ButtonGroupDefaults import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.IconButtonDefaults -import androidx.compose.material3.LinearWavyProgressIndicator import androidx.compose.material3.ListItem import androidx.compose.material3.MediumFlexibleTopAppBar import androidx.compose.material3.Scaffold @@ -50,14 +46,12 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.LocalLayoutDirection -import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.unit.dp import com.shub39.rush.shared.core.enums.AppTheme @@ -65,7 +59,6 @@ import com.shub39.rush.shared.core.enums.Fonts import com.shub39.rush.shared.ui.component.ColorPickerDialog import com.shub39.rush.shared.ui.component.ExpressiveSwitch import com.shub39.rush.shared.ui.component.PageFill -import com.shub39.rush.shared.ui.detachedItemShape import com.shub39.rush.shared.ui.endItemShape import com.shub39.rush.shared.ui.leadingItemShape import com.shub39.rush.shared.ui.listItemColors @@ -87,9 +80,7 @@ import rush.shared.ui.generated.resources.* fun LookAndFeelPage( modifier: Modifier = Modifier, state: SettingsPageState, - isProUser: Boolean, onAction: (SettingsPageAction) -> Unit, - onShowPaywall: () -> Unit, onNavigateBack: () -> Unit, ) = PageFill(modifier = modifier) { @@ -194,37 +185,16 @@ fun LookAndFeelPage( onCheckedChange = { onAction(SettingsPageAction.OnMaterialThemeToggle(it)) }, - modifier = - Modifier.clip(if (isProUser) middleItemShape() else endItemShape()), + modifier = Modifier.clip(middleItemShape()), ) - // plus redirect - if (!isProUser) { - Box( - contentAlignment = Alignment.Center, - modifier = Modifier.fillParentMaxWidth().height(60.dp), - ) { - LinearWavyProgressIndicator( - progress = { 0.90f }, - modifier = Modifier.fillParentMaxWidth(), - ) - - Button(onClick = onShowPaywall) { - Text(text = stringResource(Res.string.unlock_more_pro)) - } - } - } - // font picker Column( modifier = Modifier.clip( when { - state.theme.materialTheme && !isProUser -> - detachedItemShape() state.theme.materialTheme -> endItemShape() - isProUser -> middleItemShape() - else -> leadingItemShape() + else -> middleItemShape() } ) ) { @@ -252,7 +222,6 @@ fun LookAndFeelPage( onCheckedChange = { onAction(SettingsPageAction.OnFontChange(font)) }, - enabled = isProUser, colors = ToggleButtonDefaults.tonalToggleButtonColors(), ) { Text( @@ -278,7 +247,6 @@ fun LookAndFeelPage( trailingContent = { ExpressiveSwitch( checked = state.theme.withAmoled, - enabled = isProUser, onCheckedChange = { onAction(SettingsPageAction.OnAmoledSwitch(it)) }, @@ -305,7 +273,6 @@ fun LookAndFeelPage( contentColor = contentColorFor(Color(state.theme.seedColor)), ), - enabled = isProUser, ) { Icon( painter = painterResource(Res.drawable.edit), @@ -319,7 +286,6 @@ fun LookAndFeelPage( // palette style picker PaletteStylePicker( - enabled = isProUser, theme = state.theme, onChange = { onAction(SettingsPageAction.OnPaletteChange(it)) }, ) diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.kt index fe2c1336..7f5952db 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.kt @@ -26,7 +26,6 @@ import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -62,20 +61,17 @@ import androidx.compose.ui.tooling.preview.PreviewWrapper import androidx.compose.ui.unit.dp import com.materialkolor.ktx.blend import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.dataclasses.Theme import com.shub39.rush.shared.core.enums.CardColors -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.core.enums.CardTheme import com.shub39.rush.shared.core.enums.CornerRadius import com.shub39.rush.shared.ui.LocalWindowSizeClass import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ColorPickerDialog import com.shub39.rush.shared.ui.isExpanded -import com.shub39.rush.shared.ui.premiumCards import com.shub39.rush.shared.ui.pxToDp import com.shub39.rush.shared.ui.share.component.SharePageSheet import com.shub39.rush.shared.ui.share.component.cards.AlbumArt -import com.shub39.rush.shared.ui.share.component.cards.ChatCard +import com.shub39.rush.shared.ui.share.component.cards.BratShareCard import com.shub39.rush.shared.ui.share.component.cards.CoupletShareCard import com.shub39.rush.shared.ui.share.component.cards.HypnoticShareCard import com.shub39.rush.shared.ui.share.component.cards.MessyCard @@ -83,21 +79,19 @@ import com.shub39.rush.shared.ui.share.component.cards.QuoteShareCard import com.shub39.rush.shared.ui.share.component.cards.RushedShareCard import com.shub39.rush.shared.ui.share.component.cards.SpotifyShareCard import com.shub39.rush.shared.ui.share.component.cards.VerticalShareCard -import com.shub39.rush.shared.ui.theme.RushTheme import com.shub39.rush.shared.ui.toMaterialShape import io.github.vinceglb.filekit.PlatformFile import kotlinx.coroutines.launch import net.engawapg.lib.zoomable.rememberZoomState import net.engawapg.lib.zoomable.zoomable import org.jetbrains.compose.resources.painterResource +import org.jetbrains.compose.resources.vectorResource import rush.shared.ui.generated.resources.* @Composable expect fun SharePage( onDismiss: () -> Unit, state: SharePageState, - isProUser: Boolean, - onShowPaywall: () -> Unit, onAction: (SharePageAction) -> Unit, ) @@ -113,8 +107,6 @@ fun SharePageContent( onAction: (SharePageAction) -> Unit, onSaveImage: (ImageBitmap) -> Unit, onLaunchImagePicker: () -> Unit, - isProUser: Boolean, - onShowPaywall: () -> Unit, onShareImage: () -> Unit, ) { val scope = rememberCoroutineScope() @@ -168,11 +160,7 @@ fun SharePageContent( cardGraphicsLayer.record { this@drawWithContent.drawContent() } drawLayer(cardGraphicsLayer) } - .let { - if (state.cardFit == CardFit.FIT) { - it.heightIn(max = pxToDp(1920)) - } else it.height(pxToDp(1280)) - } + .heightIn(max = pxToDp(1920)) Scaffold( modifier = Modifier.fillMaxSize(), @@ -210,117 +198,97 @@ fun SharePageContent( else Color.Transparent, ) { Box(contentAlignment = Alignment.Center) { - RushTheme(theme = Theme(font = state.cardFont)) { - when (state.cardTheme) { - SPOTIFY -> - SpotifyShareCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) + when (state.cardTheme) { + SPOTIFY -> + SpotifyShareCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + albumArtShape = state.albumArtShape.toMaterialShape(), + ) - RUSHED -> - RushedShareCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - selectedImage = selectedImage, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) + RUSHED -> + RushedShareCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + selectedImage = selectedImage, + albumArtShape = state.albumArtShape.toMaterialShape(), + ) - HYPNOTIC -> - HypnoticShareCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) + HYPNOTIC -> + HypnoticShareCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + albumArtShape = state.albumArtShape.toMaterialShape(), + ) - VERTICAL -> - VerticalShareCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) + VERTICAL -> + VerticalShareCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + albumArtShape = state.albumArtShape.toMaterialShape(), + ) - QUOTE -> - QuoteShareCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) + QUOTE -> + QuoteShareCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + albumArtShape = state.albumArtShape.toMaterialShape(), + ) - COUPLET -> - CoupletShareCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) + COUPLET -> + CoupletShareCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + albumArtShape = state.albumArtShape.toMaterialShape(), + ) - MESSY -> - MessyCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - seed = messyCardSeed, - ) + MESSY -> + MessyCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + albumArtShape = state.albumArtShape.toMaterialShape(), + seed = messyCardSeed, + ) - CHAT -> - ChatCard( - modifier = cardModifier, - song = state.songDetails, - sortedLines = state.selectedLines, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) + ALBUM_ART -> + AlbumArt( + modifier = cardModifier, + song = state.songDetails, + cardColors = cardColor, + cardCorners = cardCorners, + selectedImage = selectedImage, + albumArtShape = state.albumArtShape.toMaterialShape(), + ) - ALBUM_ART -> - AlbumArt( - modifier = cardModifier, - song = state.songDetails, - cardColors = cardColor, - cardCorners = cardCorners, - fit = state.cardFit, - selectedImage = selectedImage, - albumArtShape = state.albumArtShape.toMaterialShape(), - rushBranding = state.rushBranding, - ) - } + BRAT -> + BratShareCard( + modifier = cardModifier, + song = state.songDetails, + sortedLines = state.selectedLines, + cardColors = cardColor, + cardCorners = cardCorners, + ) } } } @@ -351,29 +319,21 @@ fun SharePageContent( ) .padding(32.dp), ) { + IconButton(onClick = { onAction(SharePageAction.OnRandomize) }) { + Icon(imageVector = vectorResource(Res.drawable.dice), contentDescription = null) + } + IconButton( onClick = { - if (isProUser || !premiumCards.contains(state.cardTheme)) { - val graphicsLayer = - if (state.fullScreen) fullScreenGraphicsLayer else cardGraphicsLayer - scope.launch { onSaveImage(graphicsLayer.toImageBitmap()) } - } else { - onShowPaywall() - } + val graphicsLayer = + if (state.fullScreen) fullScreenGraphicsLayer else cardGraphicsLayer + scope.launch { onSaveImage(graphicsLayer.toImageBitmap()) } } ) { Icon(painter = painterResource(Res.drawable.save), contentDescription = "Save") } - ShareButton( - onClick = { - if (isProUser || !premiumCards.contains(state.cardTheme)) { - onShareImage() - } else { - onShowPaywall() - } - } - ) + ShareButton(onClick = { onShareImage() }) AnimatedVisibility( visible = state.cardTheme in listOf(CardTheme.RUSHED, CardTheme.ALBUM_ART), @@ -415,8 +375,6 @@ fun SharePageContent( editTarget = it colorPicker = true }, - isProUser = isProUser, - onShowPaywall = onShowPaywall, ) } @@ -466,7 +424,5 @@ private fun Preview() { onShareImage = {}, cardGraphicsLayer = rememberGraphicsLayer(), fullScreenGraphicsLayer = rememberGraphicsLayer(), - isProUser = true, - onShowPaywall = {}, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageAction.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageAction.kt index 33795c04..31df4125 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageAction.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageAction.kt @@ -18,13 +18,11 @@ package com.shub39.rush.shared.ui.share import com.shub39.rush.shared.core.enums.AlbumArtShape import com.shub39.rush.shared.core.enums.CardColors -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.core.enums.CardTheme import com.shub39.rush.shared.core.enums.CornerRadius -import com.shub39.rush.shared.core.enums.Fonts sealed interface SharePageAction { - data class OnToggleRushBranding(val pref: Boolean) : SharePageAction + data object OnRandomize : SharePageAction data class OnUpdateAlbumArtShape(val shape: AlbumArtShape) : SharePageAction @@ -32,15 +30,11 @@ sealed interface SharePageAction { data class OnUpdateCardColor(val color: CardColors) : SharePageAction - data class OnUpdateCardFit(val fit: CardFit) : SharePageAction - data class OnUpdateCardRoundness(val roundness: CornerRadius) : SharePageAction data class OnUpdateCardContent(val color: Int) : SharePageAction data class OnUpdateCardBackground(val color: Int) : SharePageAction - data class OnUpdateCardFont(val font: Fonts) : SharePageAction - data class OnToggleFullScreen(val fullScreen: Boolean) : SharePageAction } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageState.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageState.kt index 43cac1eb..5c35796f 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageState.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/SharePageState.kt @@ -24,10 +24,8 @@ import com.shub39.rush.shared.core.dataclasses.ExtractedColors import com.shub39.rush.shared.core.dataclasses.SongDetails import com.shub39.rush.shared.core.enums.AlbumArtShape import com.shub39.rush.shared.core.enums.CardColors -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.core.enums.CardTheme import com.shub39.rush.shared.core.enums.CornerRadius -import com.shub39.rush.shared.core.enums.Fonts @Stable @Immutable @@ -35,14 +33,11 @@ data class SharePageState( val songDetails: SongDetails = SongDetails("", "", null, ""), val selectedLines: Map = emptyMap(), val extractedColors: ExtractedColors = ExtractedColors(), - val cardFont: Fonts = Fonts.POPPINS, val cardColors: CardColors = CardColors.MUTED, val cardBackground: Int = Color.Gray.toArgb(), val cardContent: Int = Color.White.toArgb(), - val cardFit: CardFit = CardFit.FIT, val cardRoundness: CornerRadius = CornerRadius.ROUNDED, val cardTheme: CardTheme = CardTheme.SPOTIFY, val albumArtShape: AlbumArtShape = AlbumArtShape.COOKIE_12, - val rushBranding: Boolean = true, val fullScreen: Boolean = false, ) diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/SharePageSheet.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/SharePageSheet.kt index 26a082e9..0d01dd1b 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/SharePageSheet.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/SharePageSheet.kt @@ -44,16 +44,13 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper import androidx.compose.ui.unit.dp import com.shub39.rush.shared.core.enums.AlbumArtShape import com.shub39.rush.shared.core.enums.CardColors -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.core.enums.CardTheme import com.shub39.rush.shared.core.enums.CornerRadius -import com.shub39.rush.shared.core.enums.Fonts import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ExpressiveSwitch import com.shub39.rush.shared.ui.component.ListItemCard @@ -64,11 +61,8 @@ import com.shub39.rush.shared.ui.listItemColors import com.shub39.rush.shared.ui.middleItemShape import com.shub39.rush.shared.ui.share.SharePageAction import com.shub39.rush.shared.ui.share.SharePageState -import com.shub39.rush.shared.ui.toFontRes -import com.shub39.rush.shared.ui.toFullName import com.shub39.rush.shared.ui.toMaterialShape import com.shub39.rush.shared.ui.toStringRes -import org.jetbrains.compose.resources.Font import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.stringResource import rush.shared.ui.generated.resources.* @@ -80,8 +74,6 @@ fun SharePageSheet( onDismissRequest: () -> Unit, modifier: Modifier = Modifier, onLaunchColorPicker: (String) -> Unit, - isProUser: Boolean, - onShowPaywall: () -> Unit, sheetState: SheetState = rememberBottomSheetState( initialValue = SheetValue.Hidden, @@ -168,18 +160,6 @@ fun SharePageSheet( } } - item { - ListItemCard(shape = middleItemShape()) { - ListSelect( - title = stringResource(Res.string.card_size), - options = CardFit.entries.toList(), - selected = state.cardFit, - onSelectedChange = { onAction(SharePageAction.OnUpdateCardFit(it)) }, - labelProvider = { Text(text = stringResource(it.toStringRes())) }, - ) - } - } - item { ListItemCard(shape = middleItemShape()) { ListSelect( @@ -220,29 +200,10 @@ fun SharePageSheet( } } - item { - ListItemCard(shape = middleItemShape()) { - ListSelect( - title = stringResource(Res.string.card_font), - options = Fonts.entries.toList(), - selected = state.cardFont, - onSelectedChange = { onAction(SharePageAction.OnUpdateCardFont(it)) }, - labelProvider = { font -> - Text( - text = font.toFullName(), - fontFamily = - font.toFontRes()?.let { FontFamily(Font(it)) } - ?: FontFamily.Default, - ) - }, - ) - } - } - item { ListItem( colors = listItemColors(), - modifier = Modifier.clip(middleItemShape()), + modifier = Modifier.clip(endItemShape()), headlineContent = { Text( text = stringResource(Res.string.full_screen_share), @@ -258,32 +219,6 @@ fun SharePageSheet( }, ) } - - item { - ListItem( - colors = listItemColors(), - modifier = Modifier.clip(endItemShape()), - headlineContent = { - Text( - text = stringResource(Res.string.show_app_branding), - maxLines = 1, - modifier = Modifier.basicMarquee(), - ) - }, - trailingContent = { - ExpressiveSwitch( - checked = state.rushBranding, - onCheckedChange = { - if (isProUser) { - onAction(SharePageAction.OnToggleRushBranding(it)) - } else { - onShowPaywall() - } - }, - ) - }, - ) - } } } } @@ -297,7 +232,5 @@ private fun Preview() { onAction = {}, onDismissRequest = {}, onLaunchColorPicker = {}, - isProUser = true, - onShowPaywall = {}, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/AlbumArt.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/AlbumArt.kt index 4263bc25..09bf9924 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/AlbumArt.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/AlbumArt.kt @@ -16,12 +16,9 @@ */ package com.shub39.rush.shared.ui.share.component.cards -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.aspectRatio -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.heightIn @@ -37,23 +34,18 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.material3.toShape import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Shape -import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding import com.shub39.rush.shared.ui.fromPx import com.shub39.rush.shared.ui.pxToDp import com.shub39.rush.shared.ui.theme.flexFontEmphasis -import com.shub39.rush.shared.ui.theme.flexFontRounded import io.github.vinceglb.filekit.PlatformFile @Composable @@ -61,58 +53,28 @@ fun AlbumArt( song: SongDetails, cardColors: CardColors, cardCorners: RoundedCornerShape, - fit: CardFit, modifier: Modifier = Modifier, albumArtShape: Shape = CircleShape, selectedImage: PlatformFile? = null, - rushBranding: Boolean, ) { Card(modifier = modifier, shape = cardCorners, colors = cardColors) { - Column( - modifier = - Modifier.fillMaxWidth().padding(pxToDp(30)).let { - if (fit == CardFit.STANDARD) { - it.fillMaxHeight() - } else it - }, - verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.CenterHorizontally, - ) { - ArtFromUrl( - imageUrl = selectedImage?.toString() ?: song.artUrl, - modifier = Modifier.fillMaxWidth().aspectRatio(1f).clip(albumArtShape), - ) - - Spacer(modifier = Modifier.height(pxToDp(28))) - + Column(modifier = Modifier.fillMaxWidth().padding(pxToDp(30))) { Text( - text = song.title, + text = song.artist, style = MaterialTheme.typography.headlineLarge .copy(fontFamily = flexFontEmphasis()) - .fromPx(fontSize = 60, letterSpacing = 0, lineHeight = 60) - .copy(textAlign = TextAlign.Center), + .fromPx(fontSize = 80, letterSpacing = 0, lineHeight = 82), maxLines = 2, overflow = TextOverflow.Ellipsis, ) - Text( - text = song.artist, - style = - MaterialTheme.typography.headlineLarge - .copy(textAlign = TextAlign.Center, fontFamily = flexFontRounded()) - .fromPx(fontSize = 30, letterSpacing = 0, lineHeight = 30), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - - AnimatedVisibility(visible = rushBranding) { - RushBranding( - color = cardColors.contentColor, - modifier = Modifier.padding(top = pxToDp(48)), - ) - } Spacer(modifier = Modifier.height(pxToDp(28))) + + ArtFromUrl( + imageUrl = selectedImage?.toString() ?: song.artUrl, + modifier = Modifier.fillMaxWidth().aspectRatio(1f).clip(albumArtShape), + ) } } } @@ -130,8 +92,6 @@ private fun Preview() { containerColor = MaterialTheme.colorScheme.primary, ), cardCorners = RoundedCornerShape(pxToDp(32)), - fit = CardFit.FIT, albumArtShape = VerySunny.toShape(), - rushBranding = true, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/BratShareCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/BratShareCard.kt new file mode 100644 index 00000000..662e37be --- /dev/null +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/BratShareCard.kt @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2026 Shubham Gorai + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.shub39.rush.shared.ui.share.component.cards + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Card +import androidx.compose.material3.CardColors +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewWrapper +import com.shub39.rush.shared.core.dataclasses.SongDetails +import com.shub39.rush.shared.ui.RushPreviewWrapper +import com.shub39.rush.shared.ui.fromPx +import com.shub39.rush.shared.ui.pxToDp +import com.shub39.rush.shared.ui.theme.flexFontEmphasis +import com.shub39.rush.shared.ui.theme.flexFontRounded +import org.jetbrains.compose.resources.Font +import rush.shared.ui.generated.resources.Res +import rush.shared.ui.generated.resources.google_sans_flex + +@Composable +fun BratShareCard( + modifier: Modifier, + song: SongDetails, + sortedLines: Map, + cardColors: CardColors, + cardCorners: RoundedCornerShape, +) { + val artistFont = FontFamily(Font(Res.font.google_sans_flex)) + val lyricsFont = flexFontEmphasis(slant = 0f, fontWeight = 300, fontWidth = 60f) + + Card(modifier = modifier, colors = cardColors, shape = cardCorners) { + Box(modifier = Modifier.fillMaxWidth()) { + Text( + text = sortedLines.values.firstOrNull() ?: "Woah...", + style = + MaterialTheme.typography.displayMedium + .copy(fontFamily = lyricsFont, textAlign = TextAlign.Justify) + .fromPx(fontSize = 100, letterSpacing = 0, lineHeight = 120), + modifier = Modifier.padding(pxToDp(64)), + ) + } + + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.background(Color.Black), + ) { + Column(modifier = Modifier.fillMaxWidth().padding(pxToDp(16))) { + Text( + text = song.title, + style = + MaterialTheme.typography.titleMedium + .copy(fontFamily = flexFontRounded(), color = Color.White) + .fromPx(fontSize = 20, letterSpacing = 0, lineHeight = 22), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + + Text( + text = song.artist, + style = + MaterialTheme.typography.bodySmall + .copy(fontFamily = artistFont, color = Color.White) + .fromPx(fontSize = 16, letterSpacing = 0, lineHeight = 18), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } + } + } +} + +@PreviewWrapper(RushPreviewWrapper::class) +@Preview +@Composable +private fun Preview() { + BratShareCard( + modifier = Modifier.width(pxToDp(720)).heightIn(max = pxToDp(1280)), + song = SongDetails(title = "Test Song", artist = "Eminem", null, ""), + sortedLines = + mapOf(0 to "This is a simple line") + .plus( + 0 to + "Hello this is a very very very very very the quick browm fox jumps over the lazy dog" + ), + cardColors = + CardDefaults.cardColors( + contentColor = MaterialTheme.colorScheme.onPrimary, + containerColor = MaterialTheme.colorScheme.primary, + ), + cardCorners = RoundedCornerShape(pxToDp(48)), + ) +} diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/ChatCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/ChatCard.kt deleted file mode 100644 index 53199736..00000000 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/ChatCard.kt +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2026 Shubham Gorai - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.shub39.rush.shared.ui.share.component.cards - -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxHeight -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.heightIn -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width -import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.shape.CircleShape -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Card -import androidx.compose.material3.CardColors -import androidx.compose.material3.CardDefaults -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Shape -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.tooling.preview.PreviewWrapper -import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit -import com.shub39.rush.shared.ui.RushPreviewWrapper -import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding -import com.shub39.rush.shared.ui.fromPx -import com.shub39.rush.shared.ui.pxToDp -import com.shub39.rush.shared.ui.theme.flexFontRounded - -@Composable -fun ChatCard( - modifier: Modifier, - song: SongDetails, - sortedLines: Map, - cardColors: CardColors, - cardCorners: RoundedCornerShape, - fit: CardFit, - albumArtShape: Shape = CircleShape, - rushBranding: Boolean, -) { - Card( - modifier = modifier, - shape = cardCorners, - colors = - CardDefaults.cardColors( - containerColor = cardColors.containerColor, - contentColor = cardColors.contentColor, - ), - ) { - Column( - modifier = - Modifier.padding(pxToDp(48)).let { - if (fit == CardFit.STANDARD) { - it.fillMaxHeight() - } else it - }, - verticalArrangement = Arrangement.Center, - ) { - LazyColumn( - modifier = Modifier.fillMaxWidth(), - verticalArrangement = Arrangement.spacedBy(pxToDp(8)), - ) { - item { - Row( - verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.padding(bottom = pxToDp(24)), - ) { - ArtFromUrl( - imageUrl = song.artUrl, - modifier = Modifier.size(pxToDp(100)).clip(albumArtShape), - ) - - Column(modifier = Modifier.padding(horizontal = pxToDp(16))) { - Text( - text = song.title, - style = - MaterialTheme.typography.titleMedium - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 28), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - - Text( - text = song.artist, - style = - MaterialTheme.typography.bodySmall - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 28, letterSpacing = 0, lineHeight = 24), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - } - } - } - - sortedLines.entries.toList().forEachIndexed { index, it -> - item { - Card( - shape = - when (index) { - 0 -> - RoundedCornerShape( - topStart = pxToDp(16), - topEnd = pxToDp(16), - bottomEnd = pxToDp(16), - bottomStart = pxToDp(4), - ) - else -> - RoundedCornerShape( - topEnd = pxToDp(16), - bottomEnd = pxToDp(16), - topStart = pxToDp(4), - bottomStart = pxToDp(4), - ) - }, - colors = - cardColors.copy( - containerColor = cardColors.contentColor, - contentColor = cardColors.containerColor, - ), - ) { - Text( - text = it.value, - style = - MaterialTheme.typography.bodyMedium.fromPx( - fontSize = 42, - fontWeight = FontWeight.Bold, - letterSpacing = 0, - lineHeight = 42, - ), - modifier = - Modifier.padding(horizontal = pxToDp(16), vertical = pxToDp(8)), - ) - } - } - } - } - - AnimatedVisibility(visible = rushBranding) { - RushBranding( - color = cardColors.contentColor, - modifier = Modifier.padding(top = pxToDp(32), bottom = pxToDp(12)), - ) - } - } - } -} - -@PreviewWrapper(RushPreviewWrapper::class) -@Preview -@Composable -private fun Preview() { - ChatCard( - modifier = Modifier.width(pxToDp(720)).heightIn(max = pxToDp(1280)), - song = SongDetails(title = "Test Song", artist = "Eminem", null, ""), - sortedLines = (0..5).associateWith { "This is a simple line $it" }, - cardColors = - CardDefaults.cardColors( - contentColor = MaterialTheme.colorScheme.onPrimary, - containerColor = MaterialTheme.colorScheme.primary, - ), - cardCorners = RoundedCornerShape(pxToDp(48)), - fit = CardFit.FIT, - rushBranding = true, - ) -} diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/CoupletShareCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/CoupletShareCard.kt index f558a5d5..4ec74013 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/CoupletShareCard.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/CoupletShareCard.kt @@ -16,7 +16,6 @@ */ package com.shub39.rush.shared.ui.share.component.cards -import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -40,18 +39,20 @@ import androidx.compose.ui.draw.blur import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding import com.shub39.rush.shared.ui.fromPx import com.shub39.rush.shared.ui.pxToDp import com.shub39.rush.shared.ui.theme.flexFontEmphasis import com.shub39.rush.shared.ui.theme.flexFontRounded +import org.jetbrains.compose.resources.Font +import rush.shared.ui.generated.resources.Res +import rush.shared.ui.generated.resources.google_sans_flex @Composable fun CoupletShareCard( @@ -60,10 +61,11 @@ fun CoupletShareCard( sortedLines: Map, cardColors: CardColors, cardCorners: RoundedCornerShape, - fit: CardFit, albumArtShape: Shape = CircleShape, - rushBranding: Boolean, ) { + val artistFont = FontFamily(Font(Res.font.google_sans_flex)) + val lyricsFont = flexFontEmphasis(slant = 0f, fontWeight = 400, fontWidth = 100f) + Box(modifier = modifier.clip(cardCorners)) { ArtFromUrl(imageUrl = song.artUrl, modifier = Modifier.matchParentSize().blur(pxToDp(12))) @@ -75,38 +77,26 @@ fun CoupletShareCard( Card(colors = cardColors.copy(containerColor = Color.Transparent)) { Row( - modifier = - Modifier.padding(pxToDp(48)).let { - if (fit == CardFit.STANDARD) { - it.weight(1f) - } else it - }, + modifier = Modifier.padding(pxToDp(48)), verticalAlignment = Alignment.CenterVertically, ) { Column { - AnimatedVisibility(visible = rushBranding) { - RushBranding( - color = cardColors.contentColor, - modifier = Modifier.padding(bottom = pxToDp(48)), - ) - } - Text( text = sortedLines.values.firstOrNull() ?: "Woah...", style = MaterialTheme.typography.displayMedium .copy(fontFamily = flexFontEmphasis()) - .fromPx(fontSize = 48, letterSpacing = 0, lineHeight = 48), + .fromPx(fontSize = 48, letterSpacing = 0, lineHeight = 50), ) + Spacer(modifier = Modifier.padding(pxToDp(8))) + Text( text = sortedLines.values.elementAtOrNull(1) ?: "...", style = - MaterialTheme.typography.displaySmall.fromPx( - letterSpacing = 0, - lineHeight = 38, - fontSize = 36, - ), + MaterialTheme.typography.displaySmall + .copy(fontFamily = lyricsFont) + .fromPx(letterSpacing = 0, lineHeight = 38, fontSize = 36), ) Spacer(modifier = Modifier.padding(pxToDp(64))) @@ -123,7 +113,7 @@ fun CoupletShareCard( style = MaterialTheme.typography.titleMedium .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 28), + .fromPx(fontSize = 24, letterSpacing = 0, lineHeight = 26), maxLines = 1, overflow = TextOverflow.Ellipsis, ) @@ -132,8 +122,8 @@ fun CoupletShareCard( text = song.artist, style = MaterialTheme.typography.bodySmall - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 28, letterSpacing = 0, lineHeight = 24), + .copy(fontFamily = artistFont) + .fromPx(fontSize = 18, letterSpacing = 0, lineHeight = 20), maxLines = 1, overflow = TextOverflow.Ellipsis, ) @@ -164,7 +154,5 @@ private fun Preview() { containerColor = MaterialTheme.colorScheme.primary, ), cardCorners = RoundedCornerShape(pxToDp(48)), - fit = CardFit.FIT, - rushBranding = false, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/HypnoticShareCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/HypnoticShareCard.kt index a70c1132..f428cb27 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/HypnoticShareCard.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/HypnoticShareCard.kt @@ -29,7 +29,6 @@ import androidx.compose.ui.graphics.Shape import com.materialkolor.ktx.darken import com.materialkolor.ktx.lighten import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.ui.component.HypnoticVisualizer import com.shub39.rush.shared.ui.generateGradientColors @@ -40,9 +39,7 @@ fun HypnoticShareCard( sortedLines: Map, cardColors: CardColors, cardCorners: RoundedCornerShape, - fit: CardFit, albumArtShape: Shape = CircleShape, - rushBranding: Boolean, ) { Box(modifier = modifier.clip(cardCorners)) { HypnoticVisualizer( @@ -61,8 +58,6 @@ fun HypnoticShareCard( cardColors = cardColors.copy(containerColor = Color.Transparent), cardCorners = cardCorners, albumArtShape = albumArtShape, - fit = fit, - rushBranding = rushBranding, ) } } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/MessyCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/MessyCard.kt index 0cfed0d9..d3f6b1fc 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/MessyCard.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/MessyCard.kt @@ -16,13 +16,15 @@ */ package com.shub39.rush.shared.ui.share.component.cards -import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.FlowRow -import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width @@ -46,10 +48,8 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding import com.shub39.rush.shared.ui.fromPx import com.shub39.rush.shared.ui.pxToDp import com.shub39.rush.shared.ui.pxToSp @@ -57,6 +57,9 @@ import com.shub39.rush.shared.ui.theme.flexFontEmphasis import com.shub39.rush.shared.ui.theme.flexFontRounded import kotlin.math.roundToInt import kotlin.random.Random +import org.jetbrains.compose.resources.Font +import rush.shared.ui.generated.resources.Res +import rush.shared.ui.generated.resources.google_sans_flex private data class Word( val text: String, @@ -64,6 +67,7 @@ private data class Word( val fontSize: Int, val fontWidth: Float, val angle: Int, + val highLight: Boolean, ) private val fontCache = mutableMapOf, FontFamily>() @@ -82,11 +86,11 @@ fun MessyCard( sortedLines: Map, cardColors: CardColors, cardCorners: RoundedCornerShape, - fit: CardFit, albumArtShape: Shape = CircleShape, - rushBranding: Boolean, seed: Long, ) { + val artistFont = FontFamily(Font(Res.font.google_sans_flex)) + val firstLine = sortedLines.values.firstOrNull() ?: "Woah..." val words = remember(seed, firstLine) { @@ -97,85 +101,98 @@ fun MessyCard( Word( text = if (Random.nextBoolean()) it.uppercase() else it.lowercase(), fontWeight = Random.nextInt(3, 10) * 100, - fontSize = Random.nextInt(3, 10) * 10, + fontSize = Random.nextInt(4, 8) * 10, fontWidth = (Random.nextInt(5, 12) * 10).toFloat(), angle = Random.nextInt(-10, 10), + highLight = Random.nextBoolean(), ) } } Card(modifier = modifier, colors = cardColors, shape = cardCorners) { - Column( - modifier = - Modifier.padding(pxToDp(48)).let { - if (fit == CardFit.STANDARD) { - it.weight(1f) - } else it - }, - verticalArrangement = Arrangement.Center, - ) { - AnimatedVisibility(visible = rushBranding) { - RushBranding( - color = cardColors.contentColor, - modifier = Modifier.padding(bottom = pxToDp(32)), - ) - } - - FlowRow( - horizontalArrangement = Arrangement.spacedBy(pxToDp(16)), - verticalArrangement = Arrangement.spacedBy(pxToDp(16)), - ) { - words.forEach { word -> - Text( - text = word.text, - style = - TextStyle( - fontFamily = - flexFontEmphasisCached( - weight = word.fontWeight, - width = - (if (word.text.length > 10) 100f else word.fontWidth) - .roundToInt(), - ), - fontSize = pxToSp(word.fontSize), - ), - modifier = Modifier.rotate(word.angle.toFloat()), - ) - } - } + Box { + Box( + modifier = + Modifier.offset(x = pxToDp(93), y = pxToDp(93)) + .align(Alignment.BottomEnd) + .size(pxToDp(350)) + .background(color = cardColors.contentColor, shape = albumArtShape) + ) - Spacer(modifier = Modifier.padding(pxToDp(64))) + ArtFromUrl( + imageUrl = song.artUrl, + modifier = + Modifier.offset(x = pxToDp(80), y = pxToDp(80)) + .align(Alignment.BottomEnd) + .size(pxToDp(300)) + .clip(albumArtShape), + ) - Row(verticalAlignment = Alignment.CenterVertically) { + Column { Column( - modifier = Modifier.weight(1f).padding(horizontal = pxToDp(32)), - horizontalAlignment = Alignment.End, + modifier = Modifier.fillMaxWidth().padding(pxToDp(48)), + verticalArrangement = Arrangement.Center, ) { - Text( - text = song.title, - style = - MaterialTheme.typography.titleMedium - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 32), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) + FlowRow( + horizontalArrangement = Arrangement.spacedBy(pxToDp(16)), + verticalArrangement = Arrangement.spacedBy(pxToDp(16)), + ) { + words.forEach { word -> + Card( + modifier = Modifier.rotate(word.angle.toFloat()), + shape = cardCorners, + colors = + if (word.highLight) + CardDefaults.cardColors( + containerColor = cardColors.contentColor, + contentColor = cardColors.containerColor, + ) + else cardColors, + ) { + Text( + text = word.text, + style = + TextStyle( + fontFamily = + flexFontEmphasisCached( + weight = word.fontWeight, + width = + (if (word.text.length > 10) 100f + else word.fontWidth) + .roundToInt(), + ), + fontSize = pxToSp(word.fontSize), + ), + modifier = Modifier.padding(pxToDp(8)), + ) + } + } + } - Text( - text = song.artist, - style = - MaterialTheme.typography.bodySmall - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 26, letterSpacing = 0, lineHeight = 26), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) - } + Spacer(modifier = Modifier.padding(pxToDp(64))) - ArtFromUrl( - imageUrl = song.artUrl, - modifier = Modifier.size(pxToDp(100)).clip(albumArtShape), - ) + Column(modifier = Modifier.fillMaxWidth(0.7f)) { + Text( + text = song.title, + style = + MaterialTheme.typography.titleMedium + .copy(fontFamily = flexFontRounded()) + .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 32), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + + Text( + text = song.artist, + style = + MaterialTheme.typography.bodySmall + .copy(fontFamily = artistFont) + .fromPx(fontSize = 20, letterSpacing = 0, lineHeight = 22), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } + } } } } @@ -200,8 +217,6 @@ private fun Preview() { containerColor = MaterialTheme.colorScheme.primary, ), cardCorners = RoundedCornerShape(pxToDp(48)), - fit = CardFit.FIT, - rushBranding = true, seed = 0, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/QuoteShareCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/QuoteShareCard.kt index 588caa02..c0711028 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/QuoteShareCard.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/QuoteShareCard.kt @@ -16,13 +16,15 @@ */ package com.shub39.rush.shared.ui.share.component.cards -import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width @@ -39,21 +41,21 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Shape -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding import com.shub39.rush.shared.ui.fromPx import com.shub39.rush.shared.ui.pxToDp +import com.shub39.rush.shared.ui.theme.flexFontEmphasis import com.shub39.rush.shared.ui.theme.flexFontRounded +import org.jetbrains.compose.resources.Font import org.jetbrains.compose.resources.painterResource import rush.shared.ui.generated.resources.Res +import rush.shared.ui.generated.resources.google_sans_flex import rush.shared.ui.generated.resources.quote @Composable @@ -63,77 +65,76 @@ fun QuoteShareCard( sortedLines: Map, cardColors: CardColors, cardCorners: RoundedCornerShape, - fit: CardFit, albumArtShape: Shape = CircleShape, - rushBranding: Boolean, ) { - Card(modifier = modifier, colors = cardColors, shape = cardCorners) { - Column( - modifier = - Modifier.padding(pxToDp(48)).let { - if (fit == CardFit.STANDARD) { - it.weight(1f) - } else it - }, - verticalArrangement = Arrangement.Center, - ) { - Row( - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween, - modifier = Modifier.fillMaxWidth(), - ) { - Icon( - painter = painterResource(Res.drawable.quote), - contentDescription = "Quote", - modifier = Modifier.size(pxToDp(60)), - ) - - AnimatedVisibility(visible = rushBranding) { - RushBranding(color = cardColors.contentColor) - } - } + val artistFont = FontFamily(Font(Res.font.google_sans_flex)) + val lyricsFont = flexFontEmphasis(slant = 0f, fontWeight = 600, fontWidth = 100f) - Spacer(modifier = Modifier.padding(pxToDp(16))) + Card(modifier = modifier, colors = cardColors, shape = cardCorners) { + Box(modifier = Modifier.fillMaxWidth()) { + Box( + modifier = + Modifier.offset(x = pxToDp(93), y = pxToDp(93)) + .align(Alignment.BottomEnd) + .size(pxToDp(350)) + .background(color = cardColors.contentColor, shape = albumArtShape) + ) - Text( - text = sortedLines.values.firstOrNull() ?: "Woah...", - style = - MaterialTheme.typography.displayMedium.fromPx( - fontWeight = FontWeight.ExtraBold, - fontSize = 50, - letterSpacing = 0, - lineHeight = 52, - ), + ArtFromUrl( + imageUrl = song.artUrl, + modifier = + Modifier.offset(x = pxToDp(80), y = pxToDp(80)) + .size(pxToDp(300)) + .clip(albumArtShape) + .align(Alignment.BottomEnd), ) - Spacer(modifier = Modifier.padding(pxToDp(64))) + Column { + Column( + modifier = Modifier.padding(pxToDp(48)), + verticalArrangement = Arrangement.Center, + ) { + Icon( + painter = painterResource(Res.drawable.quote), + contentDescription = "Quote", + modifier = Modifier.size(pxToDp(60)), + ) - Row(verticalAlignment = Alignment.CenterVertically) { - ArtFromUrl( - imageUrl = song.artUrl, - modifier = Modifier.size(pxToDp(100)).clip(albumArtShape), - ) + Spacer(modifier = Modifier.padding(pxToDp(16))) - Column(modifier = Modifier.padding(horizontal = pxToDp(32))) { Text( - text = song.title, + text = sortedLines.values.firstOrNull() ?: "Woah...", style = - MaterialTheme.typography.titleMedium - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 28), - maxLines = 1, - overflow = TextOverflow.Ellipsis, + MaterialTheme.typography.displayMedium + .copy(fontFamily = lyricsFont) + .fromPx(fontSize = 50, letterSpacing = 0, lineHeight = 60), ) - Text( - text = song.artist, - style = - MaterialTheme.typography.bodySmall - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 28, letterSpacing = 0, lineHeight = 26), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - ) + Spacer(modifier = Modifier.padding(pxToDp(84))) + + Row(verticalAlignment = Alignment.CenterVertically) { + Column(modifier = Modifier.fillMaxWidth(0.7f)) { + Text( + text = song.title, + style = + MaterialTheme.typography.titleMedium + .copy(fontFamily = flexFontRounded()) + .fromPx(fontSize = 28, letterSpacing = 0, lineHeight = 30), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + + Text( + text = song.artist, + style = + MaterialTheme.typography.bodySmall + .copy(fontFamily = artistFont) + .fromPx(fontSize = 22, letterSpacing = 0, lineHeight = 22), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + ) + } + } } } } @@ -159,7 +160,5 @@ private fun Preview() { containerColor = MaterialTheme.colorScheme.primary, ), cardCorners = RoundedCornerShape(pxToDp(48)), - fit = CardFit.FIT, - rushBranding = true, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/RushedShareCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/RushedShareCard.kt index ff67c58e..2dc89ef6 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/RushedShareCard.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/RushedShareCard.kt @@ -16,7 +16,6 @@ */ package com.shub39.rush.shared.ui.share.component.cards -import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -40,8 +39,10 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.blur import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview @@ -49,11 +50,13 @@ import androidx.compose.ui.tooling.preview.PreviewWrapper import com.shub39.rush.shared.core.dataclasses.SongDetails import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding import com.shub39.rush.shared.ui.fromPx import com.shub39.rush.shared.ui.pxToDp import com.shub39.rush.shared.ui.theme.flexFontRounded import io.github.vinceglb.filekit.PlatformFile +import org.jetbrains.compose.resources.Font +import rush.shared.ui.generated.resources.Res +import rush.shared.ui.generated.resources.google_sans_flex @Composable fun RushedShareCard( @@ -64,46 +67,41 @@ fun RushedShareCard( cardCorners: RoundedCornerShape, selectedImage: PlatformFile?, albumArtShape: Shape = CircleShape, - rushBranding: Boolean, ) { + val font = FontFamily(Font(Res.font.google_sans_flex)) + Box(modifier = modifier.clip(cardCorners)) { ArtFromUrl( imageUrl = selectedImage?.toString() ?: song.artUrl, - modifier = Modifier.matchParentSize(), + modifier = Modifier.matchParentSize().blur(pxToDp(10)), ) Box( modifier = Modifier.fillMaxWidth() - .background(cardColors.containerColor.copy(0.8f)) + .background(cardColors.containerColor.copy(0.5f)) .matchParentSize() ) Column( modifier = Modifier.fillMaxWidth().padding(pxToDp(48)).align(Alignment.BottomStart) ) { - AnimatedVisibility(visible = rushBranding) { - RushBranding( - color = cardColors.contentColor, - modifier = Modifier.padding(bottom = pxToDp(42)), - ) - } - LazyColumn(verticalArrangement = Arrangement.spacedBy(pxToDp(16))) { items(sortedLines.values.toList()) { - Card(colors = cardColors, shape = RoundedCornerShape(pxToDp(16))) { + Card(colors = cardColors, shape = cardCorners) { Text( text = it, color = cardColors.contentColor, style = - MaterialTheme.typography.bodyMedium.fromPx( - fontSize = 42, - letterSpacing = 0, - lineHeight = 48, - fontWeight = FontWeight.Bold, - ), - modifier = - Modifier.padding(vertical = pxToDp(8), horizontal = pxToDp(16)), + MaterialTheme.typography.bodyMedium + .copy(fontFamily = font) + .fromPx( + fontWeight = FontWeight.Bold, + fontSize = 42, + letterSpacing = 0, + lineHeight = 48, + ), + modifier = Modifier.padding(pxToDp(16)), ) } } @@ -134,7 +132,7 @@ fun RushedShareCard( text = song.artist, style = MaterialTheme.typography.bodySmall - .copy(fontFamily = flexFontRounded()) + .copy(fontFamily = font) .fromPx(fontSize = 28, letterSpacing = 0, lineHeight = 24), color = cardColors.contentColor, maxLines = 1, @@ -167,6 +165,5 @@ private fun Preview() { ), cardCorners = RoundedCornerShape(pxToDp(48)), selectedImage = null, - rushBranding = true, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/SpotifyShareCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/SpotifyShareCard.kt index 56a00e68..2ea53fbf 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/SpotifyShareCard.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/SpotifyShareCard.kt @@ -16,12 +16,10 @@ */ package com.shub39.rush.shared.ui.share.component.cards -import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -32,27 +30,28 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Card import androidx.compose.material3.CardColors import androidx.compose.material3.CardDefaults -import androidx.compose.material3.MaterialShapes import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text -import androidx.compose.material3.toShape import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit +import com.shub39.rush.shared.core.enums.AlbumArtShape import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding import com.shub39.rush.shared.ui.fromPx import com.shub39.rush.shared.ui.pxToDp -import com.shub39.rush.shared.ui.theme.flexFontRounded +import com.shub39.rush.shared.ui.toMaterialShape +import org.jetbrains.compose.resources.Font +import rush.shared.ui.generated.resources.Res +import rush.shared.ui.generated.resources.figtree @Composable fun SpotifyShareCard( @@ -61,24 +60,16 @@ fun SpotifyShareCard( sortedLines: Map, cardColors: CardColors, cardCorners: RoundedCornerShape, - fit: CardFit, albumArtShape: Shape = CircleShape, - rushBranding: Boolean, ) { + val font = FontFamily(Font(Res.font.figtree)) + Card(modifier = modifier, shape = cardCorners, colors = cardColors) { - Column( - modifier = - Modifier.padding(pxToDp(48)).let { - if (fit == CardFit.STANDARD) { - it.fillMaxHeight() - } else it - }, - verticalArrangement = Arrangement.Center, - ) { + Column(modifier = Modifier.padding(pxToDp(48)), verticalArrangement = Arrangement.Center) { Row(verticalAlignment = Alignment.CenterVertically) { ArtFromUrl( imageUrl = song.artUrl, - modifier = Modifier.size(pxToDp(100)).clip(albumArtShape), + modifier = Modifier.size(pxToDp(140)).clip(albumArtShape), ) Column(modifier = Modifier.padding(horizontal = pxToDp(16))) { @@ -86,8 +77,13 @@ fun SpotifyShareCard( text = song.title, style = MaterialTheme.typography.titleMedium - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 28), + .copy(fontFamily = font) + .fromPx( + fontWeight = FontWeight.Bold, + fontSize = 32, + letterSpacing = 0, + lineHeight = 28, + ), maxLines = 1, overflow = TextOverflow.Ellipsis, ) @@ -96,7 +92,7 @@ fun SpotifyShareCard( text = song.artist, style = MaterialTheme.typography.bodySmall - .copy(fontFamily = flexFontRounded()) + .copy(fontFamily = font) .fromPx(fontSize = 26, letterSpacing = 0, lineHeight = 26), maxLines = 1, overflow = TextOverflow.Ellipsis, @@ -104,7 +100,7 @@ fun SpotifyShareCard( } } - Spacer(modifier = Modifier.padding(pxToDp(16))) + Spacer(modifier = Modifier.padding(pxToDp(32))) LazyColumn(verticalArrangement = Arrangement.spacedBy(pxToDp(16))) { sortedLines.forEach { @@ -112,23 +108,20 @@ fun SpotifyShareCard( Text( text = it.value, style = - MaterialTheme.typography.bodyMedium.fromPx( - fontWeight = FontWeight.Bold, - fontSize = 42, - letterSpacing = 0, - lineHeight = 48, - ), + MaterialTheme.typography.bodyMedium + .copy(fontFamily = font) + .fromPx( + fontWeight = FontWeight.Bold, + fontSize = 42, + letterSpacing = 0, + lineHeight = 48, + ), ) } } } - AnimatedVisibility(visible = rushBranding) { - RushBranding( - color = cardColors.contentColor, - modifier = Modifier.padding(top = pxToDp(56)), - ) - } + Spacer(modifier = Modifier.padding(pxToDp(8))) } } } @@ -153,8 +146,6 @@ private fun Preview() { containerColor = MaterialTheme.colorScheme.primary, ), cardCorners = RoundedCornerShape(pxToDp(48)), - fit = CardFit.FIT, - albumArtShape = MaterialShapes.Square.toShape(), - rushBranding = false, + albumArtShape = AlbumArtShape.RECTANGLE.toMaterialShape(), ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/VerticalShareCard.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/VerticalShareCard.kt index cdfd534f..7e8ca223 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/VerticalShareCard.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/share/component/cards/VerticalShareCard.kt @@ -16,12 +16,10 @@ */ package com.shub39.rush.shared.ui.share.component.cards -import androidx.compose.animation.AnimatedVisibility import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -40,20 +38,22 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Shape -import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper import com.shub39.rush.shared.core.dataclasses.SongDetails -import com.shub39.rush.shared.core.enums.CardFit import com.shub39.rush.shared.ui.RushPreviewWrapper import com.shub39.rush.shared.ui.component.ArtFromUrl -import com.shub39.rush.shared.ui.component.RushBranding import com.shub39.rush.shared.ui.fromPx import com.shub39.rush.shared.ui.pxToDp import com.shub39.rush.shared.ui.rotateVertically +import com.shub39.rush.shared.ui.theme.flexFontEmphasis import com.shub39.rush.shared.ui.theme.flexFontRounded +import org.jetbrains.compose.resources.Font +import rush.shared.ui.generated.resources.Res +import rush.shared.ui.generated.resources.google_sans_flex @Composable fun VerticalShareCard( @@ -62,81 +62,65 @@ fun VerticalShareCard( sortedLines: Map, cardColors: CardColors, cardCorners: RoundedCornerShape, - fit: CardFit, albumArtShape: Shape = CircleShape, - rushBranding: Boolean, ) { - Card(modifier = modifier, shape = cardCorners) { - Card(colors = cardColors) { - Row( - modifier = - Modifier.padding(pxToDp(48)).let { - if (fit == CardFit.STANDARD) { - it.fillMaxHeight() - } else it - } - ) { - Column(horizontalAlignment = Alignment.CenterHorizontally) { - ArtFromUrl( - imageUrl = song.artUrl, - modifier = Modifier.size(pxToDp(100)).clip(albumArtShape), - ) + val artistFont = FontFamily(Font(Res.font.google_sans_flex)) + val lyricsFont = flexFontEmphasis(slant = -10f, fontWeight = 600, fontWidth = 80f) + + Card(modifier = modifier, shape = cardCorners, colors = cardColors) { + Row(modifier = Modifier.padding(pxToDp(48))) { + Column(horizontalAlignment = Alignment.CenterHorizontally) { + ArtFromUrl( + imageUrl = song.artUrl, + modifier = Modifier.size(pxToDp(100)).clip(albumArtShape), + ) - Spacer(modifier = Modifier.padding(pxToDp(8))) + Spacer(modifier = Modifier.padding(pxToDp(8))) - Row { - Text( - text = song.artist, - style = - MaterialTheme.typography.bodySmall - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 24, letterSpacing = 0, lineHeight = 24), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.rotateVertically(), - ) + Row { + Text( + text = song.artist, + style = + MaterialTheme.typography.bodySmall + .copy(fontFamily = artistFont) + .fromPx(fontSize = 24, letterSpacing = 0, lineHeight = 24), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.rotateVertically(), + ) - Text( - text = song.title, - style = - MaterialTheme.typography.titleMedium - .copy(fontFamily = flexFontRounded()) - .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 28), - maxLines = 1, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.rotateVertically(), - ) - } + Text( + text = song.title, + style = + MaterialTheme.typography.titleMedium + .copy(fontFamily = flexFontRounded()) + .fromPx(fontSize = 32, letterSpacing = 0, lineHeight = 28), + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.rotateVertically(), + ) } + } - Spacer(modifier = Modifier.padding(pxToDp(8))) + Spacer(modifier = Modifier.padding(pxToDp(16))) - LazyColumn( - modifier = Modifier.weight(1f), - verticalArrangement = Arrangement.spacedBy(pxToDp(10)), - ) { - items(sortedLines.entries.toList()) { - Text( - text = it.value, - fontStyle = FontStyle.Italic, - style = - MaterialTheme.typography.bodyMedium.fromPx( + LazyColumn( + modifier = Modifier.weight(1f), + verticalArrangement = Arrangement.spacedBy(pxToDp(16)), + ) { + items(sortedLines.entries.toList()) { + Text( + text = it.value, + style = + MaterialTheme.typography.bodyMedium + .copy(fontFamily = lyricsFont) + .fromPx( fontWeight = FontWeight.Bold, fontSize = 42, letterSpacing = 0, lineHeight = 44, ), - ) - } - - item { - AnimatedVisibility(visible = rushBranding) { - RushBranding( - color = cardColors.contentColor, - modifier = Modifier.padding(top = pxToDp(42)), - ) - } - } + ) } } } @@ -163,7 +147,5 @@ private fun Preview() { containerColor = MaterialTheme.colorScheme.primary, ), cardCorners = RoundedCornerShape(pxToDp(48)), - fit = CardFit.FIT, - rushBranding = true, ) } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/LyricsVM.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/LyricsVM.kt index fd9bed48..d666e88d 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/LyricsVM.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/LyricsVM.kt @@ -127,7 +127,7 @@ class LyricsVM( stateLayer.sharePageState.update { it.copy( songDetails = action.songDetails, - selectedLines = _state.value.selectedLines.sortMapByKeys(), + selectedLines = _state.value.selectedLines.sortMapByKeys(take = 6), ) } } diff --git a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/ShareVM.kt b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/ShareVM.kt index b111ceed..5618acd8 100644 --- a/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/ShareVM.kt +++ b/shared/ui/src/commonMain/kotlin/com/shub39/rush/shared/ui/viewmodels/ShareVM.kt @@ -16,11 +16,19 @@ */ package com.shub39.rush.shared.ui.viewmodels +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.luminance +import androidx.compose.ui.graphics.toArgb import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope +import com.shub39.rush.shared.core.enums.AlbumArtShape +import com.shub39.rush.shared.core.enums.CardColors +import com.shub39.rush.shared.core.enums.CardTheme +import com.shub39.rush.shared.core.enums.CornerRadius import com.shub39.rush.shared.core.interfaces.SharePagePreferences import com.shub39.rush.shared.ui.share.SharePageAction import com.shub39.rush.shared.ui.share.SharePageState +import kotlin.random.Random import kotlinx.coroutines.Job import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.asStateFlow @@ -66,11 +74,6 @@ class ShareVM(stateLayer: SharedStates, @Provided private val datastore: SharePa .onEach { color -> _state.update { it.copy(cardContent = color) } } .launchIn(this) - datastore - .getCardFitFlow() - .onEach { fit -> _state.update { it.copy(cardFit = fit) } } - .launchIn(this) - datastore .getCardColorFlow() .onEach { colors -> _state.update { it.copy(cardColors = colors) } } @@ -86,16 +89,6 @@ class ShareVM(stateLayer: SharedStates, @Provided private val datastore: SharePa .onEach { theme -> _state.update { it.copy(cardTheme = theme) } } .launchIn(this) - datastore - .getCardFontFlow() - .onEach { font -> _state.update { it.copy(cardFont = font) } } - .launchIn(this) - - datastore - .showRushBranding() - .onEach { pref -> _state.update { it.copy(rushBranding = pref) } } - .launchIn(this) - datastore .getFullscreenShare() .onEach { fullScreen -> _state.update { it.copy(fullScreen = fullScreen) } } @@ -108,18 +101,47 @@ class ShareVM(stateLayer: SharedStates, @Provided private val datastore: SharePa when (action) { is SharePageAction.OnUpdateCardBackground -> datastore.updateCardBackground(action.color) + is SharePageAction.OnUpdateCardColor -> datastore.updateCardColor(action.color) is SharePageAction.OnUpdateCardContent -> datastore.updateCardContent(action.color) - is SharePageAction.OnUpdateCardFit -> datastore.updateCardFit(action.fit) is SharePageAction.OnUpdateCardRoundness -> datastore.updateCardRoundness(action.roundness) + is SharePageAction.OnUpdateCardTheme -> datastore.updateCardTheme(action.theme) - is SharePageAction.OnUpdateCardFont -> datastore.updateCardFont(action.font) is SharePageAction.OnUpdateAlbumArtShape -> datastore.updateAlbumArtShape(action.shape) - is SharePageAction.OnToggleRushBranding -> datastore.updateRushBranding(action.pref) + is SharePageAction.OnToggleFullScreen -> datastore.updateFullscreenShare(action.fullScreen) + + SharePageAction.OnRandomize -> { + when (val newCardColor = CardColors.entries.random()) { + CardColors.CUSTOM -> { + datastore.updateCardColor(newCardColor) + + val newBackground = + Color( + red = Random.nextFloat(), + blue = Random.nextFloat(), + green = Random.nextFloat(), + alpha = 1f, + ) + val newContent = + if (newBackground.luminance() >= 0.5) { + Color.Black + } else { + Color.White + } + datastore.updateCardBackground(newBackground.toArgb()) + datastore.updateCardContent(newContent.toArgb()) + } + else -> datastore.updateCardColor(newCardColor) + } + datastore.updateCardRoundness(CornerRadius.entries.random()) + datastore.updateCardTheme(CardTheme.entries.random()) + datastore.updateAlbumArtShape(AlbumArtShape.entries.random()) + datastore.updateFullscreenShare(Random.nextBoolean()) + } } } } diff --git a/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/setting/Util.jvm.kt b/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/setting/Util.jvm.kt index e46ec192..623298f4 100644 --- a/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/setting/Util.jvm.kt +++ b/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/setting/Util.jvm.kt @@ -65,7 +65,6 @@ actual fun ColumnScope.MaterialYouToggle( @Composable actual fun ColumnScope.PaletteStylePicker( modifier: Modifier, - enabled: Boolean, theme: Theme, onChange: (PaletteStyle) -> Unit, ) { @@ -108,7 +107,7 @@ actual fun ColumnScope.PaletteStylePicker( modifier = Modifier.size(50.dp) .clip(if (selected) MaterialShapes.VerySunny.toShape() else CircleShape) - .clickable(enabled = enabled) { onChange(style) }, + .clickable { onChange(style) }, contentAlignment = Alignment.Center, ) { Canvas(modifier = Modifier.matchParentSize()) { diff --git a/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.jvm.kt b/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.jvm.kt index 388b666b..5d74ffa0 100644 --- a/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.jvm.kt +++ b/shared/ui/src/jvmMain/kotlin/com/shub39/rush/shared/ui/share/SharePage.jvm.kt @@ -41,8 +41,6 @@ import kotlinx.coroutines.launch actual fun SharePage( onDismiss: () -> Unit, state: SharePageState, - isProUser: Boolean, - onShowPaywall: () -> Unit, onAction: (SharePageAction) -> Unit, ) { val coroutineScope = rememberCoroutineScope() @@ -79,8 +77,6 @@ actual fun SharePage( ) }, onLaunchImagePicker = { imagePicker.launch() }, - isProUser = isProUser, - onShowPaywall = onShowPaywall, onShareImage = {}, ) }