Current NumericWheelAdapter implementation only takes an integer, then convert
to string. It would be nice if it could allow formatted string i.e.
00,01,02,... as in minutes or even decimal.
It can be easily done by introducing an additional constructor to
NumericWheelAdapter:
private String format = null;
public NumericWheelAdapter(int minValue, int maxValue, String format) {
this.minValue = minValue;
this.maxValue = maxValue;
this.format = format;
}
// And modification to the getItem method:
public String getItem(int index) {
if (index >= 0 && index < getItemsCount()) {
if(this.format != null) {
return String.format(this.format, minValue+index);
} else {
return Integer.toString(minValue + index);
}
}
return null;
}
I'm attaching a new NumericWheelAdapter.java
Original issue reported on code.google.com by dzu...@gmail.com on 8 Nov 2010 at 3:01
Original issue reported on code.google.com by
dzu...@gmail.com
on 8 Nov 2010 at 3:01Attachments: