From c7bc6241dc650fdf1cf94a73bc34bc7d3ba42185 Mon Sep 17 00:00:00 2001 From: aayush262 Date: Sun, 10 Dec 2023 23:42:56 +0530 Subject: [PATCH 1/5] some changes better manga title/list name view --- .../ani/dantotsu/media/anime/ExoplayerView.kt | 2 +- .../settings/PlayerSettingsActivity.kt | 2 +- .../main/res/drawable/ic_round_delete_24.xml | 2 +- app/src/main/res/layout/activity_list.xml | 14 +-- app/src/main/res/layout/item_anime_watch.xml | 2 - app/src/main/res/layout/item_chapter_list.xml | 104 ++++++++---------- 6 files changed, 52 insertions(+), 74 deletions(-) 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 f16f47efb2..c393b02a35 100644 --- a/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt +++ b/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt @@ -1101,7 +1101,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener { if (settings.cursedSpeeds) arrayOf(1f, 1.25f, 1.5f, 1.75f, 2f, 2.5f, 3f, 4f, 5f, 10f, 25f, 50f) else - arrayOf(0.25f, 0.33f, 0.5f, 0.66f, 0.75f, 1f, 1.25f, 1.33f, 1.5f, 1.66f, 1.75f, 2f) + arrayOf(0.25f, 0.33f, 0.5f, 0.66f, 0.75f, 1f, 1.15f, 1.25f, 1.33f, 1.5f, 1.66f, 1.75f, 2f) val speedsName = speeds.map { "${it}x" }.toTypedArray() var curSpeed = loadData("${media.id}_speed", this) ?: settings.defaultSpeed diff --git a/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt index ff3d704dc8..3ed493f718 100644 --- a/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt @@ -97,7 +97,7 @@ class PlayerSettingsActivity : AppCompatActivity() { val speeds = - arrayOf(0.25f, 0.33f, 0.5f, 0.66f, 0.75f, 1f, 1.25f, 1.33f, 1.5f, 1.66f, 1.75f, 2f) + arrayOf(0.25f, 0.33f, 0.5f, 0.66f, 0.75f, 1f, 1.15f, 1.25f, 1.33f, 1.5f, 1.66f, 1.75f, 2f) val cursedSpeeds = arrayOf(1f, 1.25f, 1.5f, 1.75f, 2f, 2.5f, 3f, 4f, 5f, 10f, 25f, 50f) var curSpeedArr = if (settings.cursedSpeeds) cursedSpeeds else speeds var speedsName = curSpeedArr.map { "${it}x" }.toTypedArray() diff --git a/app/src/main/res/drawable/ic_round_delete_24.xml b/app/src/main/res/drawable/ic_round_delete_24.xml index 95e9928f49..9dd59ef97d 100644 --- a/app/src/main/res/drawable/ic_round_delete_24.xml +++ b/app/src/main/res/drawable/ic_round_delete_24.xml @@ -1,4 +1,4 @@ + android:viewportWidth="24" android:width="24dp" android:tint="?attr/colorControlNormal" xmlns:android="http://schemas.android.com/apk/res/android"> diff --git a/app/src/main/res/layout/activity_list.xml b/app/src/main/res/layout/activity_list.xml index 20d3d0ab85..395c1e92c5 100644 --- a/app/src/main/res/layout/activity_list.xml +++ b/app/src/main/res/layout/activity_list.xml @@ -28,21 +28,19 @@ - - - - + + android:layout_width="match_parent" + android:layout_height="70dp" + android:orientation="horizontal" + android:gravity="center"> - - - - - + + + + - - - - + - - - \ No newline at end of file + From 31482674c0421770b654eb1932a6c4ed10acb192 Mon Sep 17 00:00:00 2001 From: aayush262 Date: Sun, 10 Dec 2023 23:47:06 +0530 Subject: [PATCH 2/5] yt icon --- app/src/main/res/layout/item_anime_watch.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/item_anime_watch.xml b/app/src/main/res/layout/item_anime_watch.xml index fc8e98c239..6d2a54c59e 100644 --- a/app/src/main/res/layout/item_anime_watch.xml +++ b/app/src/main/res/layout/item_anime_watch.xml @@ -32,6 +32,7 @@ android:fontFamily="@font/poppins_bold" app:cornerRadius="12dp" app:icon="@drawable/ic_round_play_circle_24" + android:drawableTint="@color/bg_white" tools:ignore="TextContrastCheck" /> Date: Mon, 11 Dec 2023 02:45:21 +0530 Subject: [PATCH 3/5] . --- app/src/main/res/layout/item_chapter_list.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/item_chapter_list.xml b/app/src/main/res/layout/item_chapter_list.xml index 20c3bbe93e..1cf2f09914 100644 --- a/app/src/main/res/layout/item_chapter_list.xml +++ b/app/src/main/res/layout/item_chapter_list.xml @@ -17,7 +17,7 @@ @@ -42,7 +42,6 @@ android:layout_height="48dp" android:layout_marginEnd="5dp" android:background="?android:attr/selectableItemBackground" - android:contentDescription="@string/random_selection" app:tint="?attr/colorOnBackground" app:srcCompat="@drawable/ic_round_remove_red_eye_24" /> @@ -50,8 +49,8 @@ android:id="@+id/itemDownload" android:layout_width="24dp" android:layout_height="48dp" + android:layout_marginEnd="5dp" android:background="?android:attr/selectableItemBackground" - android:contentDescription="@string/sort_by" app:tint="?attr/colorOnBackground" app:srcCompat="@drawable/ic_round_download_24" /> From 5c4e9d769615f3142c1950f5c7458d83bb6da0a7 Mon Sep 17 00:00:00 2001 From: aayush262 Date: Mon, 11 Dec 2023 21:39:23 +0530 Subject: [PATCH 4/5] Better incognito (visually) toggle for navbar in list --- .../ani/dantotsu/home/AnimePageAdapter.kt | 6 +++++ .../java/ani/dantotsu/home/HomeFragment.kt | 9 +++++++- .../ani/dantotsu/home/MangaPageAdapter.kt | 6 +++++ .../ani/dantotsu/media/anime/ExoplayerView.kt | 5 ++++- .../manga/mangareader/MangaReaderActivity.kt | 8 ++++++- .../ani/dantotsu/media/user/ListActivity.kt | 2 +- .../ani/dantotsu/settings/SettingsActivity.kt | 2 ++ .../settings/SettingsDialogFragment.kt | 16 +++----------- .../settings/UserInterfaceSettings.kt | 1 + .../settings/UserInterfaceSettingsActivity.kt | 6 +++++ .../activity_user_interface_settings.xml | 22 +++++++++++++++++++ app/src/main/res/layout/fragment_home.xml | 21 ++++++++++++++++-- app/src/main/res/layout/item_anime_page.xml | 19 ++++++++++++++++ app/src/main/res/layout/item_anime_watch.xml | 2 +- .../main/res/layout/item_custom_dialog.xml | 9 -------- app/src/main/res/layout/item_manga_page.xml | 19 ++++++++++++++++ app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/style.xml | 1 - 18 files changed, 125 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt b/app/src/main/java/ani/dantotsu/home/AnimePageAdapter.kt index 65b698606c..fda7b6d6da 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 1f3255ddad..7dbebc7798 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 17c0bf06bb..d356a551a3 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 c393b02a35..8d760641f4 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 07e355845f..5d025ca193 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 ada753a478..342a5a8f9c 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 0a42d553a1..b02e23f396 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 72e621b16b..b94490ec98 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 39dd18b180..15fd20a8b2 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 0012e6e8c3..189d691f4c 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 06904cb63e..6014252640 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 72d7648e70..f197a31831 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