mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-14 13:08:56 +01:00
Update NDK, more KTX usage (#4792)
* Update NDK * Utilize more KTX extensions
This commit is contained in:
@@ -6,6 +6,7 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.widget.doOnTextChanged
|
||||
import eu.kanade.tachiyomi.databinding.DownloadCustomAmountBinding
|
||||
import timber.log.Timber
|
||||
|
||||
@@ -65,16 +66,14 @@ class DialogCustomDownloadView @JvmOverloads constructor(context: Context, attrs
|
||||
}
|
||||
|
||||
// When user inputs custom number set amount equal to input.
|
||||
binding.myNumber.addTextChangedListener(object : SimpleTextWatcher() {
|
||||
override fun onTextChanged(text: CharSequence, start: Int, before: Int, count: Int) {
|
||||
try {
|
||||
amount = getAmount(text.toString().toInt())
|
||||
} catch (error: NumberFormatException) {
|
||||
// Catch NumberFormatException to prevent parse exception when input is empty.
|
||||
Timber.e(error)
|
||||
}
|
||||
binding.myNumber.doOnTextChanged { text, _, _, _ ->
|
||||
try {
|
||||
amount = getAmount(text.toString().toInt())
|
||||
} catch (error: NumberFormatException) {
|
||||
// Catch NumberFormatException to prevent parse exception when input is empty.
|
||||
Timber.e(error)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package eu.kanade.tachiyomi.widget
|
||||
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
|
||||
open class SimpleTextWatcher : TextWatcher {
|
||||
override fun beforeTextChanged(text: CharSequence, start: Int, count: Int, after: Int) {
|
||||
}
|
||||
|
||||
override fun onTextChanged(text: CharSequence, start: Int, before: Int, count: Int) {
|
||||
}
|
||||
|
||||
override fun afterTextChanged(text: Editable) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user