update
This commit is contained in:
parent
732eac6b96
commit
ec6350c733
@ -173,13 +173,15 @@ abstract class MoBaseActivity : AppCompatActivity(), MusicPlayerView.PlaySkipFor
|
||||
override fun onPositionDiscontinuity(
|
||||
oldPosition: Player.PositionInfo, newPosition: Player.PositionInfo, reason: Int
|
||||
) {
|
||||
if (reason == Player.DISCONTINUITY_REASON_AUTO_TRANSITION) {
|
||||
LogTag.LogD(TAG,"reason->$reason")
|
||||
if (reason == Player.DISCONTINUITY_REASON_AUTO_TRANSITION
|
||||
|| reason == Player.DISCONTINUITY_REASON_SEEK_ADJUSTMENT) {
|
||||
if (meController != null) {
|
||||
musicPlayerView.updateInfoUi(meController.currentMediaItem)
|
||||
musicPlayerView.updateSetProgress(meController)
|
||||
musicPlayerView.updateProgressState(meController)
|
||||
}
|
||||
|
||||
LogTag.LogD(TAG,"reason update")
|
||||
events.trySend(Event.AutomaticallySwitchSongs)
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
data class OnDownloadRemove(val bean: PlaylistItem) : Request()
|
||||
data class OnUpdateDownloadUi(val bean: PlaylistItem) : Request()
|
||||
data class OnAddPlaylist(val bean: PlaylistItem) : Request()
|
||||
data class OnUpdateCurrentListItem(val bean: PlaylistItem):Request()
|
||||
data class OnUpdateCurrentListItem(val bean: PlaylistItem) : Request()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@ -300,7 +300,7 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
|
||||
override fun onItemMoreClick(position: Int) {
|
||||
val bean = myList[position]
|
||||
LogD(TAG,"MoListDetailsActivity onItemMoreClick -> ${bean.asPlaylistItem}")
|
||||
LogD(TAG, "MoListDetailsActivity onItemMoreClick -> ${bean.asPlaylistItem}")
|
||||
moreDialog = ListMoreBottomSheetDialog(
|
||||
this@MoListDetailsActivity,
|
||||
bean.asPlaylistItem,
|
||||
@ -378,13 +378,25 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
binding.secondSubtitle.text = it.secondSubtitle
|
||||
|
||||
val mapList = it.moPlaylistOrAlbumListBean.map { item ->
|
||||
val offlineBean = App.appOfflineDBManager.getOfflineBeanByID(item.videoId!!)
|
||||
val favoriteBean = App.appFavoriteDBManager.getFavoriteBeanByID(item.videoId)
|
||||
val offlineBean = App.appOfflineDBManager.getOfflineBeanByID(item.videoId?:"")
|
||||
val favoriteBean = App.appFavoriteDBManager.getFavoriteBeanByID(item.videoId?:"")
|
||||
var isOffline = false
|
||||
var bytesDownloaded = 0L
|
||||
var size = ""
|
||||
if (offlineBean != null) {
|
||||
isOffline = offlineBean.isOffline
|
||||
bytesDownloaded = offlineBean.bytesDownloaded ?: 0L
|
||||
size = offlineBean.size ?: ""
|
||||
}
|
||||
var isFavorite = false
|
||||
if (favoriteBean != null) {
|
||||
isFavorite = favoriteBean.isFavorite
|
||||
}
|
||||
item.copy(
|
||||
isOffline = offlineBean?.isOffline ?: false,
|
||||
isFavorite = favoriteBean?.isFavorite ?: false,
|
||||
bytesDownloaded = offlineBean?.bytesDownloaded,
|
||||
size = offlineBean?.size
|
||||
isOffline = isOffline,
|
||||
isFavorite = isFavorite,
|
||||
bytesDownloaded = bytesDownloaded,
|
||||
size = size
|
||||
)
|
||||
}
|
||||
|
||||
@ -414,7 +426,7 @@ class MoListDetailsActivity : MoBaseActivity(), DetailsListAdapter.OnItemMoreCli
|
||||
}
|
||||
myList.forEach { item ->
|
||||
if (item.videoId == id) {
|
||||
LogD(TAG,"updateCurrentItem -> $item")
|
||||
LogD(TAG, "updateCurrentItem -> $item")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -505,7 +505,7 @@ class MoPlayDetailsActivity : MoBaseActivity(), Player.Listener {
|
||||
binding.sbProgress.valueTo = MediaControllerManager.getDuration().toFloat()
|
||||
val value = MediaControllerManager.getCurrentPosition().toFloat()
|
||||
if (binding.sbProgress.valueTo > value) {
|
||||
binding.sbProgress.value = MediaControllerManager.getCurrentPosition().toFloat()
|
||||
binding.sbProgress.value = value
|
||||
}
|
||||
updateProgressState()
|
||||
|
||||
@ -893,7 +893,7 @@ class MoPlayDetailsActivity : MoBaseActivity(), Player.Listener {
|
||||
|
||||
val value = currentPosition.toFloat()
|
||||
if (binding.sbProgress.valueTo > value) {
|
||||
binding.sbProgress.value = currentPosition.toFloat()
|
||||
binding.sbProgress.value = value
|
||||
}
|
||||
|
||||
sendEmptyMessageDelayed(1, 50)
|
||||
|
||||
@ -150,6 +150,7 @@ class PlaybackService : MediaSessionService(), Player.Listener {
|
||||
|
||||
return ResolvingDataSource.Factory(createCacheDataSource()) { dataSpec ->
|
||||
val videoId = dataSpec.key ?: error("A key must be set")
|
||||
LogD(TAG, "playbackService videoId-> $videoId")
|
||||
val position = dataSpec.position
|
||||
val length = if (dataSpec.length >= 0) dataSpec.length else 1
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ class RatingDialog(private val mContext: Context) : Dialog(mContext) {
|
||||
}
|
||||
}
|
||||
dismiss()
|
||||
|
||||
|
||||
val jsonObject = JSONObject()
|
||||
jsonObject.put(
|
||||
"rating_star_type", starType
|
||||
|
||||
Loading…
Reference in New Issue
Block a user