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

Commit

Permalink
v2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Moriafly committed Jan 18, 2021
1 parent 8fb8dc1 commit 836bd10
Show file tree
Hide file tree
Showing 39 changed files with 886 additions and 862 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ compileSdkVersion 30

Android Gradle Plugin Version 4.1.1

Gradle Version 6.7.1
Gradle Version 6.8

# 开源协议 License

Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
applicationId "com.dirror.music"
minSdkVersion 23
targetSdkVersion 30
versionCode 280
versionCode 281
versionName "2.3.5"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Binary file renamed app/release/2.3.4.apk → app/release/2.3.5.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": 278,
"versionName": "2.3.4",
"versionCode": 281,
"versionName": "2.3.5",
"outputFile": "app-release.apk"
}
]
Expand Down
11 changes: 6 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:targetApi="n"
android:allowBackup="true">
tools:targetApi="n">
<activity android:name=".ui.activity.AboutActivity2" />
<activity android:name=".ui.activity.PlaylistInfoActivity" />
<activity android:name=".ui.activity.ArtistActivity" />
<activity android:name=".ui.activity.PlayHistoryActivity" />
Expand All @@ -44,16 +45,16 @@
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.CommentActivity"
android:theme="@style/AppTheme.TranslucentFullScreen" />
android:theme="@style/AppTheme.FullScreen.Translucent" />
<activity android:name=".ui.activity.OpenSourceActivity" />
<activity android:name=".ui.activity.SettingsActivity" />
<activity
android:name=".ui.activity.PlayerActivity"
android:launchMode="singleTask"
android:theme="@style/AppTheme.TranslucentFullScreen" />
android:theme="@style/AppTheme.FullScreen.Translucent" />
<activity
android:name=".ui.activity.PlaylistActivity"
android:theme="@style/AppTheme.TranslucentFullScreen" />
android:theme="@style/AppTheme.FullScreen.Translucent" />
<activity android:name=".ui.activity.LoginByUidActivity" />
<activity android:name=".ui.activity.LoginByPhoneActivity" />
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.dirror.music.MyApplication
import com.dirror.music.R
Expand Down Expand Up @@ -46,7 +47,7 @@ class PlaylistAdapter(private val playlist: ArrayList<PlaylistData>, val activit
val url = MyApplication.cloudMusicManager.getPicture(play.coverImgUrl, 56.dp())
GlideUtil.load(url, holder.ivCover)
holder.tvName.text = play.name
holder.tvTrackCount.text = "${play.trackCount}"
holder.tvTrackCount.text = holder.itemView.context.getString(R.string.songs, play.trackCount)
holder.clTrack.setOnClickListener {
val intent = Intent(it.context, PlaylistActivity::class.java)

Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/dirror/music/music/qq/PlayUrl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,4 @@ object PlayUrl {
val vkey: String
)


}
70 changes: 70 additions & 0 deletions app/src/main/java/com/dirror/music/ui/activity/AboutActivity2.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package com.dirror.music.ui.activity

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.dirror.music.MyApplication
import com.dirror.music.R
import com.dirror.music.databinding.ActivityAbout2Binding
import com.dirror.music.util.Secure
import com.dirror.music.util.UpdateUtil
import com.dirror.music.util.getVisionCode
import com.dirror.music.util.getVisionName

/**
* 2.0 新版 AboutActivity
*/
class AboutActivity2 : AppCompatActivity() {

companion object {
// 官方网站
private const val WEBSITE = "https://moriafly.xyz"
// 更新日志网站
private const val UPDATE_LOG = "https://github.com/Moriafly/DsoMusic/releases"
private const val WEB_INFO = "https://moriafly.xyz/dirror-music/info.json"
private const val HISTORY_VERSION = "https://moriafly.xyz/foyou/dsomusic/history-version.html"
}

private lateinit var binding: ActivityAbout2Binding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityAbout2Binding.inflate(layoutInflater)
setContentView(binding.root)
initView()
initListener()
}

/**
* 界面初始化
*/
private fun initView() {
binding.apply {
val versionType = if (Secure.isDebug()) {
"测试版"
} else {
"正式版"
}

try {
tvVersion.text = resources.getString(R.string.version, getVisionName(), getVisionCode(), versionType)
} catch (e: Exception) {

}
}
}

private fun initListener() {
binding.apply {
// 检查更新
itemCheckForUpdates.setOnClickListener { UpdateUtil.checkNewVersion(this@AboutActivity2, true) }
// 更新日志
itemUpdateLog.setOnClickListener { MyApplication.activityManager.startWebActivity(this@AboutActivity2, UPDATE_LOG) }
// 历史版本
itemHistoryVersion.setOnClickListener { MyApplication.activityManager.startWebActivity(this@AboutActivity2, HISTORY_VERSION) }
// 使用开源项目
itemOpenSourceCode.setOnClickListener { startActivity(Intent(this@AboutActivity2, OpenSourceActivity::class.java)) }
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ class CommentActivity : AppCompatActivity() {

private fun initView() {

(binding.clBase.layoutParams as FrameLayout.LayoutParams).apply {
topMargin = getStatusBarHeight(window, this@CommentActivity)
}
// (binding.clBase.layoutParams as FrameLayout.LayoutParams).apply {
// topMargin = getStatusBarHeight(window, this@CommentActivity)
// }

var rvPlaylistScrollY = 0
binding.rvComment.setOnScrollChangeListener { _, _, _, _, oldScrollY ->
Expand Down
50 changes: 20 additions & 30 deletions app/src/main/java/com/dirror/music/ui/activity/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.widget.LinearLayout
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.fragment.app.Fragment
Expand All @@ -21,22 +20,23 @@ import com.dirror.music.broadcast.HeadsetChangeReceiver
import com.dirror.music.databinding.ActivityMainBinding
import com.dirror.music.music.standard.SongPicture
import com.dirror.music.ui.dialog.PlaylistDialog
import com.dirror.music.ui.fragment.HomeFragment
import com.dirror.music.ui.fragment.MyFragment
import com.dirror.music.ui.viewmodel.MainViewModel
import com.dirror.music.util.*
import com.dirror.music.util.GlideUtil
import com.google.android.material.tabs.TabLayoutMediator
import eightbitlab.com.blurview.RenderScriptBlur

/**
* MainActivity
*/
class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding
private lateinit var musicBroadcastReceiver: MusicBroadcastReceiver // 音乐广播接收
private lateinit var headSetChangeReceiver: HeadsetChangeReceiver // 耳机广播接收
private lateinit var loginReceiver: LoginReceiver // 登录广播接收

private val mainViewModel: MainViewModel by viewModels()
private val mainViewModel = MainViewModel()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -46,7 +46,6 @@ class MainActivity : AppCompatActivity() {
initView()
initListener()
initObserve()

// val radius = ScreenUtil.getCornerRadiusTop(this)
// toast("顶部圆角大小:$radius")
}
Expand Down Expand Up @@ -140,15 +139,18 @@ class MainActivity : AppCompatActivity() {

@SuppressLint("WrongConstant")
private fun initListener() {
// 搜索按钮
binding.ivSearch.setOnClickListener {
startActivity(Intent(this@MainActivity, SearchActivity::class.java))
//
binding.apply {
// 搜索按钮
ivSearch.setOnClickListener {
startActivity(Intent(this@MainActivity, SearchActivity::class.java))
}
// 设置按钮
ivSettings.setOnClickListener {
binding.drawerLayout.openDrawer(Gravity.START)
}
}

// 设置按钮
binding.ivSettings.setOnClickListener {
binding.drawerLayout.openDrawer(Gravity.START)
}

// 侧滑
binding.menuMain.apply {
Expand Down Expand Up @@ -176,30 +178,18 @@ class MainActivity : AppCompatActivity() {
toast("当前为离线模式,请登录")
}
}

}

binding.menuMain.switchPauseSongAfterUnplugHeadset.isChecked = MyApplication.mmkv.decodeBool(Config.PAUSE_SONG_AFTER_UNPLUG_HEADSET, true)

// 反馈
binding.menuMain.itemFeedback.setOnClickListener {
startActivity(Intent(this, FeedbackActivity::class.java))
// 反馈
itemFeedback.setOnClickListener {
startActivity(Intent(this@MainActivity, FeedbackActivity::class.java))
}
}

binding.menuMain.itemSourceCode.setOnClickListener {
MyApplication.activityManager.startWebActivity(this, "https://github.com/Moriafly/dirror-music")
}

binding.menuMain.itemPauseSongAfterUnplugHeadset.setOnClickListener {
binding.menuMain.switchPauseSongAfterUnplugHeadset.isChecked = !binding.menuMain.switchPauseSongAfterUnplugHeadset.isChecked
}

binding.menuMain.switchPauseSongAfterUnplugHeadset.setOnCheckedChangeListener { _, isChecked ->
MyApplication.mmkv.encode(Config.PAUSE_SONG_AFTER_UNPLUG_HEADSET, isChecked)
MyApplication.activityManager.startWebActivity(this, "https://github.com/Moriafly/DsoMusic")
}

binding.menuMain.itemAbout.setOnClickListener {
startActivity(Intent(this, AboutActivity::class.java))
startActivity(Intent(this, AboutActivity2::class.java))
}

// Mini Player
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class PlaylistActivity : AppCompatActivity() {
(binding.includePlay.root.layoutParams as ConstraintLayout.LayoutParams).apply {
bottomMargin = getNavigationBarHeight(this@PlaylistActivity)
}
// 色彩
binding.ivPlayAll.setColorFilter(getColor(R.color.colorAppThemeColor))
// 获取歌单来源
val playlistSource = intent.getIntExtra(EXTRA_PLAYLIST_SOURCE, 0)
// 获取歌单 id
Expand All @@ -86,14 +88,14 @@ class PlaylistActivity : AppCompatActivity() {
initPlaylist(playlistSource, playlistId)

var rvPlaylistScrollY = 0
binding.rvPlaylist.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
binding.rvPlaylist.setOnScrollChangeListener { _, _, _, _, oldScrollY ->
rvPlaylistScrollY += oldScrollY
if (rvPlaylistScrollY < 0) {
if (binding.titleBar.text == "歌单") {
if (binding.titleBar.text == getString(R.string.playlist)) {
binding.titleBar.setTitleBarText(binding.tvName.text.toString())
}
} else {
binding.titleBar.setTitleBarText("歌单")
binding.titleBar.setTitleBarText(getString(R.string.playlist))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.dirror.music.MyApplication
import com.dirror.music.R
import com.dirror.music.databinding.DialogPlayMoreBinding
import com.dirror.music.ui.activity.FeedbackActivity
import com.dirror.music.ui.activity.PlayHistoryActivity
import com.google.android.material.bottomsheet.BottomSheetDialog

class PlayerMenuMoreDialog(context: Context) : BottomSheetDialog(context, R.style.style_default_dialog) {
Expand Down Expand Up @@ -44,20 +45,6 @@ class PlayerMenuMoreDialog(context: Context) : BottomSheetDialog(context, R.styl
dismiss()
}

// 降噪
binding.switchNoiseSuppressor.setOnCheckedChangeListener { buttonView, isChecked ->
// 开启降噪
val audioSession = MyApplication.musicBinderInterface?.getAudioSessionId()?:0
// toast("${audioSession}")
// loge("你好audio: ${audioSession}")
// AudioEffect.noiseSuppressor(audioSession, isChecked)
// AudioEffect.automaticGainControl(audioSession, true)
}

binding.itemNoiseSuppressor.setOnClickListener {
binding.switchNoiseSuppressor.isChecked = !binding.switchNoiseSuppressor.isChecked
}

binding.ivIncreasePitch.setOnClickListener {
MyApplication.musicBinderInterface?.increasePitchLevel()
refreshPitch()
Expand All @@ -67,9 +54,9 @@ class PlayerMenuMoreDialog(context: Context) : BottomSheetDialog(context, R.styl
MyApplication.musicBinderInterface?.decreasePitchLevel()
refreshPitch()
}

binding.itemSpeed.setOnClickListener {
MyApplication.musicBinderInterface?.setSpeed(1f)
// 播放历史
binding.itemPlayHistory.setOnClickListener {
it.context.startActivity(Intent(it.context, PlayHistoryActivity::class.java))
}

// 反馈
Expand All @@ -92,5 +79,4 @@ class PlayerMenuMoreDialog(context: Context) : BottomSheetDialog(context, R.styl
binding.tvPitch.text = MyApplication.musicBinderInterface?.getPitchLevel().toString()
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ class HomeFragment : Fragment() {
changeSentence()
}

binding.includeFeedback.root.setOnClickListener {
activity?.let {
MyApplication.activityManager.startFeedbackActivity(it)
}
}

binding.clDso.setOnClickListener {
val intent = Intent(this.context, PlaylistActivity::class.java)
intent.putExtra(PlaylistActivity.EXTRA_PLAYLIST_SOURCE, SOURCE_DIRROR)
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/anim/anim_slide_enter_bottom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="350"
android:duration="275"
android:interpolator="@android:anim/decelerate_interpolator"
>

Expand All @@ -19,9 +19,9 @@
<!-- android:pivotY="95%"-->
<!-- />-->

<alpha
android:fromAlpha="0.5"
android:toAlpha="1"
/>
<!-- <alpha-->
<!-- android:fromAlpha="0.5"-->
<!-- android:toAlpha="1"-->
<!-- />-->

</set>
Loading

0 comments on commit 836bd10

Please sign in to comment.