|
|
|
@ -49,7 +49,7 @@ class LegendView : FrameLayout { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Set the stat data to the view |
|
|
|
* Set the stat data to the view |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun prepareWithStat(stat: Stat, counter: Int) { |
|
|
|
fun prepareWithStat(stat: Stat, counter: Int? = null) { |
|
|
|
|
|
|
|
|
|
|
|
if (stat.significantIndividualValue) { |
|
|
|
if (stat.significantIndividualValue) { |
|
|
|
this.stat1Name.text = stat.localizedTitle(context) |
|
|
|
this.stat1Name.text = stat.localizedTitle(context) |
|
|
|
@ -60,9 +60,12 @@ class LegendView : FrameLayout { |
|
|
|
this.stat2Value.isVisible = false |
|
|
|
this.stat2Value.isVisible = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val counterText = "$counter ${context.getString(R.string.sessions)}" |
|
|
|
counter?.let { |
|
|
|
|
|
|
|
val counterText = "$it ${context.getString(R.string.sessions)}" |
|
|
|
this.counter.text = counterText |
|
|
|
this.counter.text = counterText |
|
|
|
this.counter.isVisible = stat.shouldShowNumberOfSessions |
|
|
|
this.counter.isVisible = stat.shouldShowNumberOfSessions |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|