use of de.symeda.sormas.app.util.Bundler in project SORMAS-Project by hzi-braunschweig.
the class BaseActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Show the Enter Pin Activity if the user doesn't have access to the app
if (isAccessNeeded() && !ConfigProvider.isAccessGranted()) {
Intent intent = new Intent(this, EnterPinActivity.class);
startActivity(intent);
finish();
}
if (savedInstanceState == null) {
savedInstanceState = getIntent().getExtras();
}
Bundler bundler = new Bundler(savedInstanceState);
activePagePosition = bundler.getActivePagePosition();
finishInsteadOfUpNav = bundler.isFinishInsteadOfUpNav();
setContentView(getRootActivityLayout());
rootView = findViewById(R.id.base_layout);
preloader = findViewById(R.id.preloader);
fragmentFrame = findViewById(R.id.fragment_frame);
applicationTitleBar = findViewById(R.id.applicationTitleBar);
statusFrame = findViewById(R.id.statusFrame);
pageMenu = findViewById(R.id.landingPageMenuControl);
if (pageMenu != null) {
pageMenu.setPageMenuItemClickCallback(this::setActivePage);
}
Drawable drawable = ContextCompat.getDrawable(this, R.drawable.selector_actionbar_back_button);
final Toolbar toolbar = findViewById(R.id.applicationToolbar);
if (toolbar != null) {
toolbar.setNavigationIcon(drawable);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
setTitle(getResources().getString(getActivityTitle()));
preSetupDrawer(savedInstanceState);
onCreateInner(savedInstanceState);
if (!isSubActivity()) {
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu_blue_36dp);
}
setupDrawer(navigationView);
}
Aggregations