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

Vitaliy Grabchuk git at videolan.org
Fri Mar 8 09:44:45 CET 2019


vlc-android | branch: master | Vitaliy Grabchuk <vitaliygrabchuk at gmail.com> | Thu Mar  7 12:32:23 2019 +0200| [a5ecac61f7f7d24ccd43a6d666fe5fc68a052eba] | 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/a5ecac61f7f7d24ccd43a6d666fe5fc68a052eba
---

 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