コード例 #1
0
 private void handleButton() {
   String orgUnit = getString(R.string.organisation_unit) + ": " + mState.getOrgUnitLabel();
   String dataSet = getString(R.string.dataset) + ": " + mState.getDataSetLabel();
   String period = getString(R.string.period) + ": " + mState.getPeriod().getLabel();
   mButton.setFirstLineText(orgUnit);
   mButton.setSecondLineText(dataSet);
   mButton.setThirdLineText(period);
 }
コード例 #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());
          }
        }
      }
    }
  }