public void onCategoriesSelected(List<CategoryState> states) { mState.setCategoryStates(states); mAdapter.swapData(new ArrayList<>(states)); if (areAllCategoriesChosen()) { handleButton(); handleViews(3); } else { handleViews(2); } }
private void handleViews(int level) { switch (level) { case 0: mPeriodButton.setEnabled(false); case 1: mAdapter.swapData(null); case 2: mButton.hide(true); break; case 3: mButton.show(true); } }