コード例 #1
0
  public void onDataSetSelected(String dataSetId, String dataSetLabel, String categoryComboId) {
    mDataSetButton.setText(dataSetLabel);
    mPeriodButton.setEnabled(true);

    mState.setDataSet(dataSetId, dataSetLabel, categoryComboId);
    mState.resetPeriod();
    mState.resetCategoryStates();
    handleViews(1);
  }
コード例 #2
0
  public void onUnitSelected(String orgUnitId, String orgUnitLabel) {
    mOrgUnitButton.setText(orgUnitLabel);
    mDataSetButton.setEnabled(true);

    mState.setOrgUnit(orgUnitId, orgUnitLabel);
    mState.resetDataSet();
    mState.resetPeriod();
    mState.resetCategoryStates();
    handleViews(0);
  }
コード例 #3
0
  public void onPeriodSelected(DateHolder dateHolder, boolean loadCategoriesFromDb) {
    mPeriodButton.setText(dateHolder.getLabel());

    mState.setPeriod(dateHolder);
    mState.resetCategoryStates();
    handleViews(2);

    if (loadCategoriesFromDb) {
      // we need to put the categoryComboId inside of Bundle in order to
      // enable its (categoryComboId) survival through configuration changes
      Bundle arguments = new Bundle();
      arguments.putString(CATEGORY_COMBO_ID, mState.getDataSetCategoryComboId());

      // load dataset categories
      getLoaderManager().restartLoader(CATEGORIES_LOADER_ID, arguments, CATEGORY_LOADER_CALLBACK);
    }
  }