Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
822d6fc1b1 | ||
|
|
b78b2109a7 | ||
|
|
2701bd22dd | ||
|
|
1273be03f2 | ||
|
|
cb5c9dc547 | ||
|
|
e00de3d340 | ||
|
|
79afe50955 |
@@ -1,10 +1,11 @@
|
|||||||
package com.example.countdowntimer
|
package com.example.countdowntimer
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import android.graphics.Canvas
|
import android.graphics.Canvas
|
||||||
|
import android.graphics.RectF
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.Paint
|
import android.graphics.Paint
|
||||||
import android.graphics.RectF
|
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
|
||||||
@@ -17,8 +18,8 @@ class CountdownCanvasView @JvmOverloads constructor(
|
|||||||
private var textToDraw: String = ""
|
private var textToDraw: String = ""
|
||||||
private var progressFraction: Float = 1.0f
|
private var progressFraction: Float = 1.0f
|
||||||
private val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
private val paint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||||
color = Color.parseColor("#6750A4")
|
color = ContextCompat.getColor(context, R.color.md_theme_light_primary)
|
||||||
textSize = 180f
|
textSize = 180f // Roughly equivalent to 72sp depending on density
|
||||||
textAlign = Paint.Align.CENTER
|
textAlign = Paint.Align.CENTER
|
||||||
isFakeBoldText = false
|
isFakeBoldText = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="color_gradient_start">#2E1A47</color>
|
<color name="color_gradient_start">#1B3A1B</color>
|
||||||
<color name="color_gradient_end">#1B0B2E</color>
|
<color name="color_gradient_end">#0D1F0D</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
<color name="md_theme_dark_primary">#A5D6A7</color>
|
||||||
|
<color name="md_theme_dark_secondary">#869F7C</color>
|
||||||
|
|
||||||
<style name="Theme.CountdownTimer" parent="Theme.Material3.DayNight.NoActionBar">
|
<style name="Theme.CountdownTimer" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<item name="colorPrimary">@color/md_theme_light_primary</item>
|
<item name="colorPrimary">@color/md_theme_dark_primary</item>
|
||||||
<item name="colorSecondary">@color/md_theme_light_secondary</item>
|
<item name="colorSecondary">@color/md_theme_dark_secondary</item>
|
||||||
<item name="android:statusBarColor">@color/color_gradient_start</item>
|
<item name="android:statusBarColor">@color/color_gradient_start</item>
|
||||||
<item name="android:windowLightStatusBar">false</item>
|
<item name="android:windowLightStatusBar">false</item>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="color_gradient_start">#F3E5F5</color>
|
<color name="color_gradient_start">#E8F5E9</color>
|
||||||
<color name="color_gradient_end">#E1BEE7</color>
|
<color name="color_gradient_end">#C8E6C9</color>
|
||||||
<color name="color_icon_tint">#6750A4</color>
|
<color name="color_icon_tint">#2E7D32</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<item name="android:windowLightStatusBar">true</item>
|
<item name="android:windowLightStatusBar">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<color name="md_theme_light_primary">#6750A4</color>
|
<color name="md_theme_light_primary">#2E7D32</color>
|
||||||
<color name="md_theme_light_secondary">#625B71</color>
|
<color name="md_theme_light_secondary">#4C6842</color>
|
||||||
<color name="md_theme_light_surface">#FEF7FF</color>
|
<color name="md_theme_light_surface">#F1F8E9</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user