mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-10-26 16:45:26 +00:00
Merge pull request #213 from jorritsmit/reduce_gesture_detection_area
Do not detect gestures in top of screen
This commit is contained in:
2 files changed
+6
No files matched your search
@@ -30,6 +30,7 @@ import org.jellyfin.mobile.utils.*
|
||||
import org.jellyfin.mobile.utils.Constants.DEFAULT_CENTER_OVERLAY_TIMEOUT_MS
|
||||
import org.jellyfin.mobile.utils.Constants.DEFAULT_CONTROLS_TIMEOUT_MS
|
||||
import org.jellyfin.mobile.utils.Constants.DEFAULT_SEEK_TIME_MS
|
||||
import org.jellyfin.mobile.utils.Constants.GESTURE_EXCLUSION_AREA_TOP
|
||||
import org.koin.android.ext.android.inject
|
||||
import timber.log.Timber
|
||||
import kotlin.math.abs
|
||||
@@ -280,6 +281,10 @@ class PlayerFragment : Fragment() {
|
||||
if (!swipeGesturesEnabled)
|
||||
return false
|
||||
|
||||
// Check whether swipe was started in excluded region
|
||||
if (firstEvent.y < GESTURE_EXCLUSION_AREA_TOP * resources.displayMetrics.density)
|
||||
return false
|
||||
|
||||
// Check whether swipe was oriented vertically
|
||||
if (abs(distanceY / distanceX) < 2)
|
||||
return false
|
||||
|
||||
@@ -82,6 +82,7 @@ object Constants {
|
||||
const val TICKS_PER_MILLISECOND = 10000
|
||||
const val PLAYER_TIME_UPDATE_RATE = 3000L
|
||||
const val DEFAULT_CONTROLS_TIMEOUT_MS = 2500
|
||||
const val GESTURE_EXCLUSION_AREA_TOP = 48
|
||||
const val DEFAULT_CENTER_OVERLAY_TIMEOUT_MS = 250
|
||||
const val DEFAULT_SEEK_TIME_MS = 5000L
|
||||
const val SUPPORTED_VIDEO_PLAYER_PLAYBACK_ACTIONS: Long = PlaybackState.ACTION_PLAY_PAUSE or
|
||||
|
||||
Reference in new issue
Block a user