Skip to content

Commit

Permalink
refactor: Remove unused libraries
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
BobbyESP committed Nov 18, 2024
1 parent 4b4b299 commit 2dc16e4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
6 changes: 0 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ dependencies {

//---------------Media3---------------//
implementation(libs.bundles.media3)
implementation(libs.androidx.media3.datasource.okhttp)
implementation(project(":app:mediaplayer"))

//---------------Dependency Injection---------------//
Expand All @@ -178,9 +177,6 @@ dependencies {
//-------------------Key-value Storage-------------------//
implementation(libs.mmkv)

//-------------------Markdown-------------------//
// implementation(libs.markdown)

//-------------------Image Loading-------------------//
implementation(libs.landscapist.coil)

Expand All @@ -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"))

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/bobbyesp/metadator/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -50,7 +49,6 @@ val LocalMediaplayerConnection =
val LocalPlayerAwareWindowInsets =
compositionLocalOf<WindowInsets> { error("No WindowInsets provided") }

@OptIn(ExperimentalMaterialNavigationApi::class)
@Composable
fun AppLocalSettingsProvider(
windowWidthSize: WindowWidthSizeClass,
Expand All @@ -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 {
Expand Down
10 changes: 1 addition & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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" }

Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit 2dc16e4

Please sign in to comment.