コード例 #1
0
 @Override
 public void onClick(View view) {
   switch (view.getId()) {
     case R.id.unit_button:
       {
         OrgUnitDialogFragment fragment = OrgUnitDialogFragment.newInstance(this);
         fragment.show(getChildFragmentManager());
         break;
       }
     case R.id.dataset_button:
       {
         DataSetDialogFragment fragment =
             DataSetDialogFragment.newInstance(this, mState.getOrgUnitId());
         fragment.show(getChildFragmentManager());
         break;
       }
     case R.id.period_button:
       {
         PeriodDialogFragment fragment =
             PeriodDialogFragment.newInstance(this, mState.getDataSetId());
         fragment.show(getChildFragmentManager());
         break;
       }
     case R.id.data_entry_button:
       {
         // startReportEntryActivity();
         break;
       }
   }
 }
コード例 #2
0
  private void startReportEntryActivity() {
    String orgUnitId = mState.getOrgUnitId();
    String orgUnitLabel = mState.getOrgUnitLabel();

    String dataSetId = mState.getDataSetId();
    String dataSetLabel = mState.getDataSetLabel();

    String period = mState.getPeriod().getDate();
    String periodLabel = mState.getPeriod().getLabel();

    Intent intent =
        ReportEntryActivity.newIntent(
            getActivity(), orgUnitId, orgUnitLabel, dataSetId, dataSetLabel, period, periodLabel);
    startActivity(intent);
  }
コード例 #3
0
  public void onRestoreInstanceState() {
    AggregateReportFragmentState backedUpState = new AggregateReportFragmentState(mState);
    if (!backedUpState.isOrgUnitEmpty()) {
      onUnitSelected(backedUpState.getOrgUnitId(), backedUpState.getOrgUnitLabel());

      if (!backedUpState.isDataSetEmpty()) {
        onDataSetSelected(
            backedUpState.getDataSetId(),
            backedUpState.getDataSetLabel(),
            backedUpState.getDataSetCategoryComboId());

        if (!backedUpState.isPeriodEmpty()) {
          onPeriodSelected(backedUpState.getPeriod(), false);

          if (!backedUpState.areCategoryStatesEmpty()) {
            onCategoriesSelected(backedUpState.getCategoryStates());
          }
        }
      }
    }
  }