Search in sources :

Example 1 with DashboardActivity

use of org.eyeseetea.malariacare.DashboardActivity in project pictureapp by EyeSeeTea.

the class StockFragment method showHistoricReceiptBalanceFragment.

private void showHistoricReceiptBalanceFragment(int type) {
    Activity activity = getActivity();
    if (activity != null) {
        HistoricReceiptBalanceFragment historicReceiptBalanceFragment = new HistoricReceiptBalanceFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(HistoricReceiptBalanceFragment.TYPE, type);
        historicReceiptBalanceFragment.setArguments(bundle);
        replaceFragment(R.id.dashboard_stock_container, historicReceiptBalanceFragment);
        int headerString = R.string.fragment_historic_receipt_balance;
        if (type == Constants.SURVEY_RESET) {
            headerString = R.string.fragment_historic_reset;
        }
        DashboardHeaderStrategy.getInstance().init(activity, headerString);
        if (activity instanceof DashboardActivity) {
            ((DashboardActivity) activity).initNewReceiptFragment();
        }
    }
}
Also used : Bundle(android.os.Bundle) DashboardActivity(org.eyeseetea.malariacare.DashboardActivity) DashboardActivity(org.eyeseetea.malariacare.DashboardActivity) Activity(android.app.Activity)

Example 2 with DashboardActivity

use of org.eyeseetea.malariacare.DashboardActivity in project pictureapp by EyeSeeTea.

the class StockFragment method showNewReceiptBalanceFragment.

private void showNewReceiptBalanceFragment(int type) {
    Activity activity = getActivity();
    if (activity != null) {
        NewReceiptBalanceFragment newReceiptBalanceFragment = new NewReceiptBalanceFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(NewReceiptBalanceFragment.TYPE, type);
        newReceiptBalanceFragment.setArguments(bundle);
        replaceFragment(R.id.dashboard_stock_container, newReceiptBalanceFragment);
        int headerString = R.string.fragment_new_receipt;
        if (type == Constants.SURVEY_RESET) {
            headerString = R.string.fragment_new_reset;
        }
        DashboardHeaderStrategy.getInstance().init(activity, headerString);
        if (activity instanceof DashboardActivity) {
            ((DashboardActivity) activity).initNewReceiptFragment();
        }
    }
}
Also used : Bundle(android.os.Bundle) DashboardActivity(org.eyeseetea.malariacare.DashboardActivity) DashboardActivity(org.eyeseetea.malariacare.DashboardActivity) Activity(android.app.Activity)

Aggregations

Activity (android.app.Activity)2 Bundle (android.os.Bundle)2 DashboardActivity (org.eyeseetea.malariacare.DashboardActivity)2