diff --git a/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt b/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt index 65b698606c7..fda7b6d6da5 100644 --- a/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt +++ b/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt @@ -76,6 +76,12 @@ class AnimePageAdapter : RecyclerView.Adapter { diff --git a/app/src/main/java/ani/dantotsu/home/HomeFragment.kt b/app/src/main/java/ani/dantotsu/home/HomeFragment.kt index 1f3255ddada..7dbebc77983 100644 --- a/app/src/main/java/ani/dantotsu/home/HomeFragment.kt +++ b/app/src/main/java/ani/dantotsu/home/HomeFragment.kt @@ -1,6 +1,8 @@ package ani.dantotsu.home import android.animation.ObjectAnimator +import android.content.Context +import android.content.ContextWrapper import android.content.Intent import android.graphics.drawable.Animatable import android.os.Build @@ -71,6 +73,7 @@ class HomeFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { val scope = lifecycleScope var uiSettings = loadData("ui_settings") ?: UserInterfaceSettings() + fun load() { if (activity != null && _binding != null) lifecycleScope.launch(Dispatchers.Main) { binding.homeUserName.text = Anilist.username @@ -111,7 +114,11 @@ class HomeFragment : Fragment() { snackString(currContext()?.getString(R.string.please_reload)) } } - + val settings = loadData("incognito") ?: false + if(settings) { + binding.incognitoTextView.visibility = View.VISIBLE + binding.incognitoView.visibility = View.VISIBLE + } binding.homeUserAvatarContainer.setSafeOnClickListener { val dialogFragment = SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.HOME) diff --git a/app/src/main/java/ani/dantotsu/home/MangaPageAdapter.kt b/app/src/main/java/ani/dantotsu/home/MangaPageAdapter.kt index 17c0bf06bb1..d356a551a3c 100644 --- a/app/src/main/java/ani/dantotsu/home/MangaPageAdapter.kt +++ b/app/src/main/java/ani/dantotsu/home/MangaPageAdapter.kt @@ -75,6 +75,12 @@ class MangaPageAdapter : RecyclerView.Adapter { diff --git a/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt b/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt index c393b02a351..8d760641f46 100644 --- a/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt +++ b/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt @@ -1156,14 +1156,17 @@ class ExoplayerView : AppCompatActivity(), Player.Listener { } preloading = false + val setting = loadData("incognito") ?: false val showProgressDialog = if (settings.askIndividual) loadData("${media.id}_progressDialog") ?: true else false if (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)) - .setMessage(getString(R.string.incognito_will_not_update)) .apply { + if (setting) { + setMessage(getString(R.string.incognito_will_not_update)) + } setOnCancelListener { hideSystemBars() } setCancelable(false) setPositiveButton(getString(R.string.yes)) { dialog, _ -> 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 07e355845f5..5d025ca193f 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 @@ -796,6 +796,7 @@ class MangaReaderActivity : AppCompatActivity() { private fun progress(runnable: Runnable) { if (maxChapterPage - currentChapterPage <= 1 && Anilist.userid != null) { if (showProgressDialog) { + val dialogView = layoutInflater.inflate(R.layout.item_custom_dialog, null) val checkbox = dialogView.findViewById(R.id.dialog_checkbox) checkbox.text = getString(R.string.dont_ask_again, media.userPreferredName) @@ -803,9 +804,14 @@ class MangaReaderActivity : AppCompatActivity() { saveData("${media.id}_progressDialog", isChecked) showProgressDialog = !isChecked } - + val setting = loadData("incognito") ?: false AlertDialog.Builder(this, R.style.MyPopup) .setTitle(getString(R.string.title_update_progress)) + .apply { + if (setting) { + setMessage(getString(R.string.incognito_will_not_update)) + } + } .setView(dialogView) .setCancelable(false) .setPositiveButton(getString(R.string.yes)) { dialog, _ -> diff --git a/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt b/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt index ada753a478e..342a5a8f9cd 100644 --- a/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt +++ b/app/src/main/java/ani/dantotsu/media/user/ListActivity.kt @@ -62,7 +62,7 @@ class ListActivity : AppCompatActivity() { binding.listTabLayout.setTabTextColors(secondaryTextColor, primaryTextColor) binding.listTabLayout.setSelectedTabIndicatorColor(primaryTextColor) val uiSettings = loadData("ui_settings") ?: UserInterfaceSettings() - if (!uiSettings.immersiveMode) { + if (!uiSettings.immersiveModeList) { this.window.statusBarColor = ContextCompat.getColor(this, R.color.nav_bg_inv) binding.root.fitsSystemWindows = true diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index 0a42d553a1b..b02e23f3964 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt @@ -408,6 +408,8 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListen binding.settingsIncognito.setOnCheckedChangeListener { _, isChecked -> getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit() .putBoolean("incognito", isChecked).apply() + saveData("incognito", isChecked) + restartApp() } var previousStart: View = when (uiSettings.defaultStartUpTab) { diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsDialogFragment.kt b/app/src/main/java/ani/dantotsu/settings/SettingsDialogFragment.kt index 72e621b16b5..b94490ec982 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsDialogFragment.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsDialogFragment.kt @@ -113,19 +113,9 @@ class SettingsDialogFragment() : BottomSheetDialogFragment() { } PageType.HOME -> { - try { - val arrayOfFiles = - ContextCompat.getExternalFilesDirs(requireContext(), null) - startActivity( - if (loadData("sd_dl") == true && arrayOfFiles.size > 1 && arrayOfFiles[0] != null && arrayOfFiles[1] != null) { - val parentDirectory = arrayOfFiles[1].toString() - val intent = Intent(Intent.ACTION_VIEW) - intent.setDataAndType(Uri.parse(parentDirectory), "resource/folder") - } else Intent(DownloadManager.ACTION_VIEW_DOWNLOADS) - ) - } catch (e: ActivityNotFoundException) { - toast(getString(R.string.file_manager_not_found)) - } + val intent = Intent(activity, DownloadContainerActivity::class.java) + intent.putExtra("FRAGMENT_CLASS_NAME", OfflineMangaFragment::class.java.name) + startActivity(intent) } } diff --git a/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettings.kt b/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettings.kt index 39dd18b1800..15fd20a8b22 100644 --- a/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettings.kt +++ b/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettings.kt @@ -10,6 +10,7 @@ data class UserInterfaceSettings( //App var immersiveMode: Boolean = false, + var immersiveModeList: Boolean = false, var smallView: Boolean = true, var defaultStartUpTab: Int = 1, var homeLayoutShow: MutableList = mutableListOf( diff --git a/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettingsActivity.kt index 0012e6e8c32..189d691f4c8 100644 --- a/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/UserInterfaceSettingsActivity.kt @@ -68,6 +68,12 @@ class UserInterfaceSettingsActivity : AppCompatActivity() { saveData(ui, settings) restartApp() } + binding.uiSettingsImmersiveList.isChecked = settings.immersiveModeList + binding.uiSettingsImmersiveList.setOnCheckedChangeListener { _, isChecked -> + settings.immersiveModeList = isChecked + saveData(ui, settings) + restartApp() + } binding.uiSettingsBannerAnimation.isChecked = settings.bannerAnimations binding.uiSettingsBannerAnimation.setOnCheckedChangeListener { _, isChecked -> diff --git a/app/src/main/res/layout/activity_user_interface_settings.xml b/app/src/main/res/layout/activity_user_interface_settings.xml index 06904cb63e1..60142526409 100644 --- a/app/src/main/res/layout/activity_user_interface_settings.xml +++ b/app/src/main/res/layout/activity_user_interface_settings.xml @@ -121,6 +121,28 @@ + + + - + + + - + + - - + + App Hide Status Bar + Hide Status Bar for list Requires App restart to fully apply. Show/Hide Layouts on Home diff --git a/app/src/main/res/values/style.xml b/app/src/main/res/values/style.xml index 72d7648e702..f197a318312 100644 --- a/app/src/main/res/values/style.xml +++ b/app/src/main/res/values/style.xml @@ -67,7 +67,6 @@ true true false - 14sp