|
|
|
|
@ -15,11 +15,11 @@ import kotlinx.coroutines.Dispatchers |
|
|
|
|
import kotlinx.coroutines.GlobalScope |
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.calculus.calcul.* |
|
|
|
|
import net.pokeranalytics.android.calculus.AggregationType |
|
|
|
|
import net.pokeranalytics.android.calculus.Calculator |
|
|
|
|
import net.pokeranalytics.android.calculus.Report |
|
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
|
import net.pokeranalytics.android.calculus.calcul.* |
|
|
|
|
import net.pokeranalytics.android.databinding.FragmentProgressReportBinding |
|
|
|
|
import net.pokeranalytics.android.exceptions.PAIllegalStateException |
|
|
|
|
import net.pokeranalytics.android.model.combined |
|
|
|
|
@ -82,12 +82,6 @@ class ProgressReportFragment : AbstractReportFragment() { |
|
|
|
|
|
|
|
|
|
override fun onDestroyView() { |
|
|
|
|
|
|
|
|
|
// childFragmentManager.findFragmentByTag(GRAPH_TAG)?.let { fragment -> |
|
|
|
|
// val fragmentTransaction = childFragmentManager.beginTransaction() |
|
|
|
|
// fragmentTransaction.remove(fragment) |
|
|
|
|
// fragmentTransaction.commit() |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
AppReviewManager.requestReview() |
|
|
|
|
|
|
|
|
|
super.onDestroyView() |
|
|
|
|
@ -176,22 +170,23 @@ class ProgressReportFragment : AbstractReportFragment() { |
|
|
|
|
|
|
|
|
|
val realm = Realm.getDefaultInstance() |
|
|
|
|
|
|
|
|
|
val group = selectedReport.results.first().group |
|
|
|
|
|
|
|
|
|
val report = Calculator.computeStatsWithEvolutionByAggregationType(realm, stat, group, aggregationType) |
|
|
|
|
reports[aggregationType] = report |
|
|
|
|
selectedReport.results.firstOrNull()?.group?.let { group -> |
|
|
|
|
val report = Calculator.computeStatsWithEvolutionByAggregationType(realm, stat, group, aggregationType) |
|
|
|
|
reports[aggregationType] = report |
|
|
|
|
|
|
|
|
|
realm.close() |
|
|
|
|
realm.close() |
|
|
|
|
|
|
|
|
|
val e = Date() |
|
|
|
|
val duration = (e.time - s.time) / 1000.0 |
|
|
|
|
Timber.d(">>> ended in $duration seconds") |
|
|
|
|
val e = Date() |
|
|
|
|
val duration = (e.time - s.time) / 1000.0 |
|
|
|
|
Timber.d(">>> ended in $duration seconds") |
|
|
|
|
|
|
|
|
|
launch(Dispatchers.Main) { |
|
|
|
|
setGraphData(report, aggregationType) |
|
|
|
|
progressBar.hideWithAnimation() |
|
|
|
|
graphContainer.showWithAnimation() |
|
|
|
|
launch(Dispatchers.Main) { |
|
|
|
|
setGraphData(report, aggregationType) |
|
|
|
|
progressBar.hideWithAnimation() |
|
|
|
|
graphContainer.showWithAnimation() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|