From f088b90964887c476e3aa63e67fb344387b990f6 Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:15:29 -0600 Subject: [PATCH 1/4] fix: ignore fdroid builds in beta --- app/src/google/java/ani/dantotsu/others/AppUpdater.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/google/java/ani/dantotsu/others/AppUpdater.kt b/app/src/google/java/ani/dantotsu/others/AppUpdater.kt index 3c64edbe..153cf970 100644 --- a/app/src/google/java/ani/dantotsu/others/AppUpdater.kt +++ b/app/src/google/java/ani/dantotsu/others/AppUpdater.kt @@ -39,7 +39,7 @@ object AppUpdater { .parsed().map { Mapper.json.decodeFromJsonElement(it) } - val r = res.filter { it.prerelease }.maxByOrNull { + val r = res.filter { it.prerelease }.filter { !it.tagName.contains("fdroid") }.maxByOrNull { it.timeStamp() } ?: throw Exception("No Pre Release Found") val v = r.tagName.substringAfter("v", "") From 22e687b9d8db80075bbbbff8ceb0d27d7c884e4e Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:15:51 -0600 Subject: [PATCH 2/4] feat: add more helpers/developers --- app/build.gradle | 2 +- .../settings/DevelopersDialogFragment.kt | 30 +++++++++++++++---- app/src/main/res/values/strings.xml | 2 +- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cdf6652a..89eafa1b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,7 +51,7 @@ android { applicationIdSuffix ".beta" versionNameSuffix "-beta01" manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher_beta", icon_placeholder_round: "@mipmap/ic_launcher_beta_round"] - debuggable System.getenv("CI") == null + debuggable false } release { manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher", icon_placeholder_round: "@mipmap/ic_launcher_round"] diff --git a/app/src/main/java/ani/dantotsu/settings/DevelopersDialogFragment.kt b/app/src/main/java/ani/dantotsu/settings/DevelopersDialogFragment.kt index 68542836..b7a12ad1 100644 --- a/app/src/main/java/ani/dantotsu/settings/DevelopersDialogFragment.kt +++ b/app/src/main/java/ani/dantotsu/settings/DevelopersDialogFragment.kt @@ -19,24 +19,42 @@ class DevelopersDialogFragment : BottomSheetDialogFragment() { "Owner and Maintainer", "https://github.com/rebelonion" ), - Developer( - "Wai What", - "https://avatars.githubusercontent.com/u/149729762?v=4", - "Icon Designer", - "https://github.com/WaiWhat" - ), Developer( "Aayush262", "https://avatars.githubusercontent.com/u/99584765?v=4", "Contributor", "https://github.com/aayush2622" ), + Developer( + "Sadwhy", + "https://avatars.githubusercontent.com/u/99601717?v=4", + "Contributor", + "https://github.com/Sadwhy" + ), + Developer( + "Wai What", + "https://avatars.githubusercontent.com/u/149729762?v=4", + "Icon Designer", + "https://github.com/WaiWhat" + ), Developer( "MarshMeadow", "https://avatars.githubusercontent.com/u/88599122?v=4", "Beta Icon Designer", "https://github.com/MarshMeadow?tab=repositories" ), + Developer( + "Zaxx69", + "https://avatars.githubusercontent.com/u/138523882?v=4", + "Telegram Admin", + "https://github.com/Zaxx69" + ), + Developer( + "Arif Alam", + "https://avatars.githubusercontent.com/u/70383209?v=4", + "Head Discord Moderator", + "https://youtube.com/watch?v=dQw4w9WgXcQ" + ), ) override fun onCreateView( diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index dbb63dc4..0bf5aad7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -175,7 +175,7 @@ UI Settings About " Dantotsu is crafted from the ashes of Saikou and based on simplistic yet state-of-the-art elegance. It is an Anilist only client, which also lets you stream-download Anime through extensions & Manga.\nDantotsu literally means the \"best of the best\" in japanese. Well, we would like to say this is the best open source app for anime and manga on Android, what would you say?" - Developers + Developers/Helpers Disclaimer - Dantotsu by itself only provides an anime and manga tracker and does not provide any anime or manga streaming or downloading capabilities. From 0225b28fea7f97dde8ee08ce4595752f941dee0a Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:38:41 -0600 Subject: [PATCH 3/4] fix: hitting enter on password input continues --- .../ani/dantotsu/settings/SettingsActivity.kt | 38 +++++++++++++------ app/src/main/res/layout/dialog_user_agent.xml | 1 + 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index 44c8ac67..92781528 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt @@ -14,6 +14,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.view.inputmethod.EditorInfo import android.widget.ArrayAdapter import android.widget.TextView import android.widget.Toast @@ -873,11 +874,9 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene // Inflate the dialog layout val dialogView = LayoutInflater.from(this).inflate(R.layout.dialog_user_agent, null) - dialogView.findViewById(R.id.userAgentTextBox)?.hint = "Password" - val subtitleTextView = dialogView.findViewById(R.id.subtitle) - subtitleTextView?.visibility = View.VISIBLE - if (!isExporting) - subtitleTextView?.text = "Enter your password to decrypt the file" + val box = dialogView.findViewById(R.id.userAgentTextBox) + box?.hint = "Password" + box?.setSingleLine() val dialog = AlertDialog.Builder(this, R.style.MyPopup) .setTitle("Enter Password") @@ -889,12 +888,7 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene callback(null) } .create() - - dialog.window?.setDimAmount(0.8f) - dialog.show() - - // Override the positive button here - dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { + fun handleOkAction() { val editText = dialog.findViewById(R.id.userAgentTextBox) if (editText?.text?.isNotBlank() == true) { editText.text?.toString()?.trim()?.toCharArray(password) @@ -904,6 +898,28 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene toast("Password cannot be empty") } } + box?.setOnEditorActionListener { _, actionId, _ -> + if (actionId == EditorInfo.IME_ACTION_DONE) { + handleOkAction() + true + } else { + false + } + } + val subtitleTextView = dialogView.findViewById(R.id.subtitle) + subtitleTextView?.visibility = View.VISIBLE + if (!isExporting) + subtitleTextView?.text = "Enter your password to decrypt the file" + + + dialog.window?.setDimAmount(0.8f) + dialog.show() + + // Override the positive button here + dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { + handleOkAction() + } + } diff --git a/app/src/main/res/layout/dialog_user_agent.xml b/app/src/main/res/layout/dialog_user_agent.xml index 250c30c4..61cb3e95 100644 --- a/app/src/main/res/layout/dialog_user_agent.xml +++ b/app/src/main/res/layout/dialog_user_agent.xml @@ -25,6 +25,7 @@ app:boxCornerRadiusBottomStart="8dp" app:boxCornerRadiusTopEnd="8dp" app:boxCornerRadiusTopStart="8dp" + android:imeOptions="actionDone" app:hintAnimationEnabled="true" /> From 83c07467a921ee0b0f0aaa630b34b95b45091609 Mon Sep 17 00:00:00 2001 From: rebelonion <87634197+rebelonion@users.noreply.github.com> Date: Thu, 8 Feb 2024 08:54:10 -0600 Subject: [PATCH 4/4] fix: disable some buttons on fdroid build --- .../ani/dantotsu/settings/SettingsActivity.kt | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index 92781528..b9aed382 100644 --- a/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt @@ -458,11 +458,6 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene binding.settingsRecentlyListOnly.setOnCheckedChangeListener { _, isChecked -> PrefManager.setVal(PrefName.RecentlyListOnly, isChecked) } - binding.settingsShareUsername.isChecked = PrefManager.getVal(PrefName.SharedUserID) - binding.settingsShareUsername.setOnCheckedChangeListener { _, isChecked -> - PrefManager.setVal(PrefName.SharedUserID, isChecked) - } - binding.settingsPreferDub.isChecked = PrefManager.getVal(PrefName.SettingsPreferDub) binding.settingsPreferDub.setOnCheckedChangeListener { _, isChecked -> PrefManager.setVal(PrefName.SettingsPreferDub, isChecked) @@ -696,15 +691,6 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene openSettings(this, null) } - - binding.settingsCheckUpdate.isChecked = PrefManager.getVal(PrefName.CheckUpdate) - binding.settingsCheckUpdate.setOnCheckedChangeListener { _, isChecked -> - PrefManager.setVal(PrefName.CheckUpdate, isChecked) - if (!isChecked) { - snackString(getString(R.string.long_click_to_check_update)) - } - } - if (!BuildConfig.FLAVOR.contains("fdroid")) { binding.settingsLogo.setOnLongClickListener { lifecycleScope.launch(Dispatchers.IO) { @@ -713,15 +699,33 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene true } + binding.settingsCheckUpdate.isChecked = PrefManager.getVal(PrefName.CheckUpdate) + binding.settingsCheckUpdate.setOnCheckedChangeListener { _, isChecked -> + PrefManager.setVal(PrefName.CheckUpdate, isChecked) + if (!isChecked) { + snackString(getString(R.string.long_click_to_check_update)) + } + } + binding.settingsCheckUpdate.setOnLongClickListener { lifecycleScope.launch(Dispatchers.IO) { AppUpdater.check(this@SettingsActivity, true) } true } + + binding.settingsShareUsername.isChecked = PrefManager.getVal(PrefName.SharedUserID) + binding.settingsShareUsername.setOnCheckedChangeListener { _, isChecked -> + PrefManager.setVal(PrefName.SharedUserID, isChecked) + } + } else { binding.settingsCheckUpdate.visibility = View.GONE binding.settingsShareUsername.visibility = View.GONE + binding.settingsCheckUpdate.isEnabled = false + binding.settingsShareUsername.isEnabled = false + binding.settingsCheckUpdate.isChecked = false + binding.settingsShareUsername.isChecked = false } binding.settingsAccountHelp.setOnClickListener {