Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
3.10.1
Browse files Browse the repository at this point in the history
修复播放界面星不变红问题。
  • Loading branch information
Moriafly committed Jul 25, 2021
1 parent 5769c45 commit fbf8352
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 37 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ android {
applicationId "com.dirror.music"
minSdkVersion 21
targetSdkVersion 30
versionCode 744
versionName "3.10.0"
versionCode 745
versionName "3.10.1"

multiDexEnabled true

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a' // , 'x86' // 'arm64-v8a', 'armeabi-v7a', 'x86'
abiFilters 'armeabi-v7a', 'arm64-v8a' // 'armeabi-v7a', 'x86'
}

}
Expand Down
18 changes: 0 additions & 18 deletions app/release/output-metadata.json

This file was deleted.

4 changes: 2 additions & 2 deletions app/src/main/java/com/dirror/music/service/MusicService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import kotlin.coroutines.suspendCoroutine

/**
* Dso Music 音乐播放服务
*
* @author Moriafly
* @since 2020/9
*/
Expand Down Expand Up @@ -213,9 +214,8 @@ open class MusicService : BaseMediaService() {
mediaSessionCallback = object : MediaSessionCompat.Callback() {

override fun onPlay() {
// 注册广播
// 注册监听噪音的广播,接收到噪音(耳机断开)触发 onPause
registerReceiver(myNoisyAudioStreamReceiver, intentFilter)

// 请求音频焦点
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (isAudioFocus) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/dirror/music/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class MainActivity : BaseActivity() {
}

override fun initView() {
mainViewModel.updateUI()
thread {
ACache.get(this).getAsBitmap(Config.APP_THEME_BACKGROUND)?.let {
runOnMainThread {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,37 @@ import com.dirror.music.MyApp
import com.dirror.music.manager.User
import com.dirror.music.util.Config

/**
* MainActivity ViewModel
*/
class MainViewModel: ViewModel() {

var singleColumnPlaylist = MutableLiveData<Boolean>().also {
it.value = false
}

/** 状态栏高度 */
val statusBarHeight = MutableLiveData<Int>()

/** 导航栏高度 */
val navigationBarHeight = MutableLiveData<Int>()

/**
* 用户 id
*/
val userId = MutableLiveData<Long>().also {
it.value = User.uid
}

var neteaseLiveVisibility = MutableLiveData(false)
/**
* 网易登录后才可见
*/
val neteaseLiveVisibility = MutableLiveData<Boolean>().also {
it.value = MyApp.mmkv.decodeBool(Config.USER_NETEASE_CLOUD_MUSIC_API_ENABLE, false)
}

// 句子推荐可见性
var sentenceVisibility = MutableLiveData(true)
/**
* 句子推荐可见性
*/
var sentenceVisibility = MutableLiveData<Boolean>().also {
it.value = MyApp.mmkv.decodeBool(Config.SENTENCE_RECOMMEND, true)
}

/**
* 设置用户 id
Expand All @@ -34,9 +45,11 @@ class MainViewModel: ViewModel() {
userId.value = User.uid
}

/**
* 刷新 UI
*/
fun updateUI() {
neteaseLiveVisibility.value = MyApp.mmkv.decodeBool(Config.USER_NETEASE_CLOUD_MUSIC_API_ENABLE, false)
singleColumnPlaylist.value = MyApp.mmkv.decodeBool(Config.SINGLE_COLUMN_USER_PLAYLIST, false)
sentenceVisibility.value = MyApp.mmkv.decodeBool(Config.SENTENCE_RECOMMEND, true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ class PlayerActivity : SlideBackActivity() {
seekBarVolume.progressDrawable.colorFilter = PorterDuffColorFilter(it, PorterDuff.Mode.SRC_IN)

ivVolume.setColorFilter(it)
if (playViewModel.heart.value == true) {
playViewModel.heart.value = true
}
}
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ class PlayerViewModel: ViewModel() {
it.value = Color.rgb(100, 100, 100)
}

var heart = MutableLiveData<Boolean>()
/**
* 当前歌曲是否被点红心,
* 若有,实心,保持红色
* 若无,空心,跟随封面变色
*/
val heart = MutableLiveData<Boolean>()

/** 平常颜色 */
var normalColor = MutableLiveData<Int>()
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@
android:id="@+id/rvNewSong"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
android:paddingStart="6dp"
android:paddingEnd="6dp" />
android:overScrollMode="never" />

<TextView
android:id="@+id/tvFoyou"
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.31'
ext {
kotlin_version = '1.4.31'
// compose_version = '1.0.0-beta09'
}
repositories {
maven { url 'https://jitpack.io' }
google()
Expand Down

0 comments on commit fbf8352

Please sign in to comment.