[Android] Scale up volume and brightness gestures to make them more responsive

Vitaliy Grabchuk git at videolan.org
Wed Mar 13 11:11:33 CET 2019


vlc-android | branch: 3.1.x | Vitaliy Grabchuk <vitaliygrabchuk at gmail.com> | Thu Mar  7 12:32:23 2019 +0200| [d9087c3ecac95a6b38bccfbf0a03273958e13c14] | committer: Geoffrey Métais

Scale up volume and brightness gestures to make them more responsive

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

> https://code.videolan.org/videolan/vlc-android/commit/d9087c3ecac95a6b38bccfbf0a03273958e13c14
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoTouchDelegate.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 ce3216b56..7c44be6c7 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)
+        val delta = -(y_changed / screenConfig.metrics.heightPixels.toFloat() * 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()
@@ -297,7 +297,7 @@ class VideoTouchDelegate(private val player: VideoPlayerActivity,
         mTouchAction = TOUCH_BRIGHTNESS
 
         // Set delta : 2f is arbitrary for now, it possibly will change in the future
-        val delta = -ychanged / screenConfig.yRange
+        val delta = -ychanged / screenConfig.yRange * 1.25f
 
         player.changeBrightness(delta)
     }



More information about the Android mailing list