update
This commit is contained in:
parent
6565860cbb
commit
3eaccb2e67
@ -337,7 +337,10 @@ class MoPlayDetailsActivity : MoBaseActivity(), Player.Listener {
|
|||||||
binding.totalDurationTv.text =
|
binding.totalDurationTv.text =
|
||||||
convertMillisToMinutesAndSecondsString(MediaControllerManager.getDuration())
|
convertMillisToMinutesAndSecondsString(MediaControllerManager.getDuration())
|
||||||
binding.sbProgress.valueTo = MediaControllerManager.getDuration().toFloat()
|
binding.sbProgress.valueTo = MediaControllerManager.getDuration().toFloat()
|
||||||
binding.sbProgress.value = MediaControllerManager.getCurrentPosition().toFloat()
|
val value = MediaControllerManager.getCurrentPosition().toFloat()
|
||||||
|
if (binding.sbProgress.valueTo > value) {
|
||||||
|
binding.sbProgress.value = MediaControllerManager.getCurrentPosition().toFloat()
|
||||||
|
}
|
||||||
updateProgressState()
|
updateProgressState()
|
||||||
|
|
||||||
binding.progressBar.progress = MediaControllerManager.getBufferedPosition().toInt()
|
binding.progressBar.progress = MediaControllerManager.getBufferedPosition().toInt()
|
||||||
@ -748,8 +751,11 @@ class MoPlayDetailsActivity : MoBaseActivity(), Player.Listener {
|
|||||||
val currentBufferedPosition = MediaControllerManager.getBufferedPosition()
|
val currentBufferedPosition = MediaControllerManager.getBufferedPosition()
|
||||||
binding.progressBar.progress = currentBufferedPosition.toInt()
|
binding.progressBar.progress = currentBufferedPosition.toInt()
|
||||||
|
|
||||||
// 更新 SeekBar 的进度
|
|
||||||
binding.sbProgress.value = currentPosition.toFloat()
|
val value = currentPosition.toFloat()
|
||||||
|
if (binding.sbProgress.valueTo > value) {
|
||||||
|
binding.sbProgress.value = currentPosition.toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
sendEmptyMessageDelayed(1, 50)
|
sendEmptyMessageDelayed(1, 50)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,47 @@
|
|||||||
package relax.offline.music.util
|
package relax.offline.music.util
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.TextUtils
|
||||||
import com.google.firebase.analytics.FirebaseAnalytics
|
import com.google.firebase.analytics.FirebaseAnalytics
|
||||||
|
import com.google.firebase.analytics.ktx.analytics
|
||||||
|
import com.google.firebase.ktx.Firebase
|
||||||
|
|
||||||
object AnalysisUtil {
|
object AnalysisUtil {
|
||||||
private lateinit var firebaseAnalytics: FirebaseAnalytics
|
|
||||||
|
const val PARAM_VALUE = "param_value"
|
||||||
|
|
||||||
|
const val USER_LAUNCH = "user_launch"//用户启动
|
||||||
|
const val LAUNCH_PV = "launch_pv"//启动页曝光
|
||||||
|
const val home_a_pv = "home_a_pv"//A面首页曝光
|
||||||
|
const val home_b_pv = "home_b_pv"//B面首页曝光
|
||||||
|
|
||||||
|
|
||||||
|
private var firebaseAnalytics: FirebaseAnalytics? = null
|
||||||
|
|
||||||
|
fun logEvent(eventName: String, myParam: Map<String, String>? = null) {
|
||||||
|
try {
|
||||||
|
if (firebaseAnalytics == null) {
|
||||||
|
firebaseAnalytics = Firebase.analytics
|
||||||
|
}
|
||||||
|
} catch (ignore: Exception) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myParam != null) {
|
||||||
|
val bundle = Bundle()
|
||||||
|
try {
|
||||||
|
for ((key, value) in myParam) {
|
||||||
|
if (!TextUtils.isEmpty(value) && !TextUtils.isEmpty(key)) {
|
||||||
|
bundle.putString(key, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
firebaseAnalytics?.logEvent(eventName, bundle)
|
||||||
|
} catch (ignore: Exception) {
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
firebaseAnalytics?.logEvent(eventName, null)
|
||||||
|
} catch (ignore: Exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user