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/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", "") 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/java/ani/dantotsu/settings/SettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/SettingsActivity.kt index 44c8ac67..b9aed382 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 @@ -457,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) @@ -695,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) { @@ -712,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 { @@ -873,11 +878,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 +892,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 +902,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" /> 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.