diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 95b35e4..dc83faa 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -4,6 +4,6 @@
-
+
\ No newline at end of file
diff --git a/app/src/main/java/com/bobbyesp/metadator/App.kt b/app/src/main/java/com/bobbyesp/metadator/App.kt
index 3e04b4f..f263f96 100644
--- a/app/src/main/java/com/bobbyesp/metadator/App.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/App.kt
@@ -1,34 +1,44 @@
package com.bobbyesp.metadator
import android.app.Application
-import android.content.ClipboardManager
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
-import android.net.ConnectivityManager
import android.os.Build
-import androidx.core.content.getSystemService
import com.bobbyesp.crashhandler.CrashHandler.setupCrashHandler
import com.bobbyesp.crashhandler.ReportInfo
+import com.bobbyesp.metadator.di.appCoroutinesScope
import com.bobbyesp.metadator.di.appMainViewModels
+import com.bobbyesp.metadator.di.appSystemManagers
import com.bobbyesp.metadator.di.mediaplayerViewModels
import com.bobbyesp.metadator.di.utilitiesViewModels
import com.bobbyesp.metadator.features.spotify.di.spotifyMainModule
import com.bobbyesp.metadator.features.spotify.di.spotifyServicesModule
+import com.bobbyesp.metadator.util.preferences.BooleanPreferenceDefaults
+import com.bobbyesp.metadator.util.preferences.IntPreferenceDefaults
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys
+import com.bobbyesp.metadator.util.preferences.StringPreferenceDefaults
+import com.bobbyesp.utilities.Preferences
import com.tencent.mmkv.MMKV
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.SupervisorJob
import mediaplayerInternalsModule
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.GlobalContext.startKoin
+import org.koin.dsl.module
import kotlin.properties.Delegates
class App : Application() {
override fun onCreate() {
MMKV.initialize(this)
+ preferences = Preferences(
+ PreferencesKeys.MMKV_PREFERENCES_NAME,
+ IntPreferenceDefaults,
+ StringPreferenceDefaults,
+ BooleanPreferenceDefaults
+ )
startKoin {
androidLogger()
androidContext(this@App)
+ modules(appSystemManagers, appCoroutinesScope)
modules(mediaplayerInternalsModule)
modules(appMainViewModels, utilitiesViewModels, mediaplayerViewModels)
modules(spotifyMainModule, spotifyServicesModule)
@@ -39,9 +49,6 @@ class App : Application() {
) else
getPackageInfo(packageName, 0)
}
- applicationScope = CoroutineScope(SupervisorJob())
- clipboard = getSystemService()!!
- connectivityManager = getSystemService()!!
isPlayStoreBuild = BuildConfig.FLAVOR == "playstore"
super.onCreate()
@@ -55,9 +62,7 @@ class App : Application() {
}
companion object {
- lateinit var clipboard: ClipboardManager
- lateinit var applicationScope: CoroutineScope
- lateinit var connectivityManager: ConnectivityManager
+ lateinit var preferences: Preferences
lateinit var packageInfo: PackageInfo
var isPlayStoreBuild by Delegates.notNull()
diff --git a/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt b/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt
index dd28bc2..cc977f8 100644
--- a/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt
@@ -1,11 +1,7 @@
package com.bobbyesp.metadator
-import android.content.ComponentName
import android.content.Intent
-import android.content.ServiceConnection
import android.os.Bundle
-import android.os.IBinder
-import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
@@ -17,12 +13,20 @@ import com.bobbyesp.mediaplayer.service.MediaplayerService
import com.bobbyesp.metadator.presentation.Navigator
import com.bobbyesp.metadator.presentation.common.AppLocalSettingsProvider
import com.bobbyesp.metadator.presentation.theme.MetadatorTheme
+import com.bobbyesp.metadator.util.preferences.BooleanPreferenceDefaults
+import com.bobbyesp.metadator.util.preferences.CoreSettings
+import com.bobbyesp.metadator.util.preferences.IntPreferenceDefaults
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys
+import com.bobbyesp.metadator.util.preferences.StringPreferenceDefaults
+import com.bobbyesp.utilities.Preferences
import org.koin.android.ext.android.inject
import org.koin.compose.KoinContext
+import org.koin.core.component.KoinComponent
import setCrashlyticsCollection
+import kotlin.getValue
@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
-class MainActivity : ComponentActivity() {
+class MainActivity : ComponentActivity(), KoinComponent {
private var isMusicPlayerServiceStarted = false
private val connectionHandler: ConnectionHandler by inject()
@@ -36,7 +40,11 @@ class MainActivity : ComponentActivity() {
setContent {
KoinContext {
val windowSizeClass = calculateWindowSizeClass(this)
- AppLocalSettingsProvider(windowSizeClass.widthSizeClass, connectionHandler) {
+ AppLocalSettingsProvider(
+ windowWidthSize = windowSizeClass.widthSizeClass,
+ playerConnectionHandler = connectionHandler,
+ coreSettings = CoreSettings(App.preferences.kv)
+ ) {
MetadatorTheme {
Navigator()
}
diff --git a/app/src/main/java/com/bobbyesp/metadator/di/AppSystemManagersModule.kt b/app/src/main/java/com/bobbyesp/metadator/di/AppSystemManagersModule.kt
new file mode 100644
index 0000000..fc4b6fa
--- /dev/null
+++ b/app/src/main/java/com/bobbyesp/metadator/di/AppSystemManagersModule.kt
@@ -0,0 +1,20 @@
+package com.bobbyesp.metadator.di
+
+import android.content.ClipboardManager
+import android.content.Context.CLIPBOARD_SERVICE
+import android.content.Context.CONNECTIVITY_SERVICE
+import android.net.ConnectivityManager
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.SupervisorJob
+import org.koin.android.ext.koin.androidApplication
+import org.koin.android.ext.koin.androidContext
+import org.koin.dsl.module
+
+val appSystemManagers = module {
+ single { androidApplication().getSystemService(CLIPBOARD_SERVICE) as ClipboardManager }
+ single { androidContext().getSystemService(CONNECTIVITY_SERVICE) as ConnectivityManager }
+}
+
+val appCoroutinesScope = module {
+ single { CoroutineScope(SupervisorJob()) }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/bobbyesp/metadator/model/ParcelableSong.kt b/app/src/main/java/com/bobbyesp/metadator/domain/model/ParcelableSong.kt
similarity index 91%
rename from app/src/main/java/com/bobbyesp/metadator/model/ParcelableSong.kt
rename to app/src/main/java/com/bobbyesp/metadator/domain/model/ParcelableSong.kt
index 720c6d9..6489346 100644
--- a/app/src/main/java/com/bobbyesp/metadator/model/ParcelableSong.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/domain/model/ParcelableSong.kt
@@ -1,4 +1,4 @@
-package com.bobbyesp.metadator.model
+package com.bobbyesp.metadator.domain.model
import android.net.Uri
import android.os.Parcelable
diff --git a/app/src/main/java/com/bobbyesp/metadator/ext/Song.kt b/app/src/main/java/com/bobbyesp/metadator/ext/Song.kt
index 93554e6..2fb46e6 100644
--- a/app/src/main/java/com/bobbyesp/metadator/ext/Song.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/ext/Song.kt
@@ -1,6 +1,6 @@
package com.bobbyesp.metadator.ext
-import com.bobbyesp.metadator.model.ParcelableSong
+import com.bobbyesp.metadator.domain.model.ParcelableSong
import com.bobbyesp.utilities.model.Song
fun Song.toParcelableSong(): ParcelableSong {
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt
index c5aa452..a85342a 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/Navigation.kt
@@ -28,10 +28,8 @@ import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
-import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalDensity
@@ -42,9 +40,10 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.currentBackStackEntryAsState
+import androidx.navigation.compose.dialog
import androidx.navigation.compose.navigation
import androidx.navigation.toRoute
-import com.bobbyesp.metadator.model.ParcelableSong
+import com.bobbyesp.metadator.domain.model.ParcelableSong
import com.bobbyesp.metadator.presentation.common.LocalDrawerState
import com.bobbyesp.metadator.presentation.common.LocalNavController
import com.bobbyesp.metadator.presentation.common.LocalPlayerAwareWindowInsets
@@ -192,6 +191,10 @@ fun Navigator() {
mediaStoreViewModel.songs.collectAsStateWithLifecycle()
HomePage(songs = songsState, onEvent = mediaStoreViewModel::onEvent)
}
+
+ dialog {
+ Text("Dialog")
+ }
}
navigation(
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/common/CompositionLocals.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/common/CompositionLocals.kt
index d4480db..d5dd0ff 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/common/CompositionLocals.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/common/CompositionLocals.kt
@@ -22,8 +22,8 @@ import coil.ImageLoader
import coil.disk.DiskCache
import coil.memory.MemoryCache
import com.bobbyesp.mediaplayer.service.ConnectionHandler
-import com.bobbyesp.utilities.preferences.Preferences.AppMainSettingsStateFlow
-import com.bobbyesp.utilities.theme.DarkThemePreference
+import com.bobbyesp.metadator.util.preferences.CoreSettings
+import com.bobbyesp.metadator.util.theme.DarkThemePreference
import com.bobbyesp.utilities.ui.DEFAULT_SEED_COLOR
import com.materialkolor.DynamicMaterialThemeState
import com.materialkolor.rememberDynamicMaterialThemeState
@@ -53,11 +53,12 @@ val LocalPlayerAwareWindowInsets =
fun AppLocalSettingsProvider(
windowWidthSize: WindowWidthSizeClass,
playerConnectionHandler: ConnectionHandler,
+ coreSettings: CoreSettings,
content: @Composable () -> Unit
) {
val context = LocalContext.current
- val appSettingsState = AppMainSettingsStateFlow.collectAsStateWithLifecycle().value
+ val appSettingsState = coreSettings.appMainSettingsStateFlow.collectAsStateWithLifecycle().value
val navController = rememberNavController()
val imageLoader = ImageLoader.Builder(context)
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/common/Route.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/common/Route.kt
index 2f7087a..8c2895a 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/common/Route.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/common/Route.kt
@@ -1,6 +1,6 @@
package com.bobbyesp.metadator.presentation.common
-import com.bobbyesp.metadator.model.ParcelableSong
+import com.bobbyesp.metadator.domain.model.ParcelableSong
import kotlinx.serialization.Serializable
@Serializable
@@ -11,7 +11,11 @@ sealed interface Route {
@Serializable
data object MetadatorNavigator : Route {
@Serializable
- data object Home : Route
+ data object Home : Route {
+
+ @Serializable
+ data object VisualSettings : Route
+ }
}
@Serializable
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/components/text/ConditionedMarqueeText.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/components/text/ConditionedMarqueeText.kt
index 31e2014..40da933 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/components/text/ConditionedMarqueeText.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/components/text/ConditionedMarqueeText.kt
@@ -17,8 +17,8 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.TextUnit
import com.bobbyesp.ui.components.text.MarqueeText
import com.bobbyesp.ui.components.text.MarqueeTextGradientOptions
-import com.bobbyesp.utilities.preferences.PreferencesKeys.MARQUEE_TEXT
-import com.bobbyesp.utilities.preferences.booleanState
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.MARQUEE_TEXT
+import com.bobbyesp.metadator.util.preferences.booleanState
@Composable
fun ConditionedMarqueeText(
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/MediaStorePage.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/MediaStorePage.kt
index 7cae32a..996cb34 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/MediaStorePage.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/MediaStorePage.kt
@@ -1,11 +1,9 @@
package com.bobbyesp.metadator.presentation.pages
import androidx.compose.animation.Crossfade
-import androidx.compose.animation.animateContentSize
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
@@ -16,24 +14,18 @@ import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.bobbyesp.metadator.R
import com.bobbyesp.metadator.presentation.components.cards.songs.HorizontalSongCard
import com.bobbyesp.metadator.presentation.components.cards.songs.compact.CompactCardSize
-import com.bobbyesp.metadator.presentation.components.cards.songs.compact.CompactCardSize.Companion.toCompactCardSize
import com.bobbyesp.metadator.presentation.components.cards.songs.compact.CompactSongCard
import com.bobbyesp.metadator.presentation.components.others.status.EmptyMediaStore
import com.bobbyesp.metadator.presentation.pages.home.LayoutType
import com.bobbyesp.ui.common.pages.ErrorPage
import com.bobbyesp.ui.common.pages.LoadingPage
import com.bobbyesp.utilities.model.Song
-import com.bobbyesp.utilities.preferences.PreferencesKeys.SONG_CARD_SIZE
-import com.bobbyesp.utilities.preferences.intState
import com.bobbyesp.utilities.states.ResourceState
import my.nanihadesuka.compose.LazyColumnScrollbar
import my.nanihadesuka.compose.LazyVerticalGridScrollbar
@@ -53,97 +45,96 @@ fun MediaStorePage(
) {
val songsList = songs.value
- Box(
- modifier = modifier.fillMaxSize()
- ) {
- Crossfade(
- targetState = desiredLayout, label = "List item transition", animationSpec = tween(200)
- ) { type ->
- when (songsList) {
- is ResourceState.Loading -> LoadingPage(text = stringResource(R.string.loading_mediastore))
+ Crossfade(
+ modifier = modifier.fillMaxSize(),
+ targetState = desiredLayout,
+ label = "List item transition",
+ animationSpec = tween(200)
+ ) { type ->
+ when (songsList) {
+ is ResourceState.Loading -> LoadingPage(text = stringResource(R.string.loading_mediastore))
- is ResourceState.Error -> ErrorPage(
- modifier = Modifier.fillMaxSize(),
- throwable = Exception(songsList.message ?: "Unknown")
- ) { onReloadMediaStore() }
+ is ResourceState.Error -> ErrorPage(
+ modifier = Modifier.fillMaxSize(),
+ throwable = Exception(songsList.message ?: "Unknown")
+ ) { onReloadMediaStore() }
- is ResourceState.Success -> {
- val dataSongsList = songsList.data ?: throw IllegalStateException("Data is null")
- if (dataSongsList.isEmpty()) {
- EmptyMediaStore(
- modifier = Modifier.fillMaxSize()
- )
- } else {
- when (type) {
- LayoutType.Grid -> {
- LazyVerticalGridScrollbar(
- state = lazyGridState, settings = ScrollbarSettings(
- thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant,
- thumbSelectedColor = MaterialTheme.colorScheme.primary,
- selectionActionable = ScrollbarSelectionActionable.WhenVisible,
- )
+ is ResourceState.Success -> {
+ val dataSongsList = songsList.data ?: throw IllegalStateException("Data is null")
+ if (dataSongsList.isEmpty()) {
+ EmptyMediaStore(
+ modifier = Modifier.fillMaxSize()
+ )
+ } else {
+ when (type) {
+ LayoutType.Grid -> {
+ LazyVerticalGridScrollbar(
+ state = lazyGridState, settings = ScrollbarSettings(
+ thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant,
+ thumbSelectedColor = MaterialTheme.colorScheme.primary,
+ selectionActionable = ScrollbarSelectionActionable.WhenVisible,
+ )
+ ) {
+ LazyVerticalGrid(
+ columns = GridCells.Adaptive(125.dp),
+ verticalArrangement = Arrangement.spacedBy(6.dp),
+ horizontalArrangement = Arrangement.spacedBy(6.dp),
+ contentPadding = PaddingValues(8.dp),
+ modifier = Modifier
+ .fillMaxSize()
+ .background(MaterialTheme.colorScheme.background),
+ state = lazyGridState
) {
- LazyVerticalGrid(
- columns = GridCells.Adaptive(125.dp),
- verticalArrangement = Arrangement.spacedBy(6.dp),
- horizontalArrangement = Arrangement.spacedBy(6.dp),
- contentPadding = PaddingValues(8.dp),
- modifier = Modifier
- .fillMaxSize()
- .background(MaterialTheme.colorScheme.background),
- state = lazyGridState
- ) {
- items(
- count = dataSongsList.size,
- key = { index -> dataSongsList[index].id },
- contentType = { _ -> "songItem" }) { index ->
- val song = dataSongsList[index]
+ items(
+ count = dataSongsList.size,
+ key = { index -> dataSongsList[index].id },
+ contentType = { _ -> "songItem" }) { index ->
+ val song = dataSongsList[index]
- CompactSongCard(
- modifier = Modifier
- .animateItem(
- fadeInSpec = null, fadeOutSpec = null
- ),
- size = compactCardSize,
- name = song.title,
- artists = song.artist,
- artworkUri = song.artworkPath,
- onClick = {
- onItemClicked(song)
- })
- }
+ CompactSongCard(
+ modifier = Modifier
+ .animateItem(
+ fadeInSpec = null, fadeOutSpec = null
+ ),
+ size = compactCardSize,
+ name = song.title,
+ artists = song.artist,
+ artworkUri = song.artworkPath,
+ onClick = {
+ onItemClicked(song)
+ })
}
}
}
+ }
- LayoutType.List -> {
- LazyColumnScrollbar(
- state = lazyListState, settings = ScrollbarSettings(
- thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant,
- thumbSelectedColor = MaterialTheme.colorScheme.primary,
- selectionActionable = ScrollbarSelectionActionable.WhenVisible,
- )
+ LayoutType.List -> {
+ LazyColumnScrollbar(
+ state = lazyListState, settings = ScrollbarSettings(
+ thumbUnselectedColor = MaterialTheme.colorScheme.onSurfaceVariant,
+ thumbSelectedColor = MaterialTheme.colorScheme.primary,
+ selectionActionable = ScrollbarSelectionActionable.WhenVisible,
+ )
+ ) {
+ LazyColumn(
+ modifier = Modifier
+ .fillMaxSize()
+ .background(MaterialTheme.colorScheme.background),
+ state = lazyListState,
) {
- LazyColumn(
- modifier = Modifier
- .fillMaxSize()
- .background(MaterialTheme.colorScheme.background),
- state = lazyListState,
- ) {
- items(
- count = dataSongsList.size,
- key = { index -> dataSongsList[index].id },
- contentType = { _ -> "songItem" }) { index ->
- val song = dataSongsList[index]
- HorizontalSongCard(
- song = song,
- modifier = Modifier.animateItem(
- fadeInSpec = null, fadeOutSpec = null
- ),
- onClick = {
- onItemClicked(song)
- })
- }
+ items(
+ count = dataSongsList.size,
+ key = { index -> dataSongsList[index].id },
+ contentType = { _ -> "songHorizontalItem" }) { index ->
+ val song = dataSongsList[index]
+ HorizontalSongCard(
+ song = song,
+ modifier = Modifier.animateItem(
+ fadeInSpec = null, fadeOutSpec = null
+ ),
+ onClick = {
+ onItemClicked(song)
+ })
}
}
}
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/home/HomePage.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/home/HomePage.kt
index 1bdc43e..cff506e 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/home/HomePage.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/home/HomePage.kt
@@ -20,8 +20,10 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.CropSquare
import androidx.compose.material.icons.rounded.KeyboardDoubleArrowUp
import androidx.compose.material.icons.rounded.Menu
+import androidx.compose.material.icons.rounded.MoreHoriz
import androidx.compose.material.icons.rounded.MoreVert
import androidx.compose.material.icons.rounded.Settings
+import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
@@ -62,9 +64,9 @@ import com.bobbyesp.ui.components.dropdown.AnimatedDropdownMenu
import com.bobbyesp.ui.components.dropdown.DropdownItemContainer
import com.bobbyesp.ui.components.text.AutoResizableText
import com.bobbyesp.utilities.model.Song
-import com.bobbyesp.utilities.preferences.Preferences
-import com.bobbyesp.utilities.preferences.PreferencesKeys.DESIRED_LAYOUT
-import com.bobbyesp.utilities.preferences.PreferencesKeys.SONG_CARD_SIZE
+import com.bobbyesp.utilities.Preferences
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.DESIRED_LAYOUT
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.SONG_CARD_SIZE
import com.bobbyesp.utilities.states.ResourceState
import com.bobbyesp.utilities.ui.permission.PermissionNotGrantedDialog
import com.bobbyesp.utilities.ui.permission.PermissionRequestHandler
@@ -196,13 +198,12 @@ fun HomePage(
}) {
DropdownMenuContent(
desiredLayout = desiredLayout,
- desiredCardSize = desiredCardSize,
onLayoutChanged = {
desiredLayout = it
- },
- onCardSizeChanged = {
- desiredCardSize = it
- })
+ }, navigateToDialog = {
+ navController.navigate(Route.MetadatorNavigator.Home.VisualSettings)
+ }
+ )
}
})
@@ -288,9 +289,8 @@ fun HomePage(
@Composable
private fun DropdownMenuContent(
desiredLayout: LayoutType,
- desiredCardSize: CompactCardSize,
onLayoutChanged: (LayoutType) -> Unit = {},
- onCardSizeChanged: (CompactCardSize) -> Unit = {}
+ navigateToDialog: () -> Unit = {}
) {
val availableLayoutType = LayoutType.entries.toImmutableList()
@@ -306,6 +306,7 @@ private fun DropdownMenuContent(
style = MaterialTheme.typography.labelMedium
)
DropdownItemContainer(
+ modifier = Modifier,
content = {
SingleChoiceSegmentedButtonRow {
availableLayoutType.forEachIndexed { index, listType ->
@@ -329,37 +330,11 @@ private fun DropdownMenuContent(
}
}
})
- Text(
- text = stringResource(id = R.string.card_size),
- modifier = Modifier.fillMaxWidth(),
- color = MaterialTheme.colorScheme.primary,
- style = MaterialTheme.typography.labelMedium
+ DropdownMenuItem(
+ leadingIcon = { Icon(imageVector = Icons.Rounded.MoreHoriz, contentDescription = null) },
+ text = { Text(stringResource(id = R.string.open_more_options)) },
+ onClick = { navigateToDialog() }
)
-
- DropdownItemContainer(
- content = {
- SingleChoiceSegmentedButtonRow {
- CompactCardSize.entries.forEachIndexed { index, cardSize ->
- SegmentedButton(
- selected = desiredCardSize.ordinal == cardSize.ordinal,
- onClick = {
- Preferences.Enumerations.encodeValue(
- SONG_CARD_SIZE, cardSize
- )
- onCardSizeChanged(cardSize)
- },
- shape = SegmentedButtonDefaults.itemShape(
- index = index, count = CompactCardSize.entries.size
- ),
- ) {
- Icon(
- imageVector = Icons.Rounded.CropSquare,
- contentDescription = stringResource(id = R.string.card_size)
- )
- }
- }
- }
- })
}
}
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/settings/modules/GeneralSettingsPage.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/settings/modules/GeneralSettingsPage.kt
index 04935d0..676ace3 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/settings/modules/GeneralSettingsPage.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/settings/modules/GeneralSettingsPage.kt
@@ -13,13 +13,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.res.stringResource
+import com.bobbyesp.metadator.App.Companion.preferences
import com.bobbyesp.metadator.R
import com.bobbyesp.metadator.presentation.common.LocalNavController
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.MARQUEE_TEXT
+import com.bobbyesp.metadator.util.preferences.booleanState
import com.bobbyesp.ui.components.button.BackButton
import com.bobbyesp.ui.components.preferences.PreferenceSwitch
-import com.bobbyesp.utilities.preferences.Preferences
-import com.bobbyesp.utilities.preferences.PreferencesKeys.MARQUEE_TEXT
-import com.bobbyesp.utilities.preferences.booleanState
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@@ -66,7 +66,7 @@ fun GeneralSettingsPage() {
isChecked = useMarqueeText.value,
onClick = {
useMarqueeText.value = !useMarqueeText.value
- Preferences.updateValue(MARQUEE_TEXT, useMarqueeText.value)
+ preferences.updateValue(MARQUEE_TEXT, useMarqueeText.value)
}
)
}
diff --git a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/utilities/tageditor/MetadataEditorPage.kt b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/utilities/tageditor/MetadataEditorPage.kt
index 1666040..93ca9d2 100644
--- a/app/src/main/java/com/bobbyesp/metadator/presentation/pages/utilities/tageditor/MetadataEditorPage.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/presentation/pages/utilities/tageditor/MetadataEditorPage.kt
@@ -63,7 +63,7 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.bobbyesp.metadator.R
-import com.bobbyesp.metadator.model.ParcelableSong
+import com.bobbyesp.metadator.domain.model.ParcelableSong
import com.bobbyesp.metadator.presentation.common.LocalNavController
import com.bobbyesp.metadator.presentation.common.LocalOrientation
import com.bobbyesp.metadator.presentation.common.LocalSnackbarHostState
@@ -75,11 +75,9 @@ import com.bobbyesp.ui.common.pages.LoadingPage
import com.bobbyesp.ui.components.button.CloseButton
import com.bobbyesp.ui.components.others.MetadataTag
import com.bobbyesp.ui.components.text.LargeCategoryTitle
-import com.bobbyesp.ui.components.text.MarqueeText
import com.bobbyesp.ui.components.text.PreConfiguredOutlinedTextField
import com.bobbyesp.utilities.ext.fromMillisToMinutes
import com.bobbyesp.utilities.ext.isNeitherNullNorBlank
-import com.bobbyesp.utilities.ext.toMinutes
import com.bobbyesp.utilities.states.ResourceState
import com.bobbyesp.utilities.states.ScreenState
import com.kyant.taglib.AudioProperties
diff --git a/app/src/main/java/com/bobbyesp/metadator/util/preferences/AppMainSettings.kt b/app/src/main/java/com/bobbyesp/metadator/util/preferences/AppMainSettings.kt
new file mode 100644
index 0000000..e83a3f1
--- /dev/null
+++ b/app/src/main/java/com/bobbyesp/metadator/util/preferences/AppMainSettings.kt
@@ -0,0 +1,51 @@
+package com.bobbyesp.metadator.util.preferences
+
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.DARK_THEME_VALUE
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.DYNAMIC_COLOR
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.HIGH_CONTRAST
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.THEME_COLOR
+import com.bobbyesp.metadator.util.theme.DarkThemePreference
+import com.bobbyesp.utilities.ui.DEFAULT_SEED_COLOR
+import com.tencent.mmkv.MMKV
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
+
+class CoreSettings(
+ kv: MMKV,
+) {
+ data class AppMainSettings(
+ val darkTheme: DarkThemePreference = DarkThemePreference(),
+ val useDynamicColoring: Boolean = false,
+ val seedColor: Int = DEFAULT_SEED_COLOR,
+ )
+
+ val mutableAppMainSettingsStateFlow = MutableStateFlow(
+ AppMainSettings(
+ DarkThemePreference(
+ darkThemeValue = kv.decodeInt(
+ DARK_THEME_VALUE,
+ DarkThemePreference.FOLLOW_SYSTEM
+ ), isHighContrastModeEnabled = kv.decodeBool(HIGH_CONTRAST, false)
+ ),
+ useDynamicColoring = kv.decodeBool(
+ DYNAMIC_COLOR,
+ true
+ ),
+ seedColor = kv.decodeInt(THEME_COLOR, DEFAULT_SEED_COLOR),
+ )
+ )
+
+ val appMainSettingsStateFlow = mutableAppMainSettingsStateFlow.asStateFlow()
+
+ companion object {
+ lateinit var instance: CoreSettings
+
+ fun initialize(kv: MMKV): CoreSettings {
+ instance = CoreSettings(kv)
+ return instance
+ }
+
+ val mutableAppMainSettingsStateFlow get() = instance.mutableAppMainSettingsStateFlow
+ val appMainSettingsStateFlow get() = instance.appMainSettingsStateFlow
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/bobbyesp/metadator/util/preferences/PreferencesKeys.kt b/app/src/main/java/com/bobbyesp/metadator/util/preferences/PreferencesKeys.kt
new file mode 100644
index 0000000..ff96e1d
--- /dev/null
+++ b/app/src/main/java/com/bobbyesp/metadator/util/preferences/PreferencesKeys.kt
@@ -0,0 +1,36 @@
+package com.bobbyesp.metadator.util.preferences
+
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.DARK_THEME_VALUE
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.MARQUEE_TEXT
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.SONG_CARD_SIZE
+import com.bobbyesp.metadator.util.theme.DarkThemePreference
+
+object PreferencesKeys {
+ //------------GENERAL--------------
+ const val DESIRED_LAYOUT = "desired_overlay"
+ const val SONG_CARD_SIZE = "song_card_size"
+ const val MARQUEE_TEXT = "marquee_text"
+
+ //------------THEME----------------
+ const val DARK_THEME_VALUE = "dark_theme_value"
+ const val HIGH_CONTRAST = "high_contrast"
+ const val THEME_COLOR = "theme_color"
+ const val PALETTE_STYLE = "palette_style"
+ const val DYNAMIC_COLOR = "dynamic_color"
+
+ const val MMKV_PREFERENCES_NAME = "metadator_preferences"
+}
+
+val StringPreferenceDefaults: Map =
+ mapOf()
+
+val BooleanPreferenceDefaults: Map =
+ mapOf(
+ MARQUEE_TEXT to true
+ )
+
+val IntPreferenceDefaults: Map =
+ mapOf(
+ DARK_THEME_VALUE to DarkThemePreference.FOLLOW_SYSTEM,
+ SONG_CARD_SIZE to 2 //CompactCardSize.LARGE
+ )
\ No newline at end of file
diff --git a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/PreferencesTypeExtensions.kt b/app/src/main/java/com/bobbyesp/metadator/util/preferences/PreferencesTypeExtensions.kt
similarity index 71%
rename from app/utilities/src/main/java/com/bobbyesp/utilities/preferences/PreferencesTypeExtensions.kt
rename to app/src/main/java/com/bobbyesp/metadator/util/preferences/PreferencesTypeExtensions.kt
index ebb71b4..02ebbd8 100644
--- a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/PreferencesTypeExtensions.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/util/preferences/PreferencesTypeExtensions.kt
@@ -1,12 +1,12 @@
-package com.bobbyesp.utilities.preferences
+package com.bobbyesp.metadator.util.preferences
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
-import com.bobbyesp.utilities.preferences.Preferences.getBoolean
-import com.bobbyesp.utilities.preferences.Preferences.getInt
-import com.bobbyesp.utilities.preferences.Preferences.getString
+import com.bobbyesp.utilities.Preferences.Companion.getBoolean
+import com.bobbyesp.utilities.Preferences.Companion.getInt
+import com.bobbyesp.utilities.Preferences.Companion.getString
inline val String.booleanState
@Composable get() = remember("${this}_boolean_state") {
diff --git a/app/utilities/src/main/java/com/bobbyesp/utilities/theme/DarkThemePreference.kt b/app/src/main/java/com/bobbyesp/metadator/util/theme/DarkThemePreference.kt
similarity index 95%
rename from app/utilities/src/main/java/com/bobbyesp/utilities/theme/DarkThemePreference.kt
rename to app/src/main/java/com/bobbyesp/metadator/util/theme/DarkThemePreference.kt
index a79302b..cae6b3e 100644
--- a/app/utilities/src/main/java/com/bobbyesp/utilities/theme/DarkThemePreference.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/util/theme/DarkThemePreference.kt
@@ -1,4 +1,4 @@
-package com.bobbyesp.utilities.theme
+package com.bobbyesp.metadator.util.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.Composable
diff --git a/app/utilities/src/main/java/com/bobbyesp/utilities/theme/Theme.kt b/app/src/main/java/com/bobbyesp/metadator/util/theme/Theme.kt
similarity index 64%
rename from app/utilities/src/main/java/com/bobbyesp/utilities/theme/Theme.kt
rename to app/src/main/java/com/bobbyesp/metadator/util/theme/Theme.kt
index ed44e9d..9172e96 100644
--- a/app/utilities/src/main/java/com/bobbyesp/utilities/theme/Theme.kt
+++ b/app/src/main/java/com/bobbyesp/metadator/util/theme/Theme.kt
@@ -1,11 +1,10 @@
-package com.bobbyesp.utilities.theme
-
-import com.bobbyesp.utilities.preferences.Preferences.AppMainSettingsStateFlow
-import com.bobbyesp.utilities.preferences.Preferences.mutableAppMainSettingsStateFlow
-import com.bobbyesp.utilities.preferences.PreferencesKeys.DARK_THEME_VALUE
-import com.bobbyesp.utilities.preferences.PreferencesKeys.DYNAMIC_COLOR
-import com.bobbyesp.utilities.preferences.PreferencesKeys.HIGH_CONTRAST
-import com.bobbyesp.utilities.preferences.PreferencesKeys.THEME_COLOR
+package com.bobbyesp.metadator.util.theme
+
+import com.bobbyesp.metadator.util.preferences.CoreSettings
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.DARK_THEME_VALUE
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.DYNAMIC_COLOR
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.HIGH_CONTRAST
+import com.bobbyesp.metadator.util.preferences.PreferencesKeys.THEME_COLOR
import com.tencent.mmkv.MMKV
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
@@ -14,9 +13,10 @@ import kotlinx.coroutines.launch
class AppTheme(
private val kv: MMKV,
+ private val coreSettings: CoreSettings,
private val scope: CoroutineScope
) {
- private val appSettingsFlow = AppMainSettingsStateFlow.value
+ private val appSettingsFlow = coreSettings.appMainSettingsStateFlow.value
private val theme = appSettingsFlow.darkTheme
@@ -25,7 +25,7 @@ class AppTheme(
highContrast: Boolean = theme.isHighContrastModeEnabled
) {
scope.launch(Dispatchers.IO) {
- mutableAppMainSettingsStateFlow.update {
+ coreSettings.mutableAppMainSettingsStateFlow.update {
it.copy(
darkTheme = it.darkTheme.copy(
darkThemeValue = darkTheme,
@@ -41,7 +41,7 @@ class AppTheme(
fun modifySeedColor(argbColor: Int) {
scope.launch(Dispatchers.IO) {
- mutableAppMainSettingsStateFlow.update {
+ coreSettings.mutableAppMainSettingsStateFlow.update {
it.copy(seedColor = argbColor)
}
@@ -51,7 +51,7 @@ class AppTheme(
fun switchDynamicColoring(enabled: Boolean = !appSettingsFlow.useDynamicColoring) {
scope.launch(Dispatchers.IO) {
- mutableAppMainSettingsStateFlow.update {
+ coreSettings.mutableAppMainSettingsStateFlow.update {
it.copy(useDynamicColoring = enabled)
}
}
diff --git a/app/ui/src/main/java/com/bobbyesp/ui/components/dropdown/DropdownItemContainer.kt b/app/ui/src/main/java/com/bobbyesp/ui/components/dropdown/DropdownItemContainer.kt
index 2058d85..a17950f 100644
--- a/app/ui/src/main/java/com/bobbyesp/ui/components/dropdown/DropdownItemContainer.kt
+++ b/app/ui/src/main/java/com/bobbyesp/ui/components/dropdown/DropdownItemContainer.kt
@@ -13,8 +13,8 @@ import androidx.compose.ui.unit.dp
@Composable
fun DropdownItemContainer(
modifier: Modifier = Modifier,
- content: @Composable RowScope.() -> Unit,
- contentPadding: androidx.compose.ui.unit.Dp = 0.dp
+ contentPadding: androidx.compose.ui.unit.Dp = 0.dp,
+ content: @Composable RowScope.() -> Unit
) {
Row(
modifier = modifier
diff --git a/app/utilities/src/main/java/com/bobbyesp/utilities/Preferences.kt b/app/utilities/src/main/java/com/bobbyesp/utilities/Preferences.kt
new file mode 100644
index 0000000..999753d
--- /dev/null
+++ b/app/utilities/src/main/java/com/bobbyesp/utilities/Preferences.kt
@@ -0,0 +1,71 @@
+package com.bobbyesp.utilities
+
+import com.tencent.mmkv.MMKV
+
+class Preferences(
+ preferencesName: String,
+ intPreferenceDefaults: Map,
+ stringPreferenceDefaults: Map,
+ booleanPreferenceDefaults: Map
+) {
+ val kv: MMKV = MMKV.mmkvWithID(preferencesName)
+
+ init {
+ Preferences.kv = kv
+ setDefaults(intPreferenceDefaults, stringPreferenceDefaults, booleanPreferenceDefaults)
+ }
+
+ fun String.updateString(newString: String) = kv.encode(this, newString)
+
+ fun String.updateInt(newInt: Int) = kv.encode(this, newInt)
+
+ fun String.updateBoolean(newValue: Boolean) = kv.encode(this, newValue)
+ fun updateValue(key: String, b: Boolean) = key.updateBoolean(b)
+ fun encodeInt(key: String, int: Int) = key.updateInt(int)
+ fun getValue(key: String): Boolean = key.getBoolean()
+ fun encodeString(key: String, string: String) = key.updateString(string)
+ fun containsKey(key: String) = kv.containsKey(key)
+
+ object Enumerations {
+ inline fun > encodeValue(
+ key: String,
+ value: T
+ ) {
+ kv.encode(key, value.ordinal)
+ }
+
+ inline fun > getValue(
+ key: String,
+ defaultValue: T
+ ): T {
+ val ordinal = kv.decodeInt(key, defaultValue.ordinal)
+ return enumValues().getOrNull(ordinal) ?: defaultValue
+ }
+ }
+
+ companion object {
+ lateinit var kv: MMKV
+ private lateinit var intPreferenceDefaults: Map
+ private lateinit var stringPreferenceDefaults: Map
+ private lateinit var booleanPreferenceDefaults: Map
+
+ fun setDefaults(
+ intDefaults: Map,
+ stringDefaults: Map,
+ booleanDefaults: Map
+ ) {
+ intPreferenceDefaults = intDefaults
+ stringPreferenceDefaults = stringDefaults
+ booleanPreferenceDefaults = booleanDefaults
+ }
+
+ fun String.getInt(default: Int = intPreferenceDefaults.getOrElse(this) { 0 }): Int =
+ kv.decodeInt(this, default)
+
+ fun String.getString(default: String = stringPreferenceDefaults.getOrElse(this) { "" }): String =
+ kv.decodeString(this) ?: default
+
+ fun String.getBoolean(default: Boolean = booleanPreferenceDefaults.getOrElse(this) { false }): Boolean =
+ kv.decodeBool(this, default)
+ }
+}
\ No newline at end of file
diff --git a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/Preferences.kt b/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/Preferences.kt
deleted file mode 100644
index bf9d8d9..0000000
--- a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/Preferences.kt
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.bobbyesp.utilities.preferences
-
-import com.bobbyesp.utilities.preferences.PreferencesKeys.DARK_THEME_VALUE
-import com.bobbyesp.utilities.preferences.PreferencesKeys.DYNAMIC_COLOR
-import com.bobbyesp.utilities.preferences.PreferencesKeys.HIGH_CONTRAST
-import com.bobbyesp.utilities.preferences.PreferencesKeys.MARQUEE_TEXT
-import com.bobbyesp.utilities.preferences.PreferencesKeys.MMKV_PREFERENCES_NAME
-import com.bobbyesp.utilities.preferences.PreferencesKeys.SONG_CARD_SIZE
-import com.bobbyesp.utilities.preferences.PreferencesKeys.THEME_COLOR
-import com.bobbyesp.utilities.preferences.settings.AppMainSettings
-import com.bobbyesp.utilities.theme.DarkThemePreference
-import com.bobbyesp.utilities.ui.DEFAULT_SEED_COLOR
-import com.tencent.mmkv.MMKV
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.asStateFlow
-
-private val StringPreferenceDefaults: Map =
- mapOf()
-
-private val BooleanPreferenceDefaults: Map =
- mapOf(
- MARQUEE_TEXT to true
- )
-
-private val IntPreferenceDefaults: Map =
- mapOf(
- DARK_THEME_VALUE to DarkThemePreference.FOLLOW_SYSTEM,
- SONG_CARD_SIZE to 2 //CompactCardSize.LARGE (com.bobbyesp.metadator.presentation.components.cards.songs.compact.CompactCardSize)
- )
-
-object Preferences {
- val kv: MMKV = MMKV.mmkvWithID(MMKV_PREFERENCES_NAME)
-
- fun String.getInt(default: Int = IntPreferenceDefaults.getOrElse(this) { 0 }): Int =
- kv.decodeInt(this, default)
-
- fun String.getString(default: String = StringPreferenceDefaults.getOrElse(this) { "" }): String =
- kv.decodeString(this) ?: default
-
- fun String.getBoolean(default: Boolean = BooleanPreferenceDefaults.getOrElse(this) { false }): Boolean =
- kv.decodeBool(this, default)
-
- fun String.updateString(newString: String) = kv.encode(this, newString)
-
- fun String.updateInt(newInt: Int) = kv.encode(this, newInt)
-
- fun String.updateBoolean(newValue: Boolean) = kv.encode(this, newValue)
- fun updateValue(key: String, b: Boolean) = key.updateBoolean(b)
- fun encodeInt(key: String, int: Int) = key.updateInt(int)
- fun getValue(key: String): Boolean = key.getBoolean()
- fun encodeString(key: String, string: String) = key.updateString(string)
- fun containsKey(key: String) = kv.containsKey(key)
-
- object Enumerations {
- inline fun > encodeValue(
- key: String,
- value: T
- ) {
- kv.encode(key, value.ordinal)
- }
-
- inline fun > getValue(
- key: String,
- defaultValue: T
- ): T {
- val ordinal = kv.decodeInt(key, defaultValue.ordinal)
- return enumValues().getOrNull(ordinal) ?: defaultValue
- }
- }
-
- val mutableAppMainSettingsStateFlow = MutableStateFlow(
- AppMainSettings(
- DarkThemePreference(
- darkThemeValue = kv.decodeInt(
- DARK_THEME_VALUE,
- DarkThemePreference.FOLLOW_SYSTEM
- ), isHighContrastModeEnabled = kv.decodeBool(HIGH_CONTRAST, false)
- ),
- useDynamicColoring = kv.decodeBool(
- DYNAMIC_COLOR,
- true
- ),
- seedColor = kv.decodeInt(THEME_COLOR, DEFAULT_SEED_COLOR),
- )
- )
- val AppMainSettingsStateFlow = mutableAppMainSettingsStateFlow.asStateFlow()
-}
\ No newline at end of file
diff --git a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/PreferencesKeys.kt b/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/PreferencesKeys.kt
deleted file mode 100644
index e9d6cbb..0000000
--- a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/PreferencesKeys.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.bobbyesp.utilities.preferences
-
-object PreferencesKeys {
- //------------GENERAL--------------
- const val DESIRED_LAYOUT = "desired_overlay"
- const val SONG_CARD_SIZE = "song_card_size"
- const val MARQUEE_TEXT = "marquee_text"
-
- //------------THEME----------------
- const val DARK_THEME_VALUE = "dark_theme_value"
- const val HIGH_CONTRAST = "high_contrast"
- const val THEME_COLOR = "theme_color"
- const val PALETTE_STYLE = "palette_style"
- const val DYNAMIC_COLOR = "dynamic_color"
-
- const val MMKV_PREFERENCES_NAME = "metadator_preferences"
-}
\ No newline at end of file
diff --git a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/settings/AppMainSettings.kt b/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/settings/AppMainSettings.kt
deleted file mode 100644
index a7d613a..0000000
--- a/app/utilities/src/main/java/com/bobbyesp/utilities/preferences/settings/AppMainSettings.kt
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.bobbyesp.utilities.preferences.settings
-
-import com.bobbyesp.utilities.theme.DarkThemePreference
-import com.bobbyesp.utilities.ui.DEFAULT_SEED_COLOR
-
-data class AppMainSettings(
- val darkTheme: DarkThemePreference = DarkThemePreference(),
- val useDynamicColoring: Boolean = false,
- val seedColor: Int = DEFAULT_SEED_COLOR,
-)
\ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 986614a..de1bddd 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -2,13 +2,13 @@
#General, lifecycle and core
agp = "8.7.3"
firebaseCrashlyticsGradle = "3.0.2"
-kotlin = "2.0.21"
+kotlin = "2.1.0"
appcompat = "1.7.0"
core-ktx = "1.15.0"
legacySupportV4 = "1.0.0"
lifecycle-runtime-ktx = "2.8.7"
activity-compose = "1.9.3"
-ksp = "2.0.21-1.0.28"
+ksp = "2.1.0-1.0.29"
splashscreen = "1.0.1"
media3 = "1.5.0"
leakcanary = "2.13"
@@ -41,7 +41,7 @@ coil = "2.7.0"
landscapistCoil = "2.2.13"
#Network
-ktor = "3.0.0" #For me the best client
+ktor = "3.0.2"
#Dependency injection
koin = "4.0.0"
@@ -55,7 +55,7 @@ mmkv = "2.0.0"
#Firebase, GMS...
gmsPlayServicesAuth = "21.2.0"
googleServices = "4.4.2"
-firebaseBom = "33.6.0"
+firebaseBom = "33.7.0"
#Spotify API
spotify-apiHandler = "4.1.3"