Commit 4962f7b4 authored by Vitaliy Grabchuk's avatar Vitaliy Grabchuk Committed by Geoffrey Métais

Updated to use screenConfig.yRange for volume gesture (same as for brightness)

Signed-off-by: Vitaliy Grabchuk's avatarVitaliy Grabchuk <vitaliygrabchuk@gmail.com>
parent fd5c7882
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment