mihon/app/src/main/java/eu/kanade/tachiyomi/widget/MinMaxNumberPicker.kt

24 lines
698 B
Kotlin
Raw Normal View History

2016-03-07 19:22:56 -05:00
package eu.kanade.tachiyomi.widget
import android.content.Context
import android.util.AttributeSet
import android.widget.NumberPicker
import eu.kanade.tachiyomi.R
class MinMaxNumberPicker @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
NumberPicker(context, attrs) {
init {
if (attrs != null) {
val ta = context.obtainStyledAttributes(attrs, R.styleable.MinMaxNumberPicker, 0, 0)
try {
minValue = ta.getInt(R.styleable.MinMaxNumberPicker_min, 0)
maxValue = ta.getInt(R.styleable.MinMaxNumberPicker_max, 0)
} finally {
ta.recycle()
}
}
}
}