I have two issues, first one is removing the divider in the NumberPicker and I'm extending the NumberPicker in Android to solve this issue, like this:
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.widget.NumberPicker;
import java.lang.reflect.Field;
public class ExtendedNumberPicker extends NumberPicker {
public ExtendedNumberPicker(Context context, AttributeSet attrs) {
super(context, attrs);
Class<?> numberPickerClass = null;
try {
numberPickerClass = Class.forName("android.widget.NumberPicker");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Field selectionDivider = null;
try {
selectionDivider = numberPickerClass.getDeclaredField("mSelectionDivider");
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
try {
selectionDivider.setAccessible(true);
selectionDivider.set(this, null);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (Resources.NotFoundException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
My other issue is that I didn't find any way to display more than 3 elements like the below UI: