Search in sources :

Example 36 with Bundler

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);
}
Also used : Drawable(android.graphics.drawable.Drawable) Intent(android.content.Intent) Bundler(de.symeda.sormas.app.util.Bundler) Toolbar(androidx.appcompat.widget.Toolbar)

Aggregations

Bundler (de.symeda.sormas.app.util.Bundler)36 FacilityType (de.symeda.sormas.api.infrastructure.facility.FacilityType)2 Case (de.symeda.sormas.app.backend.caze.Case)2 Intent (android.content.Intent)1 Drawable (android.graphics.drawable.Drawable)1 GONE (android.view.View.GONE)1 VISIBLE (android.view.View.VISIBLE)1 Toolbar (androidx.appcompat.widget.Toolbar)1 CountryHelper (de.symeda.sormas.api.CountryHelper)1 Disease (de.symeda.sormas.api.Disease)1 CaseOrigin (de.symeda.sormas.api.caze.CaseOrigin)1 DengueFeverType (de.symeda.sormas.api.caze.DengueFeverType)1 PlagueType (de.symeda.sormas.api.caze.PlagueType)1 RabiesType (de.symeda.sormas.api.caze.RabiesType)1 CustomizableEnumType (de.symeda.sormas.api.customizableenum.CustomizableEnumType)1 DiseaseVariant (de.symeda.sormas.api.disease.DiseaseVariant)1 TypeOfPlace (de.symeda.sormas.api.event.TypeOfPlace)1 FacilityTypeGroup (de.symeda.sormas.api.infrastructure.facility.FacilityTypeGroup)1 PresentCondition (de.symeda.sormas.api.person.PresentCondition)1 Sex (de.symeda.sormas.api.person.Sex)1