[Android] Updated to use screenConfig.yRange for volume gesture ( same as for brightness)
Vitaliy Grabchuk
git at videolan.org
Thu Mar 28 14:28:55 CET 2019
vlc-android | branch: 3.1.x | Vitaliy Grabchuk <vitaliygrabchuk at gmail.com> | Thu Mar 7 11:54:28 2019 +0200| [3321b663f622935267e0e15e4aa7e40d73950b54] | committer: Geoffrey Métais
Updated to use screenConfig.yRange for volume gesture (same as for brightness)
Signed-off-by: Vitaliy Grabchuk <vitaliygrabchuk at gmail.com>
> https://code.videolan.org/videolan/vlc-android/commit/3321b663f622935267e0e15e4aa7e40d73950b54
---
vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
index 7c44be6c7..7a2e84b6e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt
@@ -261,7 +261,7 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
private fun doVolumeTouch(y_changed: Float) {
if (mTouchAction != TOUCH_NONE && mTouchAction != TOUCH_VOLUME) return
val audioMax = player.audioMax
- val delta = -(y_changed / screenConfig.metrics.heightPixels.toFloat() * audioMax * 1.25f)
+ val delta = -(y_changed / screenConfig.yRange * audioMax * 1.25f)
player.volume += delta
val vol = Math.min(Math.max(player.volume, 0f), (audioMax * if (player.isAudioBoostEnabled) 2 else 1).toFloat()).toInt()
if (delta < 0) player.originalVol = vol.toFloat()
More information about the Android
mailing list