|
|
|
|
@ -150,8 +150,12 @@ class CalendarDetailsFragment : PokerAnalyticsFragment(), StaticRowRepresentable |
|
|
|
|
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { |
|
|
|
|
when (row) { |
|
|
|
|
is GraphRow -> { |
|
|
|
|
row.report.results.firstOrNull()?.group?.let { computableGroup -> |
|
|
|
|
StatisticDetailsActivity.newInstance(requireContext(), row.stat, computableGroup, row.report, false, row.title) |
|
|
|
|
row.report?.let { report -> |
|
|
|
|
row.stat?.let { stat -> |
|
|
|
|
report.results.firstOrNull()?.group?.let { computableGroup -> |
|
|
|
|
StatisticDetailsActivity.newInstance(requireContext(), stat, computableGroup, report, false, row.title) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -199,7 +203,8 @@ class CalendarDetailsFragment : PokerAnalyticsFragment(), StaticRowRepresentable |
|
|
|
|
val options = Calculator.Options( |
|
|
|
|
evolutionValues = Calculator.Options.EvolutionValues.STANDARD, |
|
|
|
|
stats = requiredStats, |
|
|
|
|
query = query) |
|
|
|
|
query = query |
|
|
|
|
) |
|
|
|
|
val report = Calculator.computeStats(realm, options) |
|
|
|
|
|
|
|
|
|
Timber.d("Report take: ${System.currentTimeMillis() - startDate.time}ms") |
|
|
|
|
@ -207,17 +212,27 @@ class CalendarDetailsFragment : PokerAnalyticsFragment(), StaticRowRepresentable |
|
|
|
|
report.results.firstOrNull()?.let { |
|
|
|
|
|
|
|
|
|
// Create rows |
|
|
|
|
val dataSet1 = report.results.firstOrNull()?.defaultStatEntries(Stat.NET_RESULT, requireContext()) |
|
|
|
|
val dataSet2 = report.results.firstOrNull()?.defaultStatEntries(Stat.STANDARD_DEVIATION, requireContext()) |
|
|
|
|
val dataSet3 = report.results.firstOrNull()?.defaultStatEntries(Stat.HOURLY_DURATION, requireContext()) |
|
|
|
|
|
|
|
|
|
rowRepresentables.clear() |
|
|
|
|
rowRepresentables.add(CustomizableRowRepresentable(RowViewType.HEADER_TITLE, resId = R.string.net_result)) |
|
|
|
|
rowRepresentables.add(GraphRow(report, Stat.NET_RESULT)) |
|
|
|
|
rowRepresentables.add(GraphRow(dataSet1, report = report, stat = Stat.NET_RESULT)) |
|
|
|
|
rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.NET_RESULT), it.computedStat(Stat.HOURLY_RATE))) |
|
|
|
|
rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.LOCATIONS_PLAYED), it.computedStat(Stat.LONGEST_STREAKS))) |
|
|
|
|
rowRepresentables.add(CustomizableRowRepresentable(RowViewType.HEADER_TITLE, resId = R.string.distribution)) |
|
|
|
|
rowRepresentables.add(GraphRow(report, Stat.STANDARD_DEVIATION, requireContext().getString(R.string.distribution))) |
|
|
|
|
rowRepresentables.add( |
|
|
|
|
GraphRow( |
|
|
|
|
dataSet2, |
|
|
|
|
requireContext().getString(R.string.distribution), |
|
|
|
|
report = report, |
|
|
|
|
stat = Stat.STANDARD_DEVIATION |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.WIN_RATIO), it.computedStat(Stat.MAXIMUM_NETRESULT))) |
|
|
|
|
rowRepresentables.add(CustomizableRowRepresentable(RowViewType.HEADER_TITLE, resId = R.string.volume)) |
|
|
|
|
rowRepresentables.add(GraphRow(report, Stat.HOURLY_DURATION)) |
|
|
|
|
rowRepresentables.add(GraphRow(dataSet3, report = report, stat = Stat.HOURLY_DURATION)) |
|
|
|
|
rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.HOURLY_DURATION), it.computedStat(Stat.AVERAGE_HOURLY_DURATION))) |
|
|
|
|
rowRepresentables.add(StatDoubleRow(it.computedStat(Stat.DAYS_PLAYED), it.computedStat(Stat.MAXIMUM_DURATION))) |
|
|
|
|
} |
|
|
|
|
|