use of javax.microedition.lcdui.list.CompoundSpinnerAdapter in project J2ME-Loader by nikita36078.
the class ChoiceGroup method getItemContentView.
@Override
public View getItemContentView() {
Context context = getOwnerForm().getParentActivity();
switch(choiceType) {
case EXCLUSIVE:
if (buttongroup == null) {
buttongroup = new RadioGroup(context);
initButtonGroup();
((RadioGroup) buttongroup).setOnCheckedChangeListener(radiolistener);
}
return buttongroup;
case MULTIPLE:
if (buttongroup == null) {
buttongroup = new LinearLayout(context);
initButtonGroup();
}
return buttongroup;
case POPUP:
if (spinner == null) {
adapter = new CompoundSpinnerAdapter(context);
spinner = new Spinner(context);
spinner.setAdapter(adapter);
int size = selected.size();
for (int i = 0; i < size; i++) {
adapter.append(strings.get(i), images.get(i));
}
if (selectedIndex >= 0 && selectedIndex < selected.size()) {
spinner.setSelection(selectedIndex);
}
spinner.setOnItemSelectedListener(spinlistener);
}
return spinner;
default:
throw new InternalError();
}
}
Aggregations