Search in sources :

Example 1 with GravityFragment

use of co.mobiwise.sample.fragment.GravityFragment in project MaterialIntroView by iammert.

the class ToolbarMenuItemActivity method onNavigationItemSelected.

@Override
public boolean onNavigationItemSelected(MenuItem item) {
    // Handle navigation view item clicks here.
    switch(item.getItemId()) {
        case R.id.nav_demo:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new MainFragment()).commit();
            break;
        case R.id.nav_gravity:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new GravityFragment()).commit();
            break;
        case R.id.nav_focus:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new FocusFragment()).commit();
            break;
        case R.id.nav_recyclerview:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new RecyclerviewFragment()).commit();
            break;
        case R.id.nav_toolbar:
            startActivity(new Intent(getApplicationContext(), ToolbarMenuItemActivity.class));
            break;
        case R.id.nav_tab:
            break;
        default:
            break;
    }
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawer.closeDrawer(GravityCompat.START);
    return true;
}
Also used : MainFragment(co.mobiwise.sample.fragment.MainFragment) RecyclerviewFragment(co.mobiwise.sample.fragment.RecyclerviewFragment) Intent(android.content.Intent) DrawerLayout(android.support.v4.widget.DrawerLayout) GravityFragment(co.mobiwise.sample.fragment.GravityFragment) FocusFragment(co.mobiwise.sample.fragment.FocusFragment)

Example 2 with GravityFragment

use of co.mobiwise.sample.fragment.GravityFragment in project MaterialIntroView by iammert.

the class MainActivity method onNavigationItemSelected.

@Override
public boolean onNavigationItemSelected(MenuItem item) {
    // Handle navigation view item clicks here.
    switch(item.getItemId()) {
        case R.id.nav_demo:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new MainFragment()).commit();
            break;
        case R.id.nav_gravity:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new GravityFragment()).commit();
            break;
        case R.id.nav_focus:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new FocusFragment()).commit();
            break;
        case R.id.nav_recyclerview:
            getSupportFragmentManager().beginTransaction().replace(R.id.container, new RecyclerviewFragment()).commit();
            break;
        case R.id.nav_toolbar:
            startActivity(new Intent(getApplicationContext(), ToolbarMenuItemActivity.class));
            break;
        case R.id.nav_tab:
            break;
        default:
            break;
    }
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawer.closeDrawer(GravityCompat.START);
    return true;
}
Also used : MainFragment(co.mobiwise.sample.fragment.MainFragment) RecyclerviewFragment(co.mobiwise.sample.fragment.RecyclerviewFragment) Intent(android.content.Intent) DrawerLayout(android.support.v4.widget.DrawerLayout) GravityFragment(co.mobiwise.sample.fragment.GravityFragment) FocusFragment(co.mobiwise.sample.fragment.FocusFragment)

Aggregations

Intent (android.content.Intent)2 DrawerLayout (android.support.v4.widget.DrawerLayout)2 FocusFragment (co.mobiwise.sample.fragment.FocusFragment)2 GravityFragment (co.mobiwise.sample.fragment.GravityFragment)2 MainFragment (co.mobiwise.sample.fragment.MainFragment)2 RecyclerviewFragment (co.mobiwise.sample.fragment.RecyclerviewFragment)2