INNER CODE UNIT · Java
onItemClick
arcadefire/nice-spinner · library/src/main/java/org/angmarch/views/NiceSpinner.java:155
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// The selected item is not displayed within the list, so when the selected position is equal to
// the one of the currently selected item it gets shifted to the next item.
if (position >= selectedIndex && position < adapter.getCount()) {
position++;
}
selectedIndex = position;
if (onSpinnerItemSelectedListener != null) {
onSpinnerItemSelectedListener.onItemSelected(NiceSpinner.this, view, position, id);
}
if (onItemClickListener != null) {
onItemClickListener.onItemClick(parent, view, position, id);
}
if (onItemSelectedListener != null) {
onItemSelectedListener.onItemSelected(parent, view, position, id);