Search in sources :

Example 1 with ContactListFragment

use of com.xabber.android.ui.fragment.ContactListFragment in project xabber-android by redsolution.

the class ContactList method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    if (Intent.ACTION_VIEW.equals(getIntent().getAction()) || Intent.ACTION_SEND.equals(getIntent().getAction()) || Intent.ACTION_SENDTO.equals(getIntent().getAction()) || Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction())) {
        ActivityManager.getInstance().startNewTask(this);
    }
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    setContentView(R.layout.contact_list);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_default);
    toolbar.setOnClickListener(this);
    drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.application_title_short, R.string.application_title_short);
    drawerLayout.setDrawerListener(drawerToggle);
    toolbar.inflateMenu(R.menu.contact_list);
    optionsMenu = toolbar.getMenu();
    setUpSearchView(optionsMenu);
    toolbar.setOnMenuItemClickListener(this);
    barPainter = new BarPainter(this, toolbar);
    barPainter.setDefaultColor();
    toolbar.setTitle(R.string.application_title_full);
    if (savedInstanceState != null) {
        sendText = savedInstanceState.getString(SAVED_SEND_TEXT);
        action = savedInstanceState.getString(SAVED_ACTION);
    } else {
        getSupportFragmentManager().beginTransaction().add(R.id.container, new ContactListFragment(), CONTACT_LIST_TAG).commit();
        sendText = null;
        action = getIntent().getAction();
    }
    getIntent().setAction(null);
}
Also used : ContactListFragment(com.xabber.android.ui.fragment.ContactListFragment) ActionBarDrawerToggle(android.support.v7.app.ActionBarDrawerToggle) Toolbar(android.support.v7.widget.Toolbar) BarPainter(com.xabber.android.ui.color.BarPainter)

Aggregations

ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 Toolbar (android.support.v7.widget.Toolbar)1 BarPainter (com.xabber.android.ui.color.BarPainter)1 ContactListFragment (com.xabber.android.ui.fragment.ContactListFragment)1