Merge pull request #2342 from Kruna1Pate1/fix/swipe-gesture-improvement

Fix sync of volume progress changed by other mediums
This commit is contained in:
Krunal Patel 2022-12-10 23:32:20 +05:30 committed by GitHub
commit 75db99ba70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -416,8 +416,15 @@ internal class CustomExoPlayerView(
}
private fun updateVolume(distance: Float) {
gestureViewBinding.volumeControlView.visibility = View.VISIBLE
val bar = gestureViewBinding.volumeProgressBar
gestureViewBinding.volumeControlView.apply {
if (visibility == View.GONE) {
visibility = View.VISIBLE
// Volume could be changed using other mediums, sync progress
// bar with new value.
bar.progress = audioHelper.getVolumeWithScale(bar.max)
}
}
if (bar.progress == 0) {
gestureViewBinding.volumeImageView.setImageResource(