Search in sources :

Example 1 with OccupantListAdapter

use of com.xabber.android.ui.adapter.OccupantListAdapter in project xabber-android by redsolution.

the class OccupantList method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    account = getAccount(getIntent());
    room = Jid.getBareAddress(getUser(getIntent()));
    if (account == null || room == null || !MUCManager.getInstance().hasRoom(account, room)) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        finish();
        return;
    }
    setContentView(R.layout.list);
    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setNavigationIcon(R.drawable.ic_arrow_left_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            NavUtils.navigateUpFromSameTask(OccupantList.this);
        }
    });
    toolbar.setTitle(room);
    BarPainter barPainter = new BarPainter(this, toolbar);
    barPainter.updateWithAccountName(account);
    listAdapter = new OccupantListAdapter(this, account, room);
    setListAdapter(listAdapter);
    getListView().setOnItemClickListener(this);
}
Also used : OccupantListAdapter(com.xabber.android.ui.adapter.OccupantListAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) Toolbar(android.support.v7.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)1 View (android.view.View)1 AdapterView (android.widget.AdapterView)1 OccupantListAdapter (com.xabber.android.ui.adapter.OccupantListAdapter)1 BarPainter (com.xabber.android.ui.color.BarPainter)1