Allow to set status, score and last chapter read in MAL. Other minor changes

This commit is contained in:
inorichi
2015-12-20 20:10:04 +01:00
parent 5f44e5d492
commit 50d6632d0e
15 changed files with 370 additions and 153 deletions
@@ -0,0 +1,36 @@
package eu.kanade.mangafeed.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.NumberPicker;
import eu.kanade.mangafeed.R;
public class MinMaxNumberPicker extends NumberPicker{
public MinMaxNumberPicker(Context context) {
super(context);
}
public MinMaxNumberPicker(Context context, AttributeSet attrs) {
super(context, attrs);
processAttributeSet(context, attrs);
}
public MinMaxNumberPicker(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
processAttributeSet(context, attrs);
}
private void processAttributeSet(Context context, AttributeSet attrs) {
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.MinMaxNumberPicker, 0, 0);
try {
setMinValue(ta.getInt(R.styleable.MinMaxNumberPicker_min, 0));
setMaxValue(ta.getInt(R.styleable.MinMaxNumberPicker_max, 0));
} finally {
ta.recycle();
}
}
}