From ad1734d64071f98d64147e832b1738cd567a387e Mon Sep 17 00:00:00 2001 From: Finnley Somdahl <87634197+rebelonion@users.noreply.github.com> Date: Tue, 5 Dec 2023 22:40:27 -0600 Subject: [PATCH 1/4] only one dns --- .../ani/dantotsu/settings/SettingsActivity.kt | 10 ----- app/src/main/res/layout/activity_settings.xml | 38 +------------------ 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index 55a45076b21..2f16cd8662b 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt @@ -338,16 +338,6 @@ class SettingsActivity : AppCompatActivity() { binding.settingsRecentlyListOnly.setOnCheckedChangeListener { _, isChecked -> saveData("recently_list_only", isChecked) } - - val dns = listOf("None", "Google", "Cloudflare", "AdGuard") - binding.settingsDns.setText(dns[loadData("settings_dns") ?: 0], false) - binding.settingsDns.setAdapter(ArrayAdapter(this, R.layout.item_dropdown, dns)) - binding.settingsDns.setOnItemClickListener { _, _, i, _ -> - saveData("settings_dns", i) - initializeNetwork(this) - binding.settingsDns.clearFocus() - } - binding.settingsPreferDub.isChecked = loadData("settings_prefer_dub") ?: false binding.settingsPreferDub.setOnCheckedChangeListener { _, isChecked -> saveData("settings_prefer_dub", isChecked) diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 7d53c87e9ce..849098faef6 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -706,41 +706,6 @@ android:layout_marginBottom="8dp" android:background="?android:attr/listDivider" /> - - - - - - - - - Date: Tue, 5 Dec 2023 23:43:34 -0600 Subject: [PATCH 2/4] multi fix + etc --- .../media/manga/MangaChapterAdapter.kt | 32 +++---------------- .../dantotsu/media/manga/MangaReadAdapter.kt | 2 +- .../dantotsu/media/manga/MangaReadFragment.kt | 22 ++++++++++++- .../ani/dantotsu/others/LanguageMapper.kt | 22 +++++++++++++ .../dantotsu/settings/ExtensionsActivity.kt | 19 +++++------ .../main/res/layout/activity_extensions.xml | 2 +- app/src/main/res/layout/activity_list.xml | 6 ++-- 7 files changed, 62 insertions(+), 43 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/media/manga/MangaChapterAdapter.kt b/app/src/main/java/ani/dantotsu/media/manga/MangaChapterAdapter.kt index 3d4e6d8e669..67304285ae3 100644 --- a/app/src/main/java/ani/dantotsu/media/manga/MangaChapterAdapter.kt +++ b/app/src/main/java/ani/dantotsu/media/manga/MangaChapterAdapter.kt @@ -92,6 +92,7 @@ class MangaChapterAdapter( // Find the position of the chapter and notify only that item val position = arr.indexOfFirst { it.number == chapterNumber } if (position != -1) { + arr[position].progress = "" notifyItemChanged(position) } } @@ -102,6 +103,7 @@ class MangaChapterAdapter( // Find the position of the chapter and notify only that item val position = arr.indexOfFirst { it.number == chapterNumber } if (position != -1) { + arr[position].progress = "" notifyItemChanged(position) } } @@ -116,30 +118,6 @@ class MangaChapterAdapter( } } - fun downloadNextNChapters(n: Int) { - //find last viewed chapter - var lastViewedChapter = arr.indexOfFirst { MangaNameAdapter.findChapterNumber(it.number)?.toInt() == media.userProgress } - if (lastViewedChapter == -1) { - lastViewedChapter = 0 - } - //download next n chapters - for (i in 1..n) { - if (lastViewedChapter + i < arr.size) { - val chapterNumber = arr[lastViewedChapter + i].number - if (activeDownloads.contains(chapterNumber)) { - //do nothing - continue - } else if (downloadedChapters.contains(chapterNumber)) { - //do nothing - continue - } else { - fragment.onMangaChapterDownloadClick(chapterNumber) - startDownload(chapterNumber) - } - } - } - } - fun downloadNChaptersFrom(position: Int, n: Int) { //download next n chapters for (i in 0..) { + val selected = model.loadSelected(media) + selected.scanlators = list + model.saveSelected(media.id, selected, requireActivity()) + media.selected = selected + } fun loadChapters(i: Int, invalidate: Boolean) { lifecycleScope.launch(Dispatchers.IO) { model.loadMangaChapters(media, i, invalidate) } diff --git a/app/src/main/java/ani/dantotsu/others/LanguageMapper.kt b/app/src/main/java/ani/dantotsu/others/LanguageMapper.kt index bd621cb070e..25f8f6a4816 100644 --- a/app/src/main/java/ani/dantotsu/others/LanguageMapper.kt +++ b/app/src/main/java/ani/dantotsu/others/LanguageMapper.kt @@ -27,6 +27,28 @@ class LanguageMapper { else -> "" } } + + enum class Language(val code: String) { + ALL("all"), + ARABIC("ar"), + GERMAN("de"), + ENGLISH("en"), + SPANISH("es"), + FRENCH("fr"), + INDONESIAN("id"), + ITALIAN("it"), + JAPANESE("ja"), + KOREAN("ko"), + POLISH("pl"), + PORTUGUESE_BRAZIL("pt-BR"), + RUSSIAN("ru"), + THAI("th"), + TURKISH("tr"), + UKRAINIAN("uk"), + VIETNAMESE("vi"), + CHINESE("zh"), + CHINESE_SIMPLIFIED("zh-Hans") + } } } diff --git a/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt b/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt index c733319fc56..32e3a7e7f53 100644 --- a/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/ExtensionsActivity.kt @@ -21,7 +21,6 @@ import ani.dantotsu.others.LangSet import ani.dantotsu.themes.ThemeManager import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayoutMediator -import eu.kanade.tachiyomi.extension.anime.model.AnimeExtension class ExtensionsActivity : AppCompatActivity() { private val restartMainActivity = object : OnBackPressedCallback(false) { @@ -120,15 +119,17 @@ class ExtensionsActivity : AppCompatActivity() { initActivity(this) - - fun bind(extension: AnimeExtension.Available) { - binding.languageselect.setOnClickListener { - val popup = PopupMenu(this, it) - - popup.inflate(R.menu.launguage_selector_menu) - popup.show() +/* TODO + binding.languageselect.setOnClickListener { + val popup = PopupMenu(this, it) + popup.inflate(R.menu.launguage_selector_menu) + popup.setOnMenuItemClickListener { menuItem -> + true } - } + popup.setOnDismissListener { + } + popup.show() + }*/ binding.settingsContainer.updateLayoutParams { topMargin = statusBarHeight bottomMargin = navBarHeight diff --git a/app/src/main/res/layout/activity_extensions.xml b/app/src/main/res/layout/activity_extensions.xml index 19d12fb89a1..85a8db879b3 100644 --- a/app/src/main/res/layout/activity_extensions.xml +++ b/app/src/main/res/layout/activity_extensions.xml @@ -48,8 +48,8 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" /> - Date: Wed, 6 Dec 2023 00:30:43 -0600 Subject: [PATCH 3/4] why was this here? --- app/src/main/java/ani/dantotsu/others/AppUpdater.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/ani/dantotsu/others/AppUpdater.kt b/app/src/main/java/ani/dantotsu/others/AppUpdater.kt index b753e908cd5..eea658e02f0 100644 --- a/app/src/main/java/ani/dantotsu/others/AppUpdater.kt +++ b/app/src/main/java/ani/dantotsu/others/AppUpdater.kt @@ -24,7 +24,6 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonArray import kotlinx.serialization.json.decodeFromJsonElement -import rx.android.BuildConfig import java.io.File import java.text.SimpleDateFormat import java.util.* From 97a4cba68029b0ebeaf6e7eeb752c38dd3095adf Mon Sep 17 00:00:00 2001 From: Finnley Somdahl <87634197+rebelonion@users.noreply.github.com> Date: Wed, 6 Dec 2023 00:31:59 -0600 Subject: [PATCH 4/4] v2 --- app/build.gradle | 2 +- .../ani/dantotsu/settings/SettingsActivity.kt | 5 +++- stable.md | 25 +++++++++++++++---- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eb978148560..240a28a1ff0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -21,7 +21,7 @@ android { minSdk 23 targetSdk 34 versionCode ((System.currentTimeMillis() / 60000).toInteger()) - versionName "1.0.0-beta03i-2" + versionName "2.0.0" signingConfig signingConfigs.debug } diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index 2f16cd8662b..6d1e70df0bb 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt @@ -199,6 +199,7 @@ class SettingsActivity : AppCompatActivity() { passedColor = color linearLayout.setBackgroundColor(color) }) + alertDialog.show() alertDialog.window?.setDimAmount(0.8f) } @@ -536,7 +537,9 @@ class SettingsActivity : AppCompatActivity() { cursedCounter++ (binding.settingsLogo.drawable as Animatable).start() if (cursedCounter % 7 == 0) { - snackString("youwu have been cuwsed :pwayge:") + Toast.makeText(this, "youwu have been cuwsed :pwayge:", Toast.LENGTH_LONG).show() + val url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" + openLinkInBrowser(url) getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit().putBoolean( "use_cursed_lang", getSharedPreferences( diff --git a/stable.md b/stable.md index b9c4a61a9d4..b232c694bd2 100644 --- a/stable.md +++ b/stable.md @@ -1,10 +1,25 @@ -# 1.0.0 +# 2.0.0 + +- **New Features:** + - Novel Support + - Offline support for manga and novels + - Filter anime/manga by language + - Filter manga by scanlator + - Many new theme options + - Saikou theme + - Random anime/manga selector from lists + - Incognito mode (sus) + - Various UI uplifts + - Many small features (see beta changelogs) + - New easter egg :3 - **Bugfixes:** - - Fixed extension page hiding icons on first install + - Discord RPC fix + - Many source fixes - Various bug/crash fixes - - Fixes for monochrome theme - General theme tweaks + - Ability to disable hold-to-fast-forward in videos (caused issues for some users) + - Many small bug fixes (see beta changelogs) -- **New Features:** - - added oled variant to all themes \ No newline at end of file +- **Like what you see?** + - Consider supporting me on [Github](https://github.com/sponsors/rebelonion) or [Buy Me a Coffee](https://www.buymeacoffee.com/rebelonion)! \ No newline at end of file