use of com.khmelenko.lab.varis.about.LicensesDialogFragment in project Varis-Android by dkhmelenko.
the class MainActivity method setupDrawerLayout.
/**
* Sets up navigation drawer layout
*/
private void setupDrawerLayout() {
mDrawerLayout = findViewById(R.id.drawer_layout);
mDrawerLayout.addDrawerListener(mDrawerToggle);
final NavigationView view = findViewById(R.id.navigation_view);
view.setNavigationItemSelectedListener(menuItem -> {
switch(menuItem.getItemId()) {
case R.id.drawer_login:
Intent loginIntent = new Intent(MainActivity.this, AuthActivity.class);
startActivityForResult(loginIntent, AUTH_ACTIVITY_CODE);
break;
case R.id.drawer_logout:
getPresenter().userLogout();
finish();
startActivity(getIntent());
break;
case R.id.drawer_licenses:
LicensesDialogFragment dialog = LicensesDialogFragment.newInstance();
dialog.show(getSupportFragmentManager(), "LicensesDialog");
break;
case R.id.drawer_about:
Intent aboutIntent = new Intent(MainActivity.this, AboutActivity.class);
startActivity(aboutIntent);
break;
}
menuItem.setChecked(false);
mDrawerLayout.closeDrawers();
return true;
});
}
Aggregations