use of de.robv.android.xposed.installer.installation.StatusInstallerFragment in project XposedInstaller by rovo89.
the class WelcomeActivity method navigate.
private void navigate(final int itemId) {
final View elevation = findViewById(R.id.elevation);
Fragment navFragment = null;
switch(itemId) {
case R.id.nav_item_framework:
mPrevSelectedId = itemId;
setTitle(R.string.app_name);
navFragment = new StatusInstallerFragment();
break;
case R.id.nav_item_modules:
mPrevSelectedId = itemId;
setTitle(R.string.nav_item_modules);
navFragment = new ModulesFragment();
break;
case R.id.nav_item_downloads:
mPrevSelectedId = itemId;
setTitle(R.string.nav_item_download);
navFragment = new DownloadFragment();
break;
case R.id.nav_item_logs:
mPrevSelectedId = itemId;
setTitle(R.string.nav_item_logs);
navFragment = new LogsFragment();
break;
case R.id.nav_item_settings:
startActivity(new Intent(this, SettingsActivity.class));
mNavigationView.getMenu().findItem(mPrevSelectedId).setChecked(true);
return;
case R.id.nav_item_support:
startActivity(new Intent(this, SupportActivity.class));
mNavigationView.getMenu().findItem(mPrevSelectedId).setChecked(true);
return;
case R.id.nav_item_about:
startActivity(new Intent(this, AboutActivity.class));
mNavigationView.getMenu().findItem(mPrevSelectedId).setChecked(true);
return;
}
final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dp(4));
if (navFragment != null) {
FragmentTransaction transaction = getFragmentManager().beginTransaction();
transaction.setCustomAnimations(R.animator.fade_in, R.animator.fade_out);
try {
transaction.replace(R.id.content_frame, navFragment).commit();
if (elevation != null) {
Animation a = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
elevation.setLayoutParams(params);
}
};
a.setDuration(150);
elevation.startAnimation(a);
}
} catch (IllegalStateException ignored) {
}
}
}
Aggregations