mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-30 05:47:57 +01:00
Manga in Kotlin. Expect some errors yet
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package eu.kanade.tachiyomi.widget
|
||||
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
|
||||
open class SimpleTextWatcher : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
|
||||
|
||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
|
||||
|
||||
override fun afterTextChanged(s: Editable) {}
|
||||
}
|
||||
@@ -5,8 +5,6 @@ import android.app.DialogFragment
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import android.view.View
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
@@ -14,6 +12,7 @@ import com.dd.processbutton.iml.ActionProcessButton
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.setting.SettingsActivity
|
||||
import eu.kanade.tachiyomi.widget.SimpleTextWatcher
|
||||
import kotlinx.android.synthetic.main.pref_account_login.view.*
|
||||
import rx.Subscription
|
||||
|
||||
@@ -54,11 +53,7 @@ abstract class LoginDialogPreference : DialogFragment() {
|
||||
|
||||
show_password.isEnabled = password.text.isNullOrEmpty()
|
||||
|
||||
password.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
|
||||
|
||||
override fun afterTextChanged(s: Editable) {}
|
||||
|
||||
password.addTextChangedListener(object : SimpleTextWatcher() {
|
||||
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
|
||||
if (s.length == 0) {
|
||||
show_password.isEnabled = true
|
||||
|
||||
Reference in New Issue
Block a user