|
|
|
@ -6,6 +6,7 @@ import net.pokeranalytics.android.exceptions.FormattingException |
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
|
|
|
import net.pokeranalytics.android.ui.view.RowViewType |
|
|
|
import net.pokeranalytics.android.ui.view.RowViewType |
|
|
|
import net.pokeranalytics.android.util.FormatUtils |
|
|
|
import net.pokeranalytics.android.util.FormatUtils |
|
|
|
|
|
|
|
import net.pokeranalytics.android.util.NULL_TEXT |
|
|
|
import net.pokeranalytics.android.util.formatted |
|
|
|
import net.pokeranalytics.android.util.formatted |
|
|
|
import net.pokeranalytics.android.util.formattedHourlyDuration |
|
|
|
import net.pokeranalytics.android.util.formattedHourlyDuration |
|
|
|
|
|
|
|
|
|
|
|
@ -126,6 +127,10 @@ class ComputedStat(stat: Stat, value: Double) { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun format(context: Context): TextFormat { |
|
|
|
fun format(context: Context): TextFormat { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.value.isNaN()) { |
|
|
|
|
|
|
|
return TextFormat(NULL_TEXT, R.color.white) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
when (this.stat) { |
|
|
|
when (this.stat) { |
|
|
|
// Amounts + red/green |
|
|
|
// Amounts + red/green |
|
|
|
Stat.NETRESULT, Stat.HOURLY_RATE, Stat.AVERAGE, Stat.NET_BB_PER_100_HANDS, Stat.HOURLY_RATE_BB, |
|
|
|
Stat.NETRESULT, Stat.HOURLY_RATE, Stat.AVERAGE, Stat.NET_BB_PER_100_HANDS, Stat.HOURLY_RATE_BB, |
|
|
|
|