use of com.xabber.android.ui.adapter.AccountChooseAdapter in project xabber-android by redsolution.
the class ConferenceSelectFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_conference_select, container, false);
accountView = (Spinner) view.findViewById(R.id.contact_account);
serverView = (EditText) view.findViewById(R.id.muc_server);
roomView = (EditText) view.findViewById(R.id.muc_conference_name);
roomView.setOnClickListener(this);
roomView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
if (hasFocus) {
onRoomNameEditTextClick();
}
}
});
roomsProgressBar = view.findViewById(R.id.muc_rooms_progress_bar);
view.findViewById(R.id.muc_get_hosted_rooms).setOnClickListener(this);
accountView.setAdapter(new AccountChooseAdapter(getActivity()));
accountView.setOnItemSelectedListener(this);
if (AccountManager.getInstance().getEnabledAccounts().size() == 1) {
accountView.setSelection(0);
}
nextButton = (Button) view.findViewById(R.id.muc_next);
nextButton.setTextColor(ColorManager.getInstance().getAccountPainter().getDefaultTextColor());
nextButton.setOnClickListener(this);
return view;
}
use of com.xabber.android.ui.adapter.AccountChooseAdapter in project xabber-android by redsolution.
the class ContactAddFragment method setUpAccountView.
private void setUpAccountView(Spinner view) {
accountView = view;
accountView.setAdapter(new AccountChooseAdapter(getActivity()));
accountView.setOnItemSelectedListener(this);
AccountJid account = getAccount();
if (account != null) {
for (int position = 0; position < accountView.getCount(); position++) {
AccountJid itemAtPosition = (AccountJid) accountView.getItemAtPosition(position);
LogManager.i(this, "itemAtPosition " + itemAtPosition + " account " + account);
if (account.equals(accountView.getItemAtPosition(position))) {
accountView.setSelection(position);
break;
}
}
}
}
Aggregations