|
|
|
@ -20,7 +20,6 @@ import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment |
|
|
|
import net.pokeranalytics.android.ui.graph.PALineDataSet |
|
|
|
import net.pokeranalytics.android.ui.graph.PALineDataSet |
|
|
|
import net.pokeranalytics.android.ui.graph.setStyle |
|
|
|
import net.pokeranalytics.android.ui.graph.setStyle |
|
|
|
import net.pokeranalytics.android.ui.view.LegendView |
|
|
|
import net.pokeranalytics.android.ui.view.LegendView |
|
|
|
import timber.log.Timber |
|
|
|
|
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
import kotlin.coroutines.CoroutineContext |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -97,7 +96,6 @@ class GraphFragment : PokerAnalyticsFragment(), OnChartValueSelectedListener, Co |
|
|
|
* Init UI |
|
|
|
* Init UI |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun initUI() { |
|
|
|
private fun initUI() { |
|
|
|
Timber.d("initUI") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parentActivity = activity as PokerAnalyticsActivity |
|
|
|
parentActivity = activity as PokerAnalyticsActivity |
|
|
|
parentActivity.title = stat.localizedTitle(requireContext()) |
|
|
|
parentActivity.title = stat.localizedTitle(requireContext()) |
|
|
|
@ -118,7 +116,6 @@ class GraphFragment : PokerAnalyticsFragment(), OnChartValueSelectedListener, Co |
|
|
|
* Load graph |
|
|
|
* Load graph |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun loadGraph() { |
|
|
|
private fun loadGraph() { |
|
|
|
Timber.d("loadGraph") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
val graphEntries = when (aggregationType) { |
|
|
|
val graphEntries = when (aggregationType) { |
|
|
|
AggregationType.SESSION, AggregationType.DURATION -> selectedReport.results.firstOrNull()?.defaultStatEntries(stat) |
|
|
|
AggregationType.SESSION, AggregationType.DURATION -> selectedReport.results.firstOrNull()?.defaultStatEntries(stat) |
|
|
|
@ -167,12 +164,11 @@ class GraphFragment : PokerAnalyticsFragment(), OnChartValueSelectedListener, Co |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set data |
|
|
|
* Set data |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun setData(report: Report, aggregationType: AggregationType) { |
|
|
|
fun setData(report: Report, stat: Stat, aggregationType: AggregationType) { |
|
|
|
Timber.d("setData") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.selectedReport = report |
|
|
|
this.selectedReport = report |
|
|
|
this.aggregationType = aggregationType |
|
|
|
this.aggregationType = aggregationType |
|
|
|
this.stat = report.options.displayedStats.first() |
|
|
|
this.stat = stat |
|
|
|
|
|
|
|
|
|
|
|
if (isAdded && !isDetached) { |
|
|
|
if (isAdded && !isDetached) { |
|
|
|
loadGraph() |
|
|
|
loadGraph() |
|
|
|
|