fixed vol

This commit is contained in:
LagradOst 2021-12-12 14:20:22 +01:00
parent ce8d91684f
commit 04cab02488
2 changed files with 9 additions and 7 deletions

View File

@ -26,7 +26,7 @@ class GogoanimeProvider : MainAPI() {
val qualityRegex = Regex("(\\d+)P") val qualityRegex = Regex("(\\d+)P")
} }
override val mainUrl = "https://gogoanime.vc" override val mainUrl = "https://gogoanime.wiki"
override val name = "GogoAnime" override val name = "GogoAnime"
override val hasQuickSearch = false override val hasQuickSearch = false
override val hasMainPage = true override val hasMainPage = true

View File

@ -104,9 +104,10 @@ import java.io.File
import javax.net.ssl.HttpsURLConnection import javax.net.ssl.HttpsURLConnection
import javax.net.ssl.SSLContext import javax.net.ssl.SSLContext
import javax.net.ssl.SSLSession import javax.net.ssl.SSLSession
import kotlin.concurrent.thread
import kotlin.math.abs import kotlin.math.abs
import kotlin.math.ceil import kotlin.math.ceil
import kotlin.math.max
import kotlin.math.min
import kotlin.properties.Delegates import kotlin.properties.Delegates
@ -131,6 +132,7 @@ enum class PlayerEventType(val value: Int) {
Play(1), Play(1),
SeekForward(2), SeekForward(2),
SeekBack(3), SeekBack(3),
//SkipCurrentChapter(4), //SkipCurrentChapter(4),
NextEpisode(5), NextEpisode(5),
PrevEpisode(5), PrevEpisode(5),
@ -410,7 +412,7 @@ class PlayerFragment : Fragment() {
private fun onClickChange() { private fun onClickChange() {
isShowing = !isShowing isShowing = !isShowing
if(isShowing) { if (isShowing) {
autoHide() autoHide()
} }
activity?.hideSystemUI() activity?.hideSystemUI()
@ -552,7 +554,7 @@ class PlayerFragment : Fragment() {
if (swipeVerticalEnabled) { if (swipeVerticalEnabled) {
val distanceMultiplierY = 2F val distanceMultiplierY = 2F
val distanceY = (motionEvent.rawY - currentY) * distanceMultiplierY val distanceY = (motionEvent.rawY - currentY) * distanceMultiplierY
val diffY = distanceY * 2.0 / height val diffY = distanceY * 2.0 / min(height, width)
// Forces 'smooth' moving preventing a bug where you // Forces 'smooth' moving preventing a bug where you
// can make it think it moved half a screen in a frame // can make it think it moved half a screen in a frame
@ -562,7 +564,7 @@ class PlayerFragment : Fragment() {
preventHorizontalSwipe = true preventHorizontalSwipe = true
} }
if (hasPassedVerticalSwipeThreshold) { if (hasPassedVerticalSwipeThreshold) {
if (currentX > width * 0.5) { if (currentX > max(height, width) * 0.5) {
if (audioManager != null && progressBarLeftHolder != null) { if (audioManager != null && progressBarLeftHolder != null) {
val currentVolume = val currentVolume =
audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) audioManager.getStreamVolume(AudioManager.STREAM_MUSIC)
@ -618,7 +620,7 @@ class PlayerFragment : Fragment() {
if (swipeEnabled) { if (swipeEnabled) {
val distanceMultiplierX = 2F val distanceMultiplierX = 2F
val distanceX = (motionEvent.rawX - currentX) * distanceMultiplierX val distanceX = (motionEvent.rawX - currentX) * distanceMultiplierX
val diffX = distanceX * 2.0 / width val diffX = distanceX * 2.0 / max(height, width)
if (abs(diffX - prevDiffX) > 0.5) { if (abs(diffX - prevDiffX) > 0.5) {
return return
} }
@ -1802,7 +1804,7 @@ class PlayerFragment : Fragment() {
return i return i
} }
} }
} catch (e : Exception) { } catch (e: Exception) {
return null return null
} }