Search in sources :

Example 1 with AccountChooseAdapter

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;
}
Also used : AccountChooseAdapter(com.xabber.android.ui.adapter.AccountChooseAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView)

Example 2 with AccountChooseAdapter

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;
            }
        }
    }
}
Also used : AccountChooseAdapter(com.xabber.android.ui.adapter.AccountChooseAdapter) AccountJid(com.xabber.android.data.entity.AccountJid)

Aggregations

AccountChooseAdapter (com.xabber.android.ui.adapter.AccountChooseAdapter)2 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 ListView (android.widget.ListView)1 AccountJid (com.xabber.android.data.entity.AccountJid)1