From 5db541d7ccdc6e305002e2169fa84c56aa0018ab Mon Sep 17 00:00:00 2001
From: int3debug <164035730+int3debug@users.noreply.github.com>
Date: Sun, 14 Apr 2024 02:13:12 +0200
Subject: [PATCH] feat(ui): added reset button to subtitle delay (#1040)
---
.../cloudstream3/ui/player/FullScreenPlayer.kt | 14 ++++++--------
app/src/main/res/layout/subtitle_offset.xml | 7 +++++++
app/src/main/res/values/strings.xml | 1 +
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt
index 56983190..c357ce9c 100644
--- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt
+++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt
@@ -14,13 +14,7 @@ import android.os.Bundle
import android.provider.Settings
import android.text.Editable
import android.text.format.DateUtils
-import android.view.KeyEvent
-import android.view.LayoutInflater
-import android.view.MotionEvent
-import android.view.Surface
-import android.view.View
-import android.view.ViewGroup
-import android.view.WindowManager
+import android.view.*
import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
import android.view.animation.AlphaAnimation
import android.view.animation.Animation
@@ -50,7 +44,6 @@ import com.lagradost.cloudstream3.ui.settings.Globals
import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR
import com.lagradost.cloudstream3.ui.settings.Globals.TV
import com.lagradost.cloudstream3.ui.settings.Globals.isLayout
-import com.lagradost.cloudstream3.ui.settings.SettingsFragment
import com.lagradost.cloudstream3.utils.AppUtils.isUsingMobileData
import com.lagradost.cloudstream3.utils.DataStoreHelper
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
@@ -498,6 +491,11 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
dialog.dismissSafe(activity)
player.seekTime(1L)
}
+ resetBtt.setOnClickListener {
+ subtitleDelay = 0
+ dialog.dismissSafe(activity)
+ player.seekTime(1L)
+ }
cancelBtt.setOnClickListener {
subtitleDelay = beforeOffset
dialog.dismissSafe(activity)
diff --git a/app/src/main/res/layout/subtitle_offset.xml b/app/src/main/res/layout/subtitle_offset.xml
index c17c5eff..d5e303b6 100644
--- a/app/src/main/res/layout/subtitle_offset.xml
+++ b/app/src/main/res/layout/subtitle_offset.xml
@@ -113,6 +113,13 @@
+
+
Music
Audio Book
Media
+ Reset
\ No newline at end of file