wont show progress window if incognito is on
This commit is contained in:
parent
67bb28d027
commit
97eacb58a6
2 changed files with 9 additions and 16 deletions
|
@ -1210,13 +1210,10 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
val showProgressDialog =
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog")
|
||||
?: true else false
|
||||
if (showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true)
|
||||
if (!incognito && showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true)
|
||||
AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.auto_update, media.userPreferredName))
|
||||
.apply {
|
||||
if (incognito) {
|
||||
setMessage(getString(R.string.incognito_will_not_update))
|
||||
}
|
||||
setOnCancelListener { hideSystemBars() }
|
||||
setCancelable(false)
|
||||
setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
||||
|
@ -1771,7 +1768,9 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
}
|
||||
|
||||
private fun updateAniProgress() {
|
||||
if (exoPlayer.currentPosition / episodeLength > settings.watchPercentage && Anilist.userid != null)
|
||||
val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("incognito", false) ?: false
|
||||
if (!incognito && exoPlayer.currentPosition / episodeLength > settings.watchPercentage && Anilist.userid != null)
|
||||
if (loadData<Boolean>("${media.id}_save_progress") != false && if (media.isAdult) settings.updateForH else true) {
|
||||
media.anime!!.selectedEpisode?.apply {
|
||||
updateProgress(media, this)
|
||||
|
|
|
@ -142,7 +142,6 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
ThemeManager(this).applyTheme()
|
||||
binding = ActivityMangaReaderBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
binding.mangaReaderBack.setOnClickListener {
|
||||
onBackPressedDispatcher.onBackPressed()
|
||||
}
|
||||
|
@ -853,7 +852,10 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
showProgressDialog =
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog")
|
||||
?: true else false
|
||||
if (showProgressDialog) {
|
||||
val incognito =
|
||||
currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("incognito", false) ?: false
|
||||
if (showProgressDialog && !incognito) {
|
||||
|
||||
val dialogView = layoutInflater.inflate(R.layout.item_custom_dialog, null)
|
||||
val checkbox = dialogView.findViewById<CheckBox>(R.id.dialog_checkbox)
|
||||
|
@ -862,16 +864,8 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
saveData("${media.id}_progressDialog", !isChecked)
|
||||
showProgressDialog = !isChecked
|
||||
}
|
||||
val incognito =
|
||||
currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("incognito", false) ?: false
|
||||
AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.title_update_progress))
|
||||
.apply {
|
||||
if (incognito) {
|
||||
setMessage(getString(R.string.incognito_will_not_update))
|
||||
}
|
||||
}
|
||||
.setView(dialogView)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.yes)) { dialog, _ ->
|
||||
|
@ -893,7 +887,7 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
.create()
|
||||
.show()
|
||||
} else {
|
||||
if (loadData<Boolean>("${media.id}_save_progress") != false && if (media.isAdult) settings.updateForH else true)
|
||||
if (!incognito && loadData<Boolean>("${media.id}_save_progress") != false && if (media.isAdult) settings.updateForH else true)
|
||||
updateProgress(
|
||||
media,
|
||||
MangaNameAdapter.findChapterNumber(media.manga!!.selectedChapter!!)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue