Fix Mangadex 2 factor auth

Fix Backups with merge manga breaking(I think)
Tweak preload settings, make the max 20, defaults to 10
Add tag based sorting
This commit is contained in:
Jobobby04
2020-09-15 13:00:40 -04:00
parent 89427ff37e
commit de05f88d5f
20 changed files with 688 additions and 24 deletions
@@ -3,6 +3,7 @@ package exh.widget.preference
import android.app.Dialog
import android.os.Bundle
import android.view.View
import androidx.core.view.isVisible
import com.afollestad.materialdialogs.MaterialDialog
import com.afollestad.materialdialogs.customview.customView
import eu.kanade.tachiyomi.R
@@ -15,7 +16,9 @@ import exh.md.utils.MdUtil
import kotlinx.android.synthetic.main.pref_account_login.view.login
import kotlinx.android.synthetic.main.pref_account_login.view.password
import kotlinx.android.synthetic.main.pref_account_login.view.username
import kotlinx.android.synthetic.main.pref_site_login_two_factor_auth.view.*
import kotlinx.android.synthetic.main.pref_site_login_two_factor_auth.view.two_factor_check
import kotlinx.android.synthetic.main.pref_site_login_two_factor_auth.view.two_factor_edit
import kotlinx.android.synthetic.main.pref_site_login_two_factor_auth.view.two_factor_holder
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -50,6 +53,15 @@ class MangadexLoginDialog(bundle: Bundle? = null) : LoginDialogPreference(bundle
return dialog
}
override fun onViewCreated(view: View) {
super.onViewCreated(view)
v?.apply {
two_factor_check?.setOnCheckedChangeListener { _, isChecked ->
two_factor_holder.isVisible = isChecked
}
}
}
override fun setCredentialsOnView(view: View) = with(view) {
username.setText(service.getUsername())
password.setText(service.getPassword())