|
|
|
|
@ -16,7 +16,6 @@ import kotlinx.coroutines.GlobalScope |
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.calculus.* |
|
|
|
|
import net.pokeranalytics.android.ui.activity.StatisticDetailsActivity.Companion.displayAggregationChoices |
|
|
|
|
import net.pokeranalytics.android.ui.activity.components.PokerAnalyticsActivity |
|
|
|
|
import net.pokeranalytics.android.ui.extensions.ChipGroupExtension |
|
|
|
|
import net.pokeranalytics.android.ui.extensions.hideWithAnimation |
|
|
|
|
@ -42,6 +41,7 @@ class StatisticDetailsFragment : PokerAnalyticsFragment() { |
|
|
|
|
|
|
|
|
|
private var reports: MutableMap<AggregationType, Report> = hashMapOf() |
|
|
|
|
private var stat: Stat = Stat.NET_RESULT |
|
|
|
|
private var displayAggregationChoices: Boolean = true |
|
|
|
|
|
|
|
|
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
|
|
|
|
return inflater.inflate(R.layout.fragment_statistic_details, container, false) |
|
|
|
|
@ -56,7 +56,6 @@ class StatisticDetailsFragment : PokerAnalyticsFragment() { |
|
|
|
|
* Init UI |
|
|
|
|
*/ |
|
|
|
|
private fun initUI() { |
|
|
|
|
Timber.d("initUI") |
|
|
|
|
|
|
|
|
|
parentActivity = activity as PokerAnalyticsActivity |
|
|
|
|
|
|
|
|
|
@ -110,22 +109,6 @@ class StatisticDetailsFragment : PokerAnalyticsFragment() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
StatisticDetailsActivity.parameters?.let { |
|
|
|
|
|
|
|
|
|
//TODO: Set in the function setData |
|
|
|
|
//stat = it.stat |
|
|
|
|
|
|
|
|
|
graphFragment.setData(report, aggregationType) |
|
|
|
|
|
|
|
|
|
//launchStatComputation(aggregationType) |
|
|
|
|
//graphFragment.setData(it.stat, it.computableGroup, it.report, StatisticDetailsActivity.displayAggregationChoices) |
|
|
|
|
StatisticDetailsActivity.parameters = null |
|
|
|
|
} ?: run { |
|
|
|
|
throw Exception("Missing graph parameters") |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -167,16 +150,15 @@ class StatisticDetailsFragment : PokerAnalyticsFragment() { |
|
|
|
|
/** |
|
|
|
|
* Set data |
|
|
|
|
*/ |
|
|
|
|
fun setData(stat: Stat, computableGroup: ComputableGroup, report: Report) { |
|
|
|
|
Timber.d("setData") |
|
|
|
|
fun setData(stat: Stat, computableGroup: ComputableGroup, report: Report, displayAggregationChoices: Boolean) { |
|
|
|
|
this.stat = stat |
|
|
|
|
this.computableGroup = computableGroup |
|
|
|
|
this.selectedReport = report |
|
|
|
|
this.displayAggregationChoices = displayAggregationChoices |
|
|
|
|
|
|
|
|
|
stat.aggregationTypes.firstOrNull()?.let { |
|
|
|
|
reports[it] = report |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |