Revert dialog confirmation

This commit is contained in:
KingLucius 2024-07-19 19:23:02 +03:00
parent 7dfd726427
commit 8cbba8a146
2 changed files with 15 additions and 16 deletions

View file

@ -14,7 +14,13 @@ import android.os.Bundle
import android.provider.Settings import android.provider.Settings
import android.text.Editable import android.text.Editable
import android.text.format.DateUtils import android.text.format.DateUtils
import android.view.* 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.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
import android.view.animation.AlphaAnimation import android.view.animation.AlphaAnimation
import android.view.animation.Animation import android.view.animation.Animation
@ -46,7 +52,6 @@ import com.lagradost.cloudstream3.ui.settings.Globals.EMULATOR
import com.lagradost.cloudstream3.ui.settings.Globals.TV import com.lagradost.cloudstream3.ui.settings.Globals.TV
import com.lagradost.cloudstream3.ui.settings.Globals.isLayout import com.lagradost.cloudstream3.ui.settings.Globals.isLayout
import com.lagradost.cloudstream3.utils.AppContextUtils.isUsingMobileData import com.lagradost.cloudstream3.utils.AppContextUtils.isUsingMobileData
import com.lagradost.cloudstream3.utils.AppContextUtils.setDefaultFocus
import com.lagradost.cloudstream3.utils.DataStoreHelper import com.lagradost.cloudstream3.utils.DataStoreHelper
import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog import com.lagradost.cloudstream3.utils.SingleSelectionHelper.showDialog
import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute import com.lagradost.cloudstream3.utils.UIHelper.colorFromAttribute
@ -59,8 +64,11 @@ import com.lagradost.cloudstream3.utils.UIHelper.showSystemUI
import com.lagradost.cloudstream3.utils.UIHelper.toPx import com.lagradost.cloudstream3.utils.UIHelper.toPx
import com.lagradost.cloudstream3.utils.UserPreferenceDelegate import com.lagradost.cloudstream3.utils.UserPreferenceDelegate
import com.lagradost.cloudstream3.utils.Vector2 import com.lagradost.cloudstream3.utils.Vector2
import kotlin.math.* import kotlin.math.abs
import kotlin.system.exitProcess import kotlin.math.ceil
import kotlin.math.max
import kotlin.math.min
import kotlin.math.round
const val MINIMUM_SEEK_TIME = 7000L // when swipe seeking const val MINIMUM_SEEK_TIME = 7000L // when swipe seeking
const val MINIMUM_VERTICAL_SWIPE = 2.0f // in percentage const val MINIMUM_VERTICAL_SWIPE = 2.0f // in percentage
@ -494,17 +502,9 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
player.seekTime(1L) player.seekTime(1L)
} }
resetBtt.setOnClickListener { resetBtt.setOnClickListener {
val resetSubsBuilder: AlertDialog.Builder = AlertDialog.Builder(ctx) subtitleDelay = 0
resetSubsBuilder.setTitle(R.string.confirm_reset_subs_dialog) dialog.dismissSafe(activity)
resetSubsBuilder.apply { player.seekTime(1L)
setNegativeButton(R.string.no) { _, _ -> }
setPositiveButton(R.string.yes) { _, _ ->
subtitleDelay = 0
dialog.dismissSafe(activity)
player.seekTime(1L)
}
}
resetSubsBuilder.show().setDefaultFocus()
} }
cancelBtt.setOnClickListener { cancelBtt.setOnClickListener {
subtitleDelay = beforeOffset subtitleDelay = beforeOffset

View file

@ -677,7 +677,6 @@
<string name="action_mark_as_watched">Mark as watched</string> <string name="action_mark_as_watched">Mark as watched</string>
<string name="action_remove_from_watched">Remove from watched</string> <string name="action_remove_from_watched">Remove from watched</string>
<string name="confirm_exit_dialog">Are you sure you want to exit\?</string> <string name="confirm_exit_dialog">Are you sure you want to exit\?</string>
<string name="confirm_reset_subs_dialog">Are you sure you want to reset subtitles delay\?</string>
<string name="yes">Yes</string> <string name="yes">Yes</string>
<string name="no">No</string> <string name="no">No</string>
<string name="ok">OK</string> <string name="ok">OK</string>