diff --git a/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt b/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt index f48cd4861b303cc63a00836e1e44954af725fedb..f500a87e6b6db91a6892585fc9eed4bc28b3736e 100644 --- a/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt +++ b/app/src/main/java/com/futo/platformplayer/views/behavior/GestureControlView.kt @@ -18,12 +18,20 @@ import android.widget.TextView import androidx.core.animation.doOnEnd import androidx.core.animation.doOnStart import androidx.core.view.GestureDetectorCompat -import com.futo.platformplayer.logging.Logger import com.futo.platformplayer.R import com.futo.platformplayer.constructs.Event0 import com.futo.platformplayer.constructs.Event1 +import com.futo.platformplayer.logging.Logger import com.futo.platformplayer.views.others.CircularProgressBar -import kotlinx.coroutines.* +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.cancel +import kotlinx.coroutines.delay +import kotlinx.coroutines.ensureActive +import kotlinx.coroutines.isActive +import kotlinx.coroutines.launch class GestureControlView : LinearLayout { private val _scope = CoroutineScope(Dispatchers.Main); @@ -95,22 +103,23 @@ class GestureControlView : LinearLayout { if(p0 == null) return false; + val minDistance = Math.min(width, height) if (_isFullScreen && _adjustingBrightness) { - val adjustAmount = (distanceY * 2) / height; + val adjustAmount = (distanceY * 2) / minDistance; _brightnessFactor = (_brightnessFactor + adjustAmount).coerceAtLeast(0.0f).coerceAtMost(1.0f); _progressBrightness.progress = _brightnessFactor; onBrightnessAdjusted.emit(_brightnessFactor); } else if (_isFullScreen && _adjustingSound) { - val adjustAmount = (distanceY * 2) / height; + val adjustAmount = (distanceY * 2) / minDistance; _soundFactor = (_soundFactor + adjustAmount).coerceAtLeast(0.0f).coerceAtMost(1.0f); _progressSound.progress = _soundFactor; onSoundAdjusted.emit(_soundFactor); } else if (_adjustingFullscreenUp) { - val adjustAmount = (distanceY * 2) / height; + val adjustAmount = (distanceY * 2) / minDistance; _fullScreenFactorUp = (_fullScreenFactorUp + adjustAmount).coerceAtLeast(0.0f).coerceAtMost(1.0f); _layoutControlsFullscreen.alpha = _fullScreenFactorUp; } else if (_adjustingFullscreenDown) { - val adjustAmount = (-distanceY * 2) / height; + val adjustAmount = (-distanceY * 2) / minDistance; _fullScreenFactorDown = (_fullScreenFactorDown + adjustAmount).coerceAtLeast(0.0f).coerceAtMost(1.0f); _layoutControlsFullscreen.alpha = _fullScreenFactorDown; } else { diff --git a/app/src/stable/assets/sources/nebula b/app/src/stable/assets/sources/nebula index 863d0be1322660c99e4d0cdae0b45d0a5918542d..01270edbb4b6b4fb004e22fc529bf787c7f5be81 160000 --- a/app/src/stable/assets/sources/nebula +++ b/app/src/stable/assets/sources/nebula @@ -1 +1 @@ -Subproject commit 863d0be1322660c99e4d0cdae0b45d0a5918542d +Subproject commit 01270edbb4b6b4fb004e22fc529bf787c7f5be81 diff --git a/app/src/stable/assets/sources/youtube b/app/src/stable/assets/sources/youtube index d41cc8e848891ef8e949e6d49384b754e7c305c7..13551ab67fc8fb1899b5bcbfdec750855b154790 160000 --- a/app/src/stable/assets/sources/youtube +++ b/app/src/stable/assets/sources/youtube @@ -1 +1 @@ -Subproject commit d41cc8e848891ef8e949e6d49384b754e7c305c7 +Subproject commit 13551ab67fc8fb1899b5bcbfdec750855b154790