use of io.jawg.osmcontributor.ui.events.map.NewPoiTypeSelected in project osm-contributor by jawg.
the class PoiTypePickerAdapter method getView.
@Override
public View getView(int position, View view, ViewGroup parent) {
ViewHolder holder = null;
if (view != null) {
holder = (ViewHolder) view.getTag();
if (holder instanceof ExpertViewHolder ^ expertMode) {
holder = null;
}
}
if (holder == null) {
if (expertMode) {
view = inflater.inflate(R.layout.single_expert_poitype_autocomplete_layout, parent, false);
holder = new ExpertViewHolder(view);
} else {
view = inflater.inflate(R.layout.single_poitype_autocomplete_layout, parent, false);
holder = new ViewHolder(view);
}
view.setTag(holder);
}
final PoiType value = filteredValues.get(position);
holder.onBind(value);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
eventBus.post(new NewPoiTypeSelected(value));
closeKeyboard();
}
});
return view;
}