|
|
|
@ -3,7 +3,6 @@ package net.pokeranalytics.android.ui.graph |
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
import com.github.mikephil.charting.data.Entry |
|
|
|
import com.github.mikephil.charting.data.Entry |
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
import net.pokeranalytics.android.calculus.Stat |
|
|
|
import net.pokeranalytics.android.model.interfaces.Identifiable |
|
|
|
|
|
|
|
import net.pokeranalytics.android.ui.fragment.GraphFragment |
|
|
|
import net.pokeranalytics.android.ui.fragment.GraphFragment |
|
|
|
import net.pokeranalytics.android.ui.view.DefaultLegendValues |
|
|
|
import net.pokeranalytics.android.ui.view.DefaultLegendValues |
|
|
|
import net.pokeranalytics.android.ui.view.LegendContent |
|
|
|
import net.pokeranalytics.android.ui.view.LegendContent |
|
|
|
@ -23,16 +22,13 @@ interface GraphUnderlyingEntry { |
|
|
|
): LegendContent { |
|
|
|
): LegendContent { |
|
|
|
|
|
|
|
|
|
|
|
val leftName = stat.localizedTitle(context) |
|
|
|
val leftName = stat.localizedTitle(context) |
|
|
|
return when (stat) { |
|
|
|
val totalStatValue = stat.format(entry.y.toDouble(), currency = null) |
|
|
|
Stat.NUMBER_OF_SETS, Stat.NUMBER_OF_GAMES, Stat.WIN_RATIO, Stat.HOURLY_DURATION, Stat.AVERAGE_HOURLY_DURATION -> { |
|
|
|
|
|
|
|
val totalStatValue = stat.format(entry.y.toDouble(), currency = null) |
|
|
|
return if (stat.legendHideRightValue) { |
|
|
|
DefaultLegendValues(this.entryTitle(context), totalStatValue, leftName = leftName) |
|
|
|
DefaultLegendValues(this.entryTitle(context), totalStatValue, leftName = leftName) |
|
|
|
} |
|
|
|
} else { |
|
|
|
else -> { |
|
|
|
val entryValue = this.formattedValue(stat) |
|
|
|
val entryValue = this.formattedValue(stat) |
|
|
|
DefaultLegendValues(this.entryTitle(context), entryValue, totalStatValue, leftName = leftName) |
|
|
|
val totalStatValue = stat.format(entry.y.toDouble(), currency = null) |
|
|
|
|
|
|
|
DefaultLegendValues(this.entryTitle(context), entryValue, totalStatValue, leftName = leftName) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|