|
|
|
@ -5,20 +5,16 @@ 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.CoroutineScope |
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
import kotlinx.coroutines.GlobalScope |
|
|
|
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
|
|
|
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.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.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 timber.log.Timber |
|
|
|
|
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -88,20 +84,6 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
print(it.computedStat(Stat.NETRESULT)?.value) |
|
|
|
print(it.computedStat(Stat.NETRESULT)?.value) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val comparator = Comparator.MONTH // returns all months |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val conditions = comparator.queryConditions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conditions.forEach { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val realm = getRealm() |
|
|
|
|
|
|
|
Calculator.computeStatsWithComparators(realm, conditions = listOf(it), options = Calculator.Options()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override val coroutineContext: CoroutineContext |
|
|
|
override val coroutineContext: CoroutineContext |
|
|
|
@ -110,6 +92,7 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
|
|
|
|
|
|
|
|
private fun launchStatComputation() { |
|
|
|
private fun launchStatComputation() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
val comparator = Comparator.YEAR // returns all months |
|
|
|
val comparator = Comparator.YEAR // returns all months |
|
|
|
|
|
|
|
|
|
|
|
GlobalScope.launch { |
|
|
|
GlobalScope.launch { |
|
|
|
@ -129,6 +112,7 @@ class CalendarFragment : SessionObserverFragment(), CoroutineScope { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|
conditions.forEach { |
|
|
|
conditions.forEach { |
|
|
|
|