|
|
|
@ -5,16 +5,19 @@ import android.view.LayoutInflater |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import android.view.ViewGroup |
|
|
|
import android.view.ViewGroup |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
|
|
|
|
import io.realm.Realm |
|
|
|
import kotlinx.android.synthetic.main.fragment_calendar.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_calendar.* |
|
|
|
import kotlinx.android.synthetic.main.fragment_stats.recyclerView |
|
|
|
import kotlinx.android.synthetic.main.fragment_stats.recyclerView |
|
|
|
import kotlinx.coroutines.CoroutineScope |
|
|
|
import kotlinx.coroutines.* |
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.R |
|
|
|
import net.pokeranalytics.android.calculus.Calculator |
|
|
|
import net.pokeranalytics.android.calculus.Calculator |
|
|
|
|
|
|
|
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.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 |
|
|
|
|
|
|
|
import java.util.* |
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -84,7 +87,26 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
print(it.computedStat(Stat.NETRESULT)?.value) |
|
|
|
print(it.computedStat(Stat.NETRESULT)?.value) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compute per cell (year x month) |
|
|
|
|
|
|
|
// build conditions array and save it |
|
|
|
|
|
|
|
val conditions = listOf(Comparator.YEAR, Comparator.MONTH_OF_YEAR).combined() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// compute at index |
|
|
|
|
|
|
|
conditions.forEach { |
|
|
|
|
|
|
|
Calculator.computeStatsWithComparators(realm, conditions = 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 |
|
|
|
get() = Dispatchers.Main |
|
|
|
get() = Dispatchers.Main |
|
|
|
@ -157,7 +179,6 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|