Kotlinize some widgets

This commit is contained in:
len
2016-03-08 01:22:56 +01:00
parent 0ddbfd1036
commit 05adde552d
12 changed files with 142 additions and 210 deletions
@@ -0,0 +1,23 @@
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()
}
}
}
}