diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt index 61ff895a0..dcb8793bd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/views/MediaSideScroll.kt @@ -156,6 +156,10 @@ class MediaSideScroll(context: Context, attrs: AttributeSet) : RelativeLayout(co val stream = AudioManager.STREAM_MUSIC val maxVolume = activity!!.audioManager.getStreamMaxVolume(stream) val percentPerPoint = 100 / maxVolume + if (percentPerPoint == 0) { + return + } + val addPoints = percent / percentPerPoint val newVolume = Math.min(maxVolume, Math.max(0, mTouchDownValue + addPoints)) activity!!.audioManager.setStreamVolume(stream, newVolume, 0)