Skip to content

Commit

Permalink
Merge pull request #67 from ZTFtrue/develope
Browse files Browse the repository at this point in the history
Develope
  • Loading branch information
ZTFtrue authored Sep 20, 2024
2 parents 6cd06e1 + 58ce32e commit 6e803cb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 27 deletions.
35 changes: 19 additions & 16 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ android {
keyPassword = "111111"
keyAlias = "music"
}

}
namespace = "com.ztftrue.music"
compileSdk = 34
Expand All @@ -21,8 +22,8 @@ android {
applicationId = "com.ztftrue.music"
minSdk = 30
targetSdk = 34
versionCode = 31
versionName = "0.1.31"
versionCode = 32
versionName = "0.1.32"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -35,9 +36,9 @@ android {
}
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
includeInApk = true
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
includeInBundle = true
}
buildTypes {
release {
Expand All @@ -64,14 +65,16 @@ android {
}
}
}
signingConfig = signingConfigs.getByName("debug")

}
getByName("debug") {
isMinifyEnabled = false
isShrinkResources = false
// proguardFiles(
// getDefaultProguardFile("proguard-android-optimize.txt"),
// "proguard-rules.pro"
// )
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("debug")
}
}
Expand Down Expand Up @@ -100,11 +103,11 @@ android {
dependencies {

implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.5")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.5")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.6")
implementation("androidx.activity:activity-compose:1.9.2")
implementation("androidx.navigation:navigation-compose:2.8.0")
implementation("androidx.navigation:navigation-compose:2.8.1")
implementation("androidx.media3:media3-exoplayer:1.4.1")
implementation ("androidx.media:media:1.7.0")

Expand All @@ -123,7 +126,7 @@ dependencies {
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2024.09.01"))
androidTestImplementation(platform("androidx.compose:compose-bom:2024.09.02"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
Expand All @@ -143,9 +146,9 @@ dependencies {
// implementation("net.jthink:jaudiotagger:3.0.1")

implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.collection:collection-ktx:1.4.3")
implementation("androidx.collection:collection-ktx:1.4.4")
implementation("androidx.fragment:fragment-ktx:1.8.3")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.5")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6")

implementation("androidx.palette:palette-ktx:1.0.0")

Expand Down
10 changes: 6 additions & 4 deletions app/src/main/java/com/ztftrue/music/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,12 @@ class MainActivity : ComponentActivity() {
musicViewModel.getDb(this@MainActivity).StorageFolderDao().insert(
StorageFolder(null, treeUri.toString())
)
musicViewModel.dealLyrics(
this@MainActivity,
musicViewModel.currentPlay.value!!
)
val c = musicViewModel.currentPlay.value
if (c != null)
musicViewModel.dealLyrics(
this@MainActivity,
c
)
}

}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/ztftrue/music/play/PlayUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ object PlayUtils {
val i = getItemInQueueIndex(musicQueue, id)
val bundle = Bundle()
if (i > -1) {
musicQueue.removeAt(i)
changePriorityTableId(musicQueue, musicQueue[i], db)
val musicItem = musicQueue.removeAt(i)
changePriorityTableId(musicQueue, musicItem, db)
CoroutineScope(Dispatchers.Main).launch {
exoPlayer.removeMediaItem(i)
}
bundle.putInt("playIndex", exoPlayer.currentMediaItemIndex)
}
bundle.putInt("playIndex", exoPlayer.currentMediaItemIndex)
bundle.putParcelableArrayList("songsList", ArrayList(tracksLinkedHashMap.values))
bundle.putLong("id", id)
bundle.putParcelableArrayList("queue", musicQueue)
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/com/ztftrue/music/ui/other/SettingsPage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,12 @@ fun ManageTabDialog(musicViewModel: MusicViewModel, onDismiss: () -> Unit) {
}
fun onConfirmation() {
musicViewModel.mainTabList.clear()
if (mainTabList.size == 0) {
if(mainTabList.find { it.isShow }==null){
Toast.makeText(context, "Must has at least one tab", Toast.LENGTH_SHORT).show()
return
}
mainTabList.forEach {
mainTabList.forEachIndexed { index, it ->
it.priority=index
if (it.isShow) {
musicViewModel.mainTabList.add(it)
}
Expand Down Expand Up @@ -888,7 +889,6 @@ fun ManageTabDialog(musicViewModel: MusicViewModel, onDismiss: () -> Unit) {
contentDescription = "Up tab priority"
},
onClick = {
item.priority = it - 1
mainTabList.remove(item)
mainTabList.add(it - 1, item)
}) {
Expand Down Expand Up @@ -925,7 +925,6 @@ fun ManageTabDialog(musicViewModel: MusicViewModel, onDismiss: () -> Unit) {
contentDescription = "Down tab priority"
},
onClick = {
item.priority = it + 1
mainTabList.remove(item)
mainTabList.add(it + 1, item)
}) {
Expand Down

0 comments on commit 6e803cb

Please sign in to comment.