Skip to content

Commit 4bdcde7

Browse files
committed
refactor: extract graph period label
1 parent 319e79b commit 4bdcde7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package to.bitkit.ext
2+
3+
import androidx.annotation.StringRes
4+
import to.bitkit.R
5+
import to.bitkit.data.dto.price.GraphPeriod
6+
7+
@StringRes
8+
fun GraphPeriod.labelRes(): Int = when (this) {
9+
GraphPeriod.ONE_DAY -> R.string.appwidget__price__day
10+
GraphPeriod.ONE_WEEK -> R.string.appwidget__price__week
11+
GraphPeriod.ONE_MONTH -> R.string.appwidget__price__month
12+
GraphPeriod.ONE_YEAR -> R.string.appwidget__price__year
13+
}

0 commit comments

Comments
 (0)