summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/app/src/main/java/org/terst/doot/widget/ui/WidgetTextSize.kt6
-rw-r--r--android/app/src/test/java/org/terst/doot/widget/ui/WidgetTextSizeTest.kt12
2 files changed, 9 insertions, 9 deletions
diff --git a/android/app/src/main/java/org/terst/doot/widget/ui/WidgetTextSize.kt b/android/app/src/main/java/org/terst/doot/widget/ui/WidgetTextSize.kt
index 1e8ecab..1083062 100644
--- a/android/app/src/main/java/org/terst/doot/widget/ui/WidgetTextSize.kt
+++ b/android/app/src/main/java/org/terst/doot/widget/ui/WidgetTextSize.kt
@@ -17,9 +17,9 @@ enum class WidgetTextSize(
val contentScale: Float,
val contentWeightBump: Int
) {
- SMALL(1.15f, 1, 1.0f, 0),
- NORMAL(1.15f, 1, 1.15f, 1),
- LARGE(1.3f, 2, 1.3f, 2);
+ SMALL(1.15f, 1, 0.95f, 0),
+ NORMAL(1.15f, 1, 1.0925f, 1),
+ LARGE(1.3f, 2, 1.235f, 2);
companion object {
fun fromPref(raw: String?): WidgetTextSize =
diff --git a/android/app/src/test/java/org/terst/doot/widget/ui/WidgetTextSizeTest.kt b/android/app/src/test/java/org/terst/doot/widget/ui/WidgetTextSizeTest.kt
index 7f3bcfc..643a2e3 100644
--- a/android/app/src/test/java/org/terst/doot/widget/ui/WidgetTextSizeTest.kt
+++ b/android/app/src/test/java/org/terst/doot/widget/ui/WidgetTextSizeTest.kt
@@ -7,8 +7,8 @@ import org.junit.Test
class WidgetTextSizeTest {
@Test
- fun `SMALL keeps content at base size and weight, unchanged`() {
- assertEquals(14f, WidgetTextSize.SMALL.scaledContentSize(14).value, 0.001f)
+ fun `SMALL scales content by 0_95x and keeps weight unchanged`() {
+ assertEquals(13.3f, WidgetTextSize.SMALL.scaledContentSize(14).value, 0.001f)
assertEquals(FontWeight.Normal, WidgetTextSize.SMALL.scaledContentWeight(FontWeight.Normal))
}
@@ -19,15 +19,15 @@ class WidgetTextSizeTest {
}
@Test
- fun `NORMAL scales size by 1_15x and bumps weight one step`() {
- assertEquals(16.1f, WidgetTextSize.NORMAL.scaledContentSize(14).value, 0.001f)
+ fun `NORMAL scales content by 1_0925x and bumps weight one step`() {
+ assertEquals(15.295f, WidgetTextSize.NORMAL.scaledContentSize(14).value, 0.001f)
assertEquals(FontWeight.Medium, WidgetTextSize.NORMAL.scaledContentWeight(FontWeight.Normal))
assertEquals(FontWeight.Bold, WidgetTextSize.NORMAL.scaledHeaderWeight(FontWeight.Medium))
}
@Test
- fun `LARGE scales size by 1_3x and bumps weight two steps`() {
- assertEquals(18.2f, WidgetTextSize.LARGE.scaledContentSize(14).value, 0.001f)
+ fun `LARGE scales content by 1_235x and bumps weight two steps`() {
+ assertEquals(17.29f, WidgetTextSize.LARGE.scaledContentSize(14).value, 0.001f)
assertEquals(FontWeight.Bold, WidgetTextSize.LARGE.scaledContentWeight(FontWeight.Normal))
}