Skip to content

Commit a52f238

Browse files
committed
refactor: label method
1 parent d7bd73c commit a52f238

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

app/src/main/java/to/bitkit/appwidget/ui/theme/GlanceTextStyles.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ object GlanceTextStyles {
1010
val bodySSB = TextStyle(fontSize = 15.sp, fontWeight = FontWeight.Medium, color = GlanceColors.textPrimary)
1111
val bodySB = TextStyle(fontSize = 15.sp, fontWeight = FontWeight.Bold, color = GlanceColors.textPrimary)
1212
val captionB = TextStyle(fontSize = 13.sp, fontWeight = FontWeight.Medium, color = GlanceColors.textSecondary)
13-
val captionUp = TextStyle(fontSize = 13.sp, fontWeight = FontWeight.Medium, color = GlanceColors.textSecondary)
1413
val title22 = TextStyle(fontSize = 22.sp, fontWeight = FontWeight.Bold, color = GlanceColors.textPrimary)
1514
val headline34 = TextStyle(fontSize = 34.sp, fontWeight = FontWeight.Bold, color = GlanceColors.textPrimary)
1615
val headlineChange22 = TextStyle(fontSize = 22.sp, fontWeight = FontWeight.Bold)

app/src/main/java/to/bitkit/ui/screens/widgets/price/PriceEditScreen.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
3131
import to.bitkit.R
3232
import to.bitkit.data.dto.price.GraphPeriod
3333
import to.bitkit.data.dto.price.TradingPair
34+
import to.bitkit.ext.labelRes
3435
import to.bitkit.models.widget.PricePreferences
3536
import to.bitkit.ui.components.BodySSB
3637
import to.bitkit.ui.components.Caption13Up
@@ -217,14 +218,7 @@ private fun SelectableRow(
217218
}
218219

219220
@Composable
220-
fun GraphPeriod.label(): String = stringResource(
221-
when (this) {
222-
GraphPeriod.ONE_DAY -> R.string.appwidget__price__day
223-
GraphPeriod.ONE_WEEK -> R.string.appwidget__price__week
224-
GraphPeriod.ONE_MONTH -> R.string.appwidget__price__month
225-
GraphPeriod.ONE_YEAR -> R.string.appwidget__price__year
226-
},
227-
)
221+
fun GraphPeriod.label(): String = stringResource(labelRes())
228222

229223
@Preview(showSystemUi = true)
230224
@Composable

0 commit comments

Comments
 (0)