public void smoothScrollToValue(int fromValue, int toValue){ smoothScrollToValue(fromValue, toValue, true); }
/** * get the "fromValue" by using getValue(), if your picker's minValue is not 0, * make sure you can get the accurate value by getValue(), or you can use * smoothScrollToValue(int fromValue, int toValue, boolean needRespond) * @param toValue the value you want picker to scroll to */ public void smoothScrollToValue(int toValue){ smoothScrollToValue(getValue(), toValue, true); }
/** * get the "fromValue" by using getValue(), if your picker's minValue is not 0, * make sure you can get the accurate value by getValue(), or you can use * smoothScrollToValue(int fromValue, int toValue, boolean needRespond) * @param toValue the value you want picker to scroll to * @param needRespond set if you want picker to respond onValueChange listener */ public void smoothScrollToValue(int toValue, boolean needRespond){ smoothScrollToValue(getValue(), toValue, needRespond); }
case R.id.button4: int value = picker.getValue(); picker.smoothScrollToValue(value, value + 2); break; case R.id.button5:
fromValue = newStart; pickerView.smoothScrollToValue(fromValue, toValue, needRespond); }else{ pickerView.setValue(newSway);