mirror of https://github.com/moparisthebest/k-9
34 lines
730 B
Java
34 lines
730 B
Java
/**
|
|
*
|
|
*/
|
|
|
|
package com.android.email.activity.setup;
|
|
|
|
import android.widget.Spinner;
|
|
|
|
public class SpinnerOption {
|
|
public Object value;
|
|
|
|
public String label;
|
|
|
|
public static void setSpinnerOptionValue(Spinner spinner, Object value) {
|
|
for (int i = 0, count = spinner.getCount(); i < count; i++) {
|
|
SpinnerOption so = (SpinnerOption)spinner.getItemAtPosition(i);
|
|
if (so.value.equals(value)) {
|
|
spinner.setSelection(i, true);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
public SpinnerOption(Object value, String label) {
|
|
this.value = value;
|
|
this.label = label;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return label;
|
|
}
|
|
}
|