From 2dc16e4bb52958f415b1445f79aba3b3d8126307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Font=C3=A1n?= Date: Mon, 18 Nov 2024 20:41:08 +0100 Subject: [PATCH] refactor: Remove unused libraries This commit removes unused libraries, including: - Removed `accompanist-navigation-animation`, `accompanist-pager-layouts`, `accompanist-pager-indicators`, `accompanist-flowlayout`, and `accompanist-material`. - Removed `androidx.media3.datasource.okhttp`. - Removed `qrcode-kotlin-android`. - Removed `lyricfier`. --- app/build.gradle.kts | 6 ------ .../main/java/com/bobbyesp/metadator/MainActivity.kt | 3 +-- .../metadator/presentation/common/CompositionLocals.kt | 7 ++----- gradle/libs.versions.toml | 10 +--------- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9db8803..ad1d74b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -163,7 +163,6 @@ dependencies { //---------------Media3---------------// implementation(libs.bundles.media3) - implementation(libs.androidx.media3.datasource.okhttp) implementation(project(":app:mediaplayer")) //---------------Dependency Injection---------------// @@ -178,9 +177,6 @@ dependencies { //-------------------Key-value Storage-------------------// implementation(libs.mmkv) -//-------------------Markdown-------------------// -// implementation(libs.markdown) - //-------------------Image Loading-------------------// implementation(libs.landscapist.coil) @@ -191,13 +187,11 @@ dependencies { //-------------------Utilities-------------------// implementation(libs.kotlinx.collections.immutable) - implementation(libs.qrcode.kotlin.android) implementation(libs.profileinstaller) implementation(libs.kotlinx.datetime) implementation(libs.kotlinx.serialization.json) implementation(libs.taglib) implementation(libs.scrollbar) - implementation(libs.lyricfier) implementation(libs.spotify.api.android) implementation(project(":crashhandler")) diff --git a/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt b/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt index ae24897..ffba5c2 100644 --- a/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt +++ b/app/src/main/java/com/bobbyesp/metadator/MainActivity.kt @@ -12,7 +12,6 @@ import androidx.activity.enableEdgeToEdge import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi import androidx.compose.material3.windowsizeclass.calculateWindowSizeClass import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen -import androidx.media3.common.util.UnstableApi import com.bobbyesp.mediaplayer.service.ConnectionHandler import com.bobbyesp.mediaplayer.service.MediaplayerService import com.bobbyesp.metadator.presentation.Navigator @@ -22,7 +21,6 @@ import org.koin.android.ext.android.inject import org.koin.compose.KoinContext import setCrashlyticsCollection -@androidx.annotation.OptIn(UnstableApi::class) class MainActivity : ComponentActivity() { private var isMusicPlayerServiceStarted = false @@ -58,6 +56,7 @@ class MainActivity : ComponentActivity() { isMusicPlayerServiceStarted = false } + @androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class) private fun startMediaPlayerService() { val intent = Intent(this, MediaplayerService::class.java) if (!isMusicPlayerServiceStarted) { 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 6236e00..d4480db 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 @@ -5,6 +5,7 @@ import androidx.compose.material3.DrawerState import androidx.compose.material3.DrawerValue import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.rememberDrawerState +import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider @@ -24,8 +25,6 @@ import com.bobbyesp.mediaplayer.service.ConnectionHandler import com.bobbyesp.utilities.preferences.Preferences.AppMainSettingsStateFlow import com.bobbyesp.utilities.theme.DarkThemePreference import com.bobbyesp.utilities.ui.DEFAULT_SEED_COLOR -import com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi -import com.google.accompanist.navigation.material.rememberBottomSheetNavigator import com.materialkolor.DynamicMaterialThemeState import com.materialkolor.rememberDynamicMaterialThemeState import com.skydoves.landscapist.coil.LocalCoilImageLoader @@ -50,7 +49,6 @@ val LocalMediaplayerConnection = val LocalPlayerAwareWindowInsets = compositionLocalOf { error("No WindowInsets provided") } -@OptIn(ExperimentalMaterialNavigationApi::class) @Composable fun AppLocalSettingsProvider( windowWidthSize: WindowWidthSizeClass, @@ -60,8 +58,7 @@ fun AppLocalSettingsProvider( val context = LocalContext.current val appSettingsState = AppMainSettingsStateFlow.collectAsStateWithLifecycle().value - val bottomSheetNavigator = rememberBottomSheetNavigator() - val navController = rememberNavController(bottomSheetNavigator) + val navController = rememberNavController() val imageLoader = ImageLoader.Builder(context) .memoryCache { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7fe0196..66c6330 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -121,15 +121,8 @@ kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-cor kotlinx-coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" } #Accompanist -accompanist-navigation-animation = { group = "com.google.accompanist", name = "accompanist-navigation-animation", version.ref = "accompanist" } accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist" } accompanist-webview = { group = "com.google.accompanist", name = "accompanist-webview", version.ref = "accompanist" } -accompanist-pager-layouts = { group = "com.google.accompanist", name = "accompanist-pager", version.ref = "accompanist" } -accompanist-pager-indicators = { group = "com.google.accompanist", name = "accompanist-pager-indicators", version.ref = "accompanist" } -accompanist-flowlayout = { group = "com.google.accompanist", name = "accompanist-flowlayout", version.ref = "accompanist" } - -#Accompanist Material components -accompanist-material = { group = "com.google.accompanist", name = "accompanist-navigation-material", version.ref = "accompanist" } #Image loading landscapist-coil = { group = "com.github.skydoves", name = "landscapist-coil", version.ref = "landscapistCoil" } @@ -184,7 +177,6 @@ firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashly qrcode-kotlin-android = { module = "io.github.g0dkar:qrcode-kotlin-android", version.ref = "qrcodeKotlinAndroid" } taglib = { group = "com.github.Kyant0", name = "taglib", version.ref = "taglib" } spotify-api-android = { group = "com.adamratzman", name = "spotify-api-kotlin-core", version.ref = "spotify-apiHandler" } -lyricfier = { module = "io.github.bobbyesp.lyricfier:lyricfier", version.ref = "lyricfier" } palette = { group = "androidx.palette", name = "palette-ktx", version.ref = "palette" } scrollbar = { group = "com.github.nanihadesuka", name = "LazyColumnScrollbar", version.ref = "scrollbar" } @@ -216,7 +208,7 @@ androidx-baselineprofile = { id = "androidx.baselineprofile", version.ref = "and [bundles] core = ["core-ktx", "lifecycle-runtime-ktx", "lifecycle-compose-runtime", "lifecycle-compose-viewModel", "activity-compose", "core-appcompat", "core-splashscreen"] ktor = ["ktor-android", "ktor-okhttp" ,"ktor-core", "ktor-serialization", "ktor-logging", "ktor-contentnegotiation", "ktor-encoding"] -accompanist = ["accompanist-navigation-animation", "accompanist-permissions", "accompanist-webview", "accompanist-pager-layouts", "accompanist-pager-indicators", "accompanist-flowlayout", "accompanist-material"] +accompanist = ["accompanist-permissions", "accompanist-webview"] compose = ["compose-ui-util", "compose-graphics", "compose-runtime", "compose-foundation", "compose-material-iconsExtended", "compose-animation", "compose-ui", "compose-material3", "compose-navigation", "compose-material3-windowSizeClass", "compose-constraintLayout"] koin = ["koin-android", "koin-compose"] pagination = ["paging-compose", "paging-runtime"]