Compare commits

...

6 Commits

Author SHA1 Message Date
rebel onion
d778cd4350 Merge pull request #187 from rebelonion/dev
Dev
2024-02-08 09:56:12 -06:00
rebelonion
83c07467a9 fix: disable some buttons on fdroid build 2024-02-08 08:54:10 -06:00
rebelonion
0225b28fea fix: hitting enter on password input continues 2024-02-08 08:38:41 -06:00
rebelonion
1e2a740dae Merge branch 'dev' of https://github.com/rebelonion/Dantotsu into dev 2024-02-08 08:15:53 -06:00
rebelonion
22e687b9d8 feat: add more helpers/developers 2024-02-08 08:15:51 -06:00
rebelonion
f088b90964 fix: ignore fdroid builds in beta 2024-02-08 08:15:29 -06:00
6 changed files with 73 additions and 34 deletions

View File

@@ -51,7 +51,7 @@ android {
applicationIdSuffix ".beta" applicationIdSuffix ".beta"
versionNameSuffix "-beta01" versionNameSuffix "-beta01"
manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher_beta", icon_placeholder_round: "@mipmap/ic_launcher_beta_round"] manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher_beta", icon_placeholder_round: "@mipmap/ic_launcher_beta_round"]
debuggable System.getenv("CI") == null debuggable false
} }
release { release {
manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher", icon_placeholder_round: "@mipmap/ic_launcher_round"] manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher", icon_placeholder_round: "@mipmap/ic_launcher_round"]

View File

@@ -39,7 +39,7 @@ object AppUpdater {
.parsed<JsonArray>().map { .parsed<JsonArray>().map {
Mapper.json.decodeFromJsonElement<GithubResponse>(it) Mapper.json.decodeFromJsonElement<GithubResponse>(it)
} }
val r = res.filter { it.prerelease }.maxByOrNull { val r = res.filter { it.prerelease }.filter { !it.tagName.contains("fdroid") }.maxByOrNull {
it.timeStamp() it.timeStamp()
} ?: throw Exception("No Pre Release Found") } ?: throw Exception("No Pre Release Found")
val v = r.tagName.substringAfter("v", "") val v = r.tagName.substringAfter("v", "")

View File

@@ -19,24 +19,42 @@ class DevelopersDialogFragment : BottomSheetDialogFragment() {
"Owner and Maintainer", "Owner and Maintainer",
"https://github.com/rebelonion" "https://github.com/rebelonion"
), ),
Developer(
"Wai What",
"https://avatars.githubusercontent.com/u/149729762?v=4",
"Icon Designer",
"https://github.com/WaiWhat"
),
Developer( Developer(
"Aayush262", "Aayush262",
"https://avatars.githubusercontent.com/u/99584765?v=4", "https://avatars.githubusercontent.com/u/99584765?v=4",
"Contributor", "Contributor",
"https://github.com/aayush2622" "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( Developer(
"MarshMeadow", "MarshMeadow",
"https://avatars.githubusercontent.com/u/88599122?v=4", "https://avatars.githubusercontent.com/u/88599122?v=4",
"Beta Icon Designer", "Beta Icon Designer",
"https://github.com/MarshMeadow?tab=repositories" "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( override fun onCreateView(

View File

@@ -14,6 +14,7 @@ import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.widget.ArrayAdapter import android.widget.ArrayAdapter
import android.widget.TextView import android.widget.TextView
import android.widget.Toast import android.widget.Toast
@@ -457,11 +458,6 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
binding.settingsRecentlyListOnly.setOnCheckedChangeListener { _, isChecked -> binding.settingsRecentlyListOnly.setOnCheckedChangeListener { _, isChecked ->
PrefManager.setVal(PrefName.RecentlyListOnly, 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.isChecked = PrefManager.getVal(PrefName.SettingsPreferDub)
binding.settingsPreferDub.setOnCheckedChangeListener { _, isChecked -> binding.settingsPreferDub.setOnCheckedChangeListener { _, isChecked ->
PrefManager.setVal(PrefName.SettingsPreferDub, isChecked) PrefManager.setVal(PrefName.SettingsPreferDub, isChecked)
@@ -695,15 +691,6 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
openSettings(this, null) 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")) { if (!BuildConfig.FLAVOR.contains("fdroid")) {
binding.settingsLogo.setOnLongClickListener { binding.settingsLogo.setOnLongClickListener {
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
@@ -712,15 +699,33 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
true 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 { binding.settingsCheckUpdate.setOnLongClickListener {
lifecycleScope.launch(Dispatchers.IO) { lifecycleScope.launch(Dispatchers.IO) {
AppUpdater.check(this@SettingsActivity, true) AppUpdater.check(this@SettingsActivity, true)
} }
true true
} }
binding.settingsShareUsername.isChecked = PrefManager.getVal(PrefName.SharedUserID)
binding.settingsShareUsername.setOnCheckedChangeListener { _, isChecked ->
PrefManager.setVal(PrefName.SharedUserID, isChecked)
}
} else { } else {
binding.settingsCheckUpdate.visibility = View.GONE binding.settingsCheckUpdate.visibility = View.GONE
binding.settingsShareUsername.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 { binding.settingsAccountHelp.setOnClickListener {
@@ -873,11 +878,9 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
// Inflate the dialog layout // Inflate the dialog layout
val dialogView = LayoutInflater.from(this).inflate(R.layout.dialog_user_agent, null) val dialogView = LayoutInflater.from(this).inflate(R.layout.dialog_user_agent, null)
dialogView.findViewById<TextInputEditText>(R.id.userAgentTextBox)?.hint = "Password" val box = dialogView.findViewById<TextInputEditText>(R.id.userAgentTextBox)
val subtitleTextView = dialogView.findViewById<TextView>(R.id.subtitle) box?.hint = "Password"
subtitleTextView?.visibility = View.VISIBLE box?.setSingleLine()
if (!isExporting)
subtitleTextView?.text = "Enter your password to decrypt the file"
val dialog = AlertDialog.Builder(this, R.style.MyPopup) val dialog = AlertDialog.Builder(this, R.style.MyPopup)
.setTitle("Enter Password") .setTitle("Enter Password")
@@ -889,12 +892,7 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
callback(null) callback(null)
} }
.create() .create()
fun handleOkAction() {
dialog.window?.setDimAmount(0.8f)
dialog.show()
// Override the positive button here
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val editText = dialog.findViewById<TextInputEditText>(R.id.userAgentTextBox) val editText = dialog.findViewById<TextInputEditText>(R.id.userAgentTextBox)
if (editText?.text?.isNotBlank() == true) { if (editText?.text?.isNotBlank() == true) {
editText.text?.toString()?.trim()?.toCharArray(password) editText.text?.toString()?.trim()?.toCharArray(password)
@@ -904,6 +902,28 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
toast("Password cannot be empty") toast("Password cannot be empty")
} }
} }
box?.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE) {
handleOkAction()
true
} else {
false
}
}
val subtitleTextView = dialogView.findViewById<TextView>(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()
}
} }

View File

@@ -25,6 +25,7 @@
app:boxCornerRadiusBottomStart="8dp" app:boxCornerRadiusBottomStart="8dp"
app:boxCornerRadiusTopEnd="8dp" app:boxCornerRadiusTopEnd="8dp"
app:boxCornerRadiusTopStart="8dp" app:boxCornerRadiusTopStart="8dp"
android:imeOptions="actionDone"
app:hintAnimationEnabled="true" /> app:hintAnimationEnabled="true" />
</LinearLayout> </LinearLayout>

View File

@@ -175,7 +175,7 @@
<string name="ui_settings">UI Settings</string> <string name="ui_settings">UI Settings</string>
<string name="about">About</string> <string name="about">About</string>
<string name="desc">" 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 &amp; 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?"</string> <string name="desc">" 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 &amp; 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?"</string>
<string name="devs">Developers</string> <string name="devs">Developers/Helpers</string>
<string name="disclaimer">Disclaimer</string> <string name="disclaimer">Disclaimer</string>
<string name="full_disclaimer"> <string name="full_disclaimer">
- Dantotsu by itself only provides an anime and manga tracker and does not provide any anime or manga streaming or downloading capabilities. - Dantotsu by itself only provides an anime and manga tracker and does not provide any anime or manga streaming or downloading capabilities.