public AutoCompleteEditTextWrapper AddCombobox(String ViewName, final String EventPrefix, int DataType, int ActionBtn, String Prompt, String Hint, int HintColor, float TextSize, int TextColor, List Items, Boolean ReadOnly, int BackgroundResourceID, final String NextView, final String PrevView){
int BackgroundID= android.R.drawable.btn_dropdown;
if (BackgroundResourceID != 0) BackgroundID= BackgroundResourceID;
AutoCompleteEditTextWrapper b4aView= new AutoCompleteEditTextWrapper();
AutoCompleteEX NewView= new AutoCompleteEX(ba.context);
b4aView.setObject(NewView);
b4aView.innerInitialize(ba, EventPrefix, true);
NewView.setBackgroundResource(BackgroundID);
NewView.setHint(Hint);
NewView.setHintTextColor(HintColor);
NewView.setCompletionHint(Prompt);
NewView.setThreshold(1);
NewView.setTextSize(TextSize);
NewView.setTypeface(Typeface.DEFAULT);
NewView.setTextColor(TextColor);
NewView.setSingleLine(true);
NewView.setHorizontallyScrolling(true);
NewView.setScrollbarFadingEnabled(true);
NewView.setEllipsize(TextUtils.TruncateAt.END);
if (ReadOnly) {
NewView.setFocusable(false);
NewView.setInputType(0);
NewView.setCursorVisible(false);
}
else {
NewView.setInputType(DataType);
NewView.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | ActionBtn);
NewView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_NEXT) {
if (NextView.length() > 0) {
if (viewList.containsKey(NextView)) return viewList.get(NextView).requestFocus();
}
return false;
}
if (actionId == EditorInfo.IME_ACTION_PREVIOUS) {
if (PrevView.length() > 0) {
if (viewList.containsKey(PrevView)) return viewList.get(PrevView).requestFocus();
}
return false;
}
if (EventPrefix.length() > 0) {
Boolean b = (Boolean)ba.raiseEvent(v, EventPrefix.toLowerCase(BA.cul) + "_imeaction");
if (b != null && b == true)
return true;
else
return false;
}
else {
return false;
}
}
});
}
NewView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View MyView) {
((AutoCompleteEX) MyView).ShowFullList();
}
});
if (Items.IsInitialized()) b4aView.SetItems(ba, Items);
AddView(NewView, ViewName);
return b4aView;
}