Skip to content

Commit

Permalink
Fixes codinguser#872 Add a final commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanGarf committed Feb 27, 2020
1 parent 578022e commit 7a4e4e5
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions app/src/main/java/org/gnucash/android/ui/report/ReportType.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
public enum ReportType {
PIE_CHART(0), BAR_CHART(1), LINE_CHART(2), TEXT(3), NONE(4);

// #872 Use a list to be sure of the sort order which is not guaranted with a hashmap keys
List<String> mReportNames = null;

Map<String, Class> mReportTypeMap = new HashMap<>();
Expand All @@ -56,29 +57,16 @@ public enum ReportType {

Context context = GnuCashApplication.getAppContext();

// switch (index){
// case 0:
// mReportTypeMap.put(context.getString(R.string.title_pie_chart), PieChartFragment.class);
// break;
// case 1:
// mReportTypeMap.put(context.getString(R.string.title_bar_chart), StackedBarChartFragment.class);
// break;
// case 2:
// mReportTypeMap.put(context.getString(R.string.title_cash_flow_report), CashFlowLineChartFragment.class);
// break;
// case 3:
// mReportTypeMap.put(context.getString(R.string.title_balance_sheet_report), BalanceSheetFragment.class);
// break;
// case 4:
// break;
// }

// #872 Fill the map with all the items, in order to fill the Report Toolbar Spinner
mReportTypeMap.put(context.getString(R.string.title_pie_chart),
PieChartFragment.class);

mReportTypeMap.put(context.getString(R.string.title_bar_chart),
StackedBarChartFragment.class);

mReportTypeMap.put(context.getString(R.string.title_cash_flow_report),
CashFlowLineChartFragment.class);

mReportTypeMap.put(context.getString(R.string.title_balance_sheet_report),
BalanceSheetFragment.class);
}
Expand Down

0 comments on commit 7a4e4e5

Please sign in to comment.