Skip to content

Commit

Permalink
Merge pull request #33 from ZTFtrue/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
ZTFtrue authored May 1, 2024
2 parents 7bd1720 + 5019934 commit e4a1c3d
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
applicationId = "com.ztftrue.music"
minSdk = 30
targetSdk = 34
versionCode = 16
versionName = "0.1.16"
versionCode = 17
versionName = "0.1.17"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/ztftrue/music/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ class MainActivity : ComponentActivity() {
val isPlaying = resultData.getBoolean("isPlaying")
musicViewModel.playStatus.value = isPlaying
val index = resultData.getInt("index")
if (index >= 0 && musicViewModel.musicQueue.size > index
if (index >= 0 && musicViewModel.musicQueue.size > index&&index != musicViewModel.currentPlayQueueIndex.intValue
) {
musicViewModel.currentMusicCover.value = null
musicViewModel.currentPlay.value =
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/ztftrue/music/MyApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import android.content.Intent
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
Thread.setDefaultUncaughtExceptionHandler { _, e ->
handleUncaughtException(e)
}
// Thread.setDefaultUncaughtExceptionHandler { _, e ->
// handleUncaughtException(e)
// }
}

private fun handleUncaughtException(e: Throwable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ fun AlbumItemView(
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = "$number song${if (number <= 1L) "" else "s"}",
text = stringResource(R.string.song, number, if (number <= 1L) "" else "s"),
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
IconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ fun ArtistItemView(
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = "$number song${if (number <= 1L) "" else "s"}",
text = stringResource(R.string.song, number, if (number <= 1L) "" else "s"),
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
IconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ fun FolderItemView(
modifier = Modifier.horizontalScroll(rememberScrollState(0)),
)
Text(
text = "$number",
text = stringResource(R.string.song, number, if (number <= 1L) "" else "s"),
color = MaterialTheme.colorScheme.onBackground,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ fun GenreItemView(
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(
text = stringResource(R.string.song, number),
text = stringResource(R.string.song, number, if (number <= 1L) "" else "s"),
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
IconButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ fun PlayListItemView(
modifier = Modifier.horizontalScroll(rememberScrollState(0))
)
Text(
text = "$number",
text = stringResource(R.string.song, number, if (number <= 1L) "" else "s"),
color = MaterialTheme.colorScheme.onBackground,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ import com.ztftrue.music.play.ACTION_PlayLIST_CHANGE
import com.ztftrue.music.play.ACTION_RemoveFromQueue
import com.ztftrue.music.play.ACTION_TRACKS_DELETE
import com.ztftrue.music.sqlData.model.MusicItem
import com.ztftrue.music.utils.model.AnyListBase
import com.ztftrue.music.utils.OperateType
import com.ztftrue.music.utils.PlayListType
import com.ztftrue.music.utils.trackManager.PlaylistManager
import com.ztftrue.music.utils.trackManager.TracksManager
import com.ztftrue.music.utils.Utils
import com.ztftrue.music.utils.enumToStringForPlayListType
import com.ztftrue.music.utils.model.AnyListBase
import com.ztftrue.music.utils.trackManager.PlaylistManager
import com.ztftrue.music.utils.trackManager.TracksManager

@androidx.annotation.OptIn(UnstableApi::class)
@OptIn(ExperimentalFoundationApi::class)
Expand Down Expand Up @@ -298,6 +298,9 @@ fun MusicItemView(
if (playList.type != viewModel.playListCurrent.value?.type || viewModel.playListCurrent.value?.id != playList.id) {
viewModel.playListCurrent.value = playList
viewModel.musicQueue.clear()
// TODO need re-design, should use event EVENT_changePlayQueue
// avoid can't switch current play lyrics
viewModel.currentPlayQueueIndex.intValue=-1
viewModel.musicQueue.addAll(musicList)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<string name="flatten_failed">展平失败</string>
<string name="flatten">展平</string>
<string name="can_t_find_any_audio_file_i_need_permission_click_here_to_open_settings">没有权限,无法获取音乐,点击设置权限</string>
<string name="song">%1$s 歌曲%2$s</string>
<string name="song">%1$s 首歌曲</string>
<string name="settings">设置</string>
<string name="feedback">反馈</string>
<string name="exit_app">退出APP</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,5 @@
<string name="play_error_play_next">Play error, auto play next</string>
<string name="no_dictionary_app_tip">Dictionary app is not installed or your dictionary app do not support this feature.</string>
<string name="cant_support_feature_tip">You system don\'t support this feature</string>

</resources>

0 comments on commit e4a1c3d

Please sign in to comment.