|
|
|
@ -14,6 +14,7 @@ import net.pokeranalytics.android.calculus.Calculator |
|
|
|
import net.pokeranalytics.android.calculus.Report |
|
|
|
import net.pokeranalytics.android.calculus.Report |
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
import net.pokeranalytics.android.model.comparison.Comparator |
|
|
|
import net.pokeranalytics.android.model.comparison.Comparator |
|
|
|
|
|
|
|
import net.pokeranalytics.android.model.comparison.combined |
|
|
|
import net.pokeranalytics.android.model.filter.QueryCondition |
|
|
|
import net.pokeranalytics.android.model.filter.QueryCondition |
|
|
|
import net.pokeranalytics.android.ui.fragment.components.SessionObserverFragment |
|
|
|
import net.pokeranalytics.android.ui.fragment.components.SessionObserverFragment |
|
|
|
import net.pokeranalytics.android.ui.view.CalendarTabs |
|
|
|
import net.pokeranalytics.android.ui.view.CalendarTabs |
|
|
|
@ -87,19 +88,23 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val comparator = Comparator.MONTH // returns all months |
|
|
|
// compute per cell (year x month) |
|
|
|
|
|
|
|
// build conditions array and save it |
|
|
|
val conditions = comparator.queryConditions |
|
|
|
val conditions = listOf(Comparator.YEAR, Comparator.MONTH_OF_YEAR).combined() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compute at index |
|
|
|
conditions.forEach { |
|
|
|
conditions.forEach { |
|
|
|
|
|
|
|
Calculator.computeStatsWithComparators(realm, conditions = it, options = Calculator.Options()) |
|
|
|
val realm = getRealm() |
|
|
|
|
|
|
|
Calculator.computeStatsWithComparators(realm, conditions = listOf(it), options = Calculator.Options()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compute per cell (year) |
|
|
|
|
|
|
|
// build year conditions array and save it |
|
|
|
|
|
|
|
val yearConditions = listOf(Comparator.YEAR) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compute at index |
|
|
|
|
|
|
|
yearConditions .forEach { |
|
|
|
|
|
|
|
Calculator.computeStatsWithComparators(realm, conditions = it.queryConditions, options = Calculator.Options()) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override val coroutineContext: CoroutineContext |
|
|
|
override val coroutineContext: CoroutineContext |
|
|
|
|