From cc98e2f307047c7fc79b884750bda4cd940dc686 Mon Sep 17 00:00:00 2001 From: aayush262 Date: Tue, 12 Dec 2023 15:30:31 +0530 Subject: [PATCH] correct??? --- app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt | 6 +++--- app/src/main/java/ani/dantotsu/home/HomeFragment.kt | 6 ++++-- app/src/main/java/ani/dantotsu/home/MangaPageAdapter.kt | 5 +++-- app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt | 5 +++-- .../dantotsu/media/manga/mangareader/MangaReaderActivity.kt | 6 ++++-- app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt | 1 - 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt b/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt index fda7b6d6da..4e5b23ad74 100644 --- a/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt +++ b/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt @@ -75,9 +75,9 @@ class AnimePageAdapter : RecyclerView.Adapter("${media.id}_progressDialog") ?: true else false @@ -1164,7 +1165,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener { AlertDialog.Builder(this, R.style.MyPopup) .setTitle(getString(R.string.auto_update, media.userPreferredName)) .apply { - if (setting) { + if (incognito) { setMessage(getString(R.string.incognito_will_not_update)) } setOnCancelListener { hideSystemBars() } diff --git a/app/src/main/java/ani/dantotsu/media/manga/mangareader/MangaReaderActivity.kt b/app/src/main/java/ani/dantotsu/media/manga/mangareader/MangaReaderActivity.kt index 5d025ca193..d6d7287133 100644 --- a/app/src/main/java/ani/dantotsu/media/manga/mangareader/MangaReaderActivity.kt +++ b/app/src/main/java/ani/dantotsu/media/manga/mangareader/MangaReaderActivity.kt @@ -3,6 +3,7 @@ package ani.dantotsu.media.manga.mangareader import android.animation.ObjectAnimator import android.annotation.SuppressLint import android.app.AlertDialog +import android.content.Context import android.content.Intent import android.content.res.Configuration import android.graphics.Bitmap @@ -804,11 +805,12 @@ class MangaReaderActivity : AppCompatActivity() { saveData("${media.id}_progressDialog", isChecked) showProgressDialog = !isChecked } - val setting = loadData("incognito") ?: false + 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 (setting) { + if (incognito) { setMessage(getString(R.string.incognito_will_not_update)) } } diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index b02e23f396..c037959aa6 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt @@ -408,7 +408,6 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListen binding.settingsIncognito.setOnCheckedChangeListener { _, isChecked -> getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit() .putBoolean("incognito", isChecked).apply() - saveData("incognito", isChecked) restartApp() }