update
This commit is contained in:
parent
e767cbd980
commit
fe89030ad0
@ -92,21 +92,21 @@ class LaunchActivity : MoBaseActivity() {
|
||||
}
|
||||
|
||||
private fun toMainActivity() {
|
||||
if (!withPermission()) {
|
||||
if (type == 1) {//如果type等于1,则是从后台进入的应用,不进行跳转直接关闭启动页
|
||||
finish()
|
||||
} else {
|
||||
startActivity(Intent(this, MainActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
} else {
|
||||
// if (!withPermission()) {
|
||||
// if (type == 1) {//如果type等于1,则是从后台进入的应用,不进行跳转直接关闭启动页
|
||||
// finish()
|
||||
// } else {
|
||||
// startActivity(Intent(this, MainActivity::class.java))
|
||||
// finish()
|
||||
// }
|
||||
// } else {
|
||||
if (type == 1) {
|
||||
finish()
|
||||
} else {
|
||||
startActivity(Intent(this, PrimaryActivity::class.java))
|
||||
finish()
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
private fun loadAd() {
|
||||
|
||||
@ -5,6 +5,7 @@ import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.EditText
|
||||
import android.widget.TextView
|
||||
@ -59,6 +60,7 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
private var adapter: LikedSongsAdapter? = null
|
||||
private var favoriteBeans: MutableList<FavoriteBean> = mutableListOf()
|
||||
private var currentPosition = -1
|
||||
private var isAnimationRunning = false//动画是否正在进行
|
||||
|
||||
override suspend fun main() {
|
||||
binding = ActivityLikedSongsBinding.inflate(layoutInflater)
|
||||
@ -307,7 +309,9 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
|
||||
override fun onMoreClick(position: Int) {
|
||||
currentPosition = position
|
||||
toggleBottomLayout(position)
|
||||
if (!isAnimationRunning) {
|
||||
toggleBottomLayout(position)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initDownloadFlow() {
|
||||
@ -400,6 +404,23 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
|
||||
private fun showBottomLayout(position: Int) {
|
||||
val slideUpAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_up)
|
||||
slideUpAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation) {
|
||||
isAnimationRunning = true
|
||||
// 动画开始时禁用按钮
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation) {
|
||||
isAnimationRunning = false
|
||||
// 动画结束时启用按钮
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation) {
|
||||
// 可选:处理动画重复的情况
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideUpAnimation)
|
||||
binding.bottomLayout.visibility = View.VISIBLE
|
||||
|
||||
@ -429,8 +450,26 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
|
||||
private fun hideBottomLayout() {
|
||||
val slideDownAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_down)
|
||||
slideDownAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation?) {
|
||||
isAnimationRunning = true
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
isAnimationRunning = false
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation?) {
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideDownAnimation)
|
||||
binding.bottomLayout.visibility = View.GONE
|
||||
|
||||
//隐藏布局后则,解除点击限制
|
||||
binding.moreDownloadBtn.isClickable = true
|
||||
binding.moreDownloadBtn.isEnabled = true
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@ -450,6 +489,16 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
|
||||
}
|
||||
}
|
||||
|
||||
private fun animationLoadingNotClick(b: Boolean) {
|
||||
binding.layoutInfo.isClickable = b
|
||||
binding.bottomCloseBtn.isClickable = b
|
||||
binding.bottomBlankLayout.isClickable = b
|
||||
binding.moreDownloadBtn.isClickable = b
|
||||
binding.moreAddPlaylistBtn.isClickable = b
|
||||
binding.favoritesBtn.isClickable = b
|
||||
}
|
||||
|
||||
|
||||
private fun showDataUi() {
|
||||
binding.loadingLayout.visibility = View.GONE
|
||||
binding.noContentLayout.visibility = View.GONE
|
||||
|
||||
@ -6,6 +6,7 @@ import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
@ -77,6 +78,7 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
mutableListOf()
|
||||
private var myBean: Innertube.MoPlaylistOrAlbumPage? = null
|
||||
private var currentPosition = -1
|
||||
private var isAnimationRunning = false//动画是否正在进行
|
||||
override suspend fun main() {
|
||||
binding = ActivityDetailsBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
@ -306,7 +308,9 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
|
||||
override fun onItemMoreClick(position: Int) {
|
||||
currentPosition = position
|
||||
toggleBottomLayout(position)
|
||||
if (!isAnimationRunning) {
|
||||
toggleBottomLayout(position)
|
||||
}
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
@ -515,6 +519,23 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
|
||||
private fun showBottomLayout(position: Int) {
|
||||
val slideUpAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_up)
|
||||
slideUpAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation) {
|
||||
isAnimationRunning = true
|
||||
// 动画开始时禁用按钮
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation) {
|
||||
isAnimationRunning = false
|
||||
// 动画结束时启用按钮
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation) {
|
||||
// 可选:处理动画重复的情况
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideUpAnimation)
|
||||
binding.bottomLayout.visibility = View.VISIBLE
|
||||
|
||||
@ -545,8 +566,35 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
|
||||
private fun hideBottomLayout() {
|
||||
val slideDownAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_down)
|
||||
slideDownAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation?) {
|
||||
isAnimationRunning = true
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
isAnimationRunning = false
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation?) {
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideDownAnimation)
|
||||
binding.bottomLayout.visibility = View.GONE
|
||||
|
||||
//隐藏布局后则,解除点击限制
|
||||
binding.moreDownloadBtn.isClickable = true
|
||||
binding.moreDownloadBtn.isEnabled = true
|
||||
}
|
||||
|
||||
private fun animationLoadingNotClick(b: Boolean) {
|
||||
binding.layoutInfo.isClickable = b
|
||||
binding.bottomCloseBtn.isClickable = b
|
||||
binding.bottomBlankLayout.isClickable = b
|
||||
binding.moreDownloadBtn.isClickable = b
|
||||
binding.moreAddPlaylistBtn.isClickable = b
|
||||
binding.favoritesBtn.isClickable = b
|
||||
}
|
||||
|
||||
private fun showRemoveDownloadDialogHint(id: String) {
|
||||
|
||||
@ -5,6 +5,7 @@ import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.OptIn
|
||||
@ -45,6 +46,7 @@ class MoOfflineSongsActivity : MoBaseActivity() {
|
||||
private var offlineList: MutableList<OfflineBean> = mutableListOf()
|
||||
|
||||
private var currentPosition = -1
|
||||
private var isAnimationRunning = false//动画是否正在进行
|
||||
|
||||
override suspend fun main() {
|
||||
binding = ActivityOfflineSongsBinding.inflate(layoutInflater)
|
||||
@ -217,7 +219,9 @@ class MoOfflineSongsActivity : MoBaseActivity() {
|
||||
adapter?.setOnMoreClickListener(object : OfflineSongsAdapter.OnMoreClickListener {
|
||||
override fun onMoreClick(position: Int) {
|
||||
currentPosition = position
|
||||
toggleBottomLayout(position)
|
||||
if (!isAnimationRunning) {
|
||||
toggleBottomLayout(position)
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.rv.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
@ -291,6 +295,23 @@ class MoOfflineSongsActivity : MoBaseActivity() {
|
||||
|
||||
private fun showBottomLayout(position: Int) {
|
||||
val slideUpAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_up)
|
||||
slideUpAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation) {
|
||||
isAnimationRunning = true
|
||||
// 动画开始时禁用按钮
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation) {
|
||||
isAnimationRunning = false
|
||||
// 动画结束时启用按钮
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation) {
|
||||
// 可选:处理动画重复的情况
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideUpAnimation)
|
||||
binding.bottomLayout.visibility = View.VISIBLE
|
||||
|
||||
@ -308,10 +329,34 @@ class MoOfflineSongsActivity : MoBaseActivity() {
|
||||
|
||||
private fun hideBottomLayout() {
|
||||
val slideDownAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_down)
|
||||
slideDownAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation?) {
|
||||
isAnimationRunning = true
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
isAnimationRunning = false
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation?) {
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideDownAnimation)
|
||||
binding.bottomLayout.visibility = View.GONE
|
||||
}
|
||||
|
||||
private fun animationLoadingNotClick(b: Boolean) {
|
||||
binding.layoutInfo.isClickable = b
|
||||
binding.bottomCloseBtn.isClickable = b
|
||||
binding.bottomBlankLayout.isClickable = b
|
||||
binding.moreDownloadBtn.isClickable = b
|
||||
binding.moreAddPlaylistBtn.isClickable = b
|
||||
binding.favoritesBtn.isClickable = b
|
||||
}
|
||||
|
||||
|
||||
private fun showDataUi() {
|
||||
binding.loadingLayout.visibility = View.GONE
|
||||
binding.noContentLayout.visibility = View.GONE
|
||||
|
||||
@ -5,6 +5,7 @@ import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
@ -71,6 +72,7 @@ class MoPlaylistSongsActivity : MoBaseActivity() {
|
||||
private var currentPosition = -1
|
||||
private var playlistId = -1
|
||||
private var playlistTitle = ""
|
||||
private var isAnimationRunning = false//动画是否正在进行
|
||||
|
||||
override suspend fun main() {
|
||||
binding = ActivityPlaylistSongsBinding.inflate(layoutInflater)
|
||||
@ -348,7 +350,9 @@ class MoPlaylistSongsActivity : MoBaseActivity() {
|
||||
adapter?.setOnMoreClickListener(object : PlaylistSongsAdapter.OnMoreClickListener {
|
||||
override fun onMoreClick(position: Int) {
|
||||
currentPosition = position
|
||||
toggleBottomLayout(position)
|
||||
if (!isAnimationRunning) {
|
||||
toggleBottomLayout(position)
|
||||
}
|
||||
}
|
||||
})
|
||||
binding.rv.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
|
||||
@ -478,6 +482,23 @@ class MoPlaylistSongsActivity : MoBaseActivity() {
|
||||
|
||||
private fun showBottomLayout(position: Int) {
|
||||
val slideUpAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_up)
|
||||
slideUpAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation) {
|
||||
isAnimationRunning = true
|
||||
// 动画开始时禁用按钮
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation) {
|
||||
isAnimationRunning = false
|
||||
// 动画结束时启用按钮
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation) {
|
||||
// 可选:处理动画重复的情况
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideUpAnimation)
|
||||
binding.bottomLayout.visibility = View.VISIBLE
|
||||
|
||||
@ -496,9 +517,9 @@ class MoPlaylistSongsActivity : MoBaseActivity() {
|
||||
val currentDownload = DownloadUtil.getCurrentIdDownload(bean.videoId)
|
||||
if (currentDownload != null) {
|
||||
//是否下载过资源,下载过资源就不走download的ui更新,因为 它肯定状态为3
|
||||
if(DownloadUtil.downloadResourceExist(bean.videoId)){
|
||||
if (DownloadUtil.downloadResourceExist(bean.videoId)) {
|
||||
requests.trySend(Request.OnUpdateDownloadUi(bean.videoId))
|
||||
}else{
|
||||
} else {
|
||||
updateDownloadUI(currentDownload)
|
||||
}
|
||||
} else {
|
||||
@ -508,8 +529,35 @@ class MoPlaylistSongsActivity : MoBaseActivity() {
|
||||
|
||||
private fun hideBottomLayout() {
|
||||
val slideDownAnimation = AnimationUtils.loadAnimation(this, R.anim.slide_down)
|
||||
slideDownAnimation.setAnimationListener(object : Animation.AnimationListener {
|
||||
override fun onAnimationStart(animation: Animation?) {
|
||||
isAnimationRunning = true
|
||||
animationLoadingNotClick(false)
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animation?) {
|
||||
isAnimationRunning = false
|
||||
animationLoadingNotClick(true)
|
||||
}
|
||||
|
||||
override fun onAnimationRepeat(animation: Animation?) {
|
||||
}
|
||||
})
|
||||
binding.bottomLayout.startAnimation(slideDownAnimation)
|
||||
binding.bottomLayout.visibility = View.GONE
|
||||
|
||||
//隐藏布局后则,解除点击限制
|
||||
binding.moreDownloadBtn.isClickable = true
|
||||
binding.moreDownloadBtn.isEnabled = true
|
||||
}
|
||||
|
||||
private fun animationLoadingNotClick(b: Boolean) {
|
||||
binding.layoutInfo.isClickable = b
|
||||
binding.bottomCloseBtn.isClickable = b
|
||||
binding.bottomBlankLayout.isClickable = b
|
||||
binding.moreDownloadBtn.isClickable = b
|
||||
binding.moreAddPlaylistBtn.isClickable = b
|
||||
binding.favoritesBtn.isClickable = b
|
||||
}
|
||||
|
||||
private fun showDataUi() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user