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

Commit

Permalink
汀上白沙看不见
Browse files Browse the repository at this point in the history
  • Loading branch information
Moriafly committed Apr 9, 2021
1 parent 6da7aa5 commit 3773a26
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ https://blog.csdn.net/Moriafly/article/details/109708728

### 基于网易云 API

- [x] 私人 FM
- [x] 所有榜单
- [x] 所有榜单内容摘要
- [x] 获取每日推荐歌曲
Expand Down Expand Up @@ -181,7 +182,6 @@ https://blog.csdn.net/Moriafly/article/details/109708728
- [ ] 获取每日推荐歌单
- [ ] 获取历史日推可用日期列表
- [ ] 获取历史日推详情数据
- [ ] 私人 FM
- [ ] 签到
- [ ] 喜欢音乐列表
- [ ] 垃圾桶
Expand Down
4 changes: 3 additions & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
3.2.0-alpha
汀上白沙看不见

####

私人 FM

####

隐藏个人界面 UID 显示
移除 QQ 源搜索
优化安装包大小
首页句子推荐开关无需重新进入应用生效

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ android {
applicationId "com.dirror.music"
minSdkVersion 21
targetSdkVersion 30
versionCode 715
versionName "3.2.0-alpha"
versionCode 716
versionName "汀上白沙看不见"

multiDexEnabled true

Expand Down
Binary file removed app/release/3.1.0.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 714,
"versionName": "3.2.0-alpha",
"versionCode": 716,
"versionName": "濠殿喚娅㈤幏宄扳槈閹剧鍔熸繛鍛囧啠鏌︽繛鍡樺灦缁犳瑥鈽夐幘宕囆ユい顐嫹",
"outputFile": "app-release.apk"
}
]
Expand Down
Binary file not shown.
10 changes: 4 additions & 6 deletions app/src/main/java/com/dirror/music/adapter/SongAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ import coil.size.ViewSizeResolver
import coil.transform.RoundedCornersTransformation
import com.dirror.music.MyApplication.Companion.mmkv
import com.dirror.music.R
import com.dirror.music.music.standard.data.SOURCE_NETEASE
import com.dirror.music.music.standard.data.SOURCE_QQ
import com.dirror.music.music.standard.data.StandardSongData
import com.dirror.music.music.standard.data.*
import com.dirror.music.service.playMusic
import com.dirror.music.util.*
import com.dirror.music.util.extensions.dp
Expand Down Expand Up @@ -79,7 +77,7 @@ class SongAdapter(
holder.tvSub.alpha = 1f
}

if (song.neteaseInfo?.pl ?: 0 >= 320000) {
if (song.quality() == SONG_QUALITY_HQ) {
holder.ivTag.visibility = View.VISIBLE
} else {
holder.ivTag.visibility = View.GONE
Expand All @@ -101,7 +99,7 @@ class SongAdapter(
}
else -> song.imageUrl
}
// loge(imageUrl ?: "", "适配器图片")

ivCover.load(imageUrl) {
transformations(RoundedCornersTransformation(dp2px(6f)))
size(ViewSizeResolver(ivCover))
Expand All @@ -121,7 +119,7 @@ class SongAdapter(
if (song.neteaseInfo?.pl != 0) {
playMusic(it.context, song, currentList.toArrayList())
} else {
toast("网易云暂无版权或者是 VIP 歌曲,可以试试 QQ 和酷我音源")
toast("网易云暂无版权或者是 VIP 歌曲,可以试试 QQ 音源")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,31 @@ data class StandardSongData(
) : Parcelable

}

/**
* 普通品质
*/
const val SONG_QUALITY_NORMAL = 0

/**
* HQ 品质
*/
const val SONG_QUALITY_HQ = 1

/**
* 获取 song 的品质
*/
fun StandardSongData.quality(): Int {
return when (this.source) {
SOURCE_NETEASE -> {
if (this.neteaseInfo?.pl ?: 0 >= 320000) {
SONG_QUALITY_HQ
} else {
SONG_QUALITY_NORMAL
}
}
else -> {
SONG_QUALITY_NORMAL
}
}
}
10 changes: 10 additions & 0 deletions app/src/main/java/com/dirror/music/ui/dialog/UpdateDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import com.dirror.music.MyApplication
import com.dirror.music.R
import com.dirror.music.databinding.DialogUpdateBinding
import com.dirror.music.util.*
Expand All @@ -30,6 +32,14 @@ class UpdateDialog(context: Context, private val updateData: UpdateUtil.UpdateDa
binding.tvTitle.text = "发现新版本 ${updateData.name}"
binding.tvContent.text = updateData.content

updateData.tagVersion?.let {
if (getVisionCode() < it) {
toast("过低版本,请更新")
openUrlByBrowser(this.context, updateData.url)
binding.btnCancel.visibility = View.GONE
}
}

binding.btnCancel.setOnClickListener {
dismiss()
}
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/java/com/dirror/music/ui/player/PlayerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,16 @@ class PlayerActivity : SlideBackActivity() {
}
}

override fun onStart() {
super.onStart()
binding.lyricsBackground.resume()
}

override fun onPause() {
super.onPause()
binding.lyricsBackground.pause()
}

/**
* 开启旋转动画
*/
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/dirror/music/util/UpdateUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ object UpdateUtil {
val code: Int,
val content: String,
val url: String, // 下载链接
var tagVersion: Int?,
)

}
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clQQ"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
app:layout_constraintTop_toBottomOf="@+id/ivBackground" />

<TextView
android:visibility="invisible"
android:id="@+id/tvUserId"
android:layout_width="0dp"
android:layout_height="wrap_content"
Expand Down

0 comments on commit 3773a26

Please sign in to comment.