mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-29 01:29:02 +03:00
Minor bug fixes (#652)
* fix mpv external not marking as watched * fix player always unpausing after seeking * fix skip intro not leading to control fade * add swipe behavior to system bars * adjusted double tap play/pause size
This commit is contained in:
parent
60f3b9fff6
commit
d8c2c17631
5 changed files with 9 additions and 5 deletions
|
@ -224,7 +224,7 @@ class ExternalIntents(val anime: Anime, val source: AnimeSource) {
|
|||
}
|
||||
}
|
||||
launchIO {
|
||||
if (cause == "playback_completion") {
|
||||
if (cause == "playback_completion" || (currentPosition == duration && duration == 0L)) {
|
||||
saveEpisodeProgress(currentExtEpisode, anime, currentExtEpisode.totalSeconds, currentExtEpisode.totalSeconds)
|
||||
} else {
|
||||
saveEpisodeProgress(currentExtEpisode, anime, currentPosition, duration)
|
||||
|
|
|
@ -615,6 +615,7 @@ class PlayerActivity :
|
|||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
||||
View.SYSTEM_UI_FLAG_LOW_PROFILE
|
||||
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
|
||||
windowInsetsController.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && preferences.playerFullscreen()) {
|
||||
window.attributes.layoutInDisplayCutoutMode =
|
||||
|
@ -1036,6 +1037,7 @@ class PlayerActivity :
|
|||
@Suppress("UNUSED_PARAMETER")
|
||||
fun skipIntro(view: View) {
|
||||
doubleTapSeek(preferences.introLengthPreference(), isDoubleTap = false)
|
||||
playerControls.resetControlsFade()
|
||||
}
|
||||
|
||||
private fun refreshUi() {
|
||||
|
|
|
@ -69,6 +69,7 @@ class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: Attr
|
|||
}
|
||||
|
||||
private var showControls = false
|
||||
private var wasPausedBeforeSeeking = false
|
||||
|
||||
private val nonSeekViewRunnable = Runnable {
|
||||
binding.topControlsGroup.isVisible = true
|
||||
|
@ -78,7 +79,7 @@ class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: Attr
|
|||
|
||||
private val hideUiForSeekRunnable = Runnable {
|
||||
shouldHideUiForSeek = false
|
||||
activity.player.paused = false
|
||||
activity.player.paused = wasPausedBeforeSeeking
|
||||
if (showControls) {
|
||||
AnimationUtils.loadAnimation(activity, R.anim.fade_in_medium).also { fadeAnimation ->
|
||||
binding.topControlsGroup.startAnimation(fadeAnimation)
|
||||
|
@ -103,6 +104,7 @@ class PlayerControlsView @JvmOverloads constructor(context: Context, attrs: Attr
|
|||
animationHandler.removeCallbacks(hideUiForSeekRunnable)
|
||||
|
||||
if (!(binding.topControlsGroup.visibility == INVISIBLE && binding.middleControlsGroup.visibility == INVISIBLE && binding.bottomControlsGroup.visibility == INVISIBLE)) {
|
||||
wasPausedBeforeSeeking = activity.player.paused!!
|
||||
showControls = binding.controlsView.isVisible
|
||||
binding.topControlsGroup.visibility = INVISIBLE
|
||||
binding.middleControlsGroup.visibility = INVISIBLE
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
<gradient android:startColor="#000000"
|
||||
android:endColor="#20FFFFFF"
|
||||
android:type="radial"
|
||||
android:gradientRadius="80dp" />
|
||||
android:gradientRadius="100dp" />
|
||||
</shape>
|
|
@ -121,8 +121,8 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/playPauseView"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:contentDescription="Play/Pause"
|
||||
android:background="@drawable/ic_play_pause_bg"
|
||||
|
|
Loading…
Reference in a new issue