Compare commits

..
11 Commits
Author SHA1 Message Date
kfj001 eaaeb7fa35 fixes buttons on countdown screen 2026-05-26 13:24:08 -07:00
kfj001 6ba2f2cfdf fixes beeping to 3.2.1 cycle 2026-05-26 12:31:28 -07:00
kfj001andClaude Opus 4.7 51c7fa1464 Theme timer ring colors green instead of hardcoded purple
CountdownCanvasView ring progress and track now use themed color
resources (md_color_ring_progress/md_color_ring_track) instead of
hardcoded Material3 purple, so they stay green in both light and dark mode.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:52:50 -07:00
kfj001andClaude Opus 4.7 df9d92f116 Fix chip selection color green with correct color selector approach
- Replace broken chipBackground theme style with a color state-list
  selector (res/color/chip_duration_bg.xml) using chipBackgroundColor
  attribute directly on each Chip
- Green (#81C784) when checked, light gray (#E8E8E8) when unchecked
- Add minWidth="56dp" to give chips proper width

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:40:32 -07:00
kfj001 5b517f39d6 Merge branch 'worktree-soft-floating-stroustrup' into fat_square_interesting_buttons 2026-05-26 11:24:10 -07:00
kfj001andClaude Opus 4.7 b20208fb40 Make chip selection background green to match app theme
Add custom chip_duration_bg selector drawable (green when checked,
light gray when unchecked) and wire it through a ChipDuration chipStyle
in the theme. This overrides Material3's default purple checked state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:24:10 -07:00
kfj001 9b733f2102 Merge branch 'worktree-soft-floating-stroustrup' into fat_square_interesting_buttons 2026-05-26 11:12:58 -07:00
kfj001andClaude Opus 4.7 0738fc466e Make chip selection color green to match app theme
Add colorPrimaryContainer and set it to the green shade used throughout the app.
This fixes the purplish checked state on Material3 suggestion chips.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:12:58 -07:00
kfj001 7491083e6a Merge branch 'worktree-soft-floating-stroustrup' into fat_square_interesting_buttons 2026-05-26 11:04:36 -07:00
kfj001andClaude Opus 4.7 13786f6c8e Make dropdown arrow white for better visibility on green button
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:04:35 -07:00
kfj001andClaude Opus 4.7 92952a2cf2 Convert timeout selector button from oval to rectangular pill shape
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 08:50:44 -07:00
14 changed files with 62 additions and 36 deletions
@@ -24,12 +24,12 @@ class CountdownCanvasView @JvmOverloads constructor(
isFakeBoldText = false
}
private val ringPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
color = Color.parseColor("#6750A4")
color = ContextCompat.getColor(context, R.color.md_color_ring_progress)
style = Paint.Style.STROKE
strokeWidth = 16f
}
private val ringBgPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
color = Color.parseColor("#D0BCFF")
color = ContextCompat.getColor(context, R.color.md_color_ring_track)
style = Paint.Style.STROKE
strokeWidth = 16f
}
@@ -18,8 +18,8 @@ class CountdownDialog(
private val prefs: SharedPreferences
) : Dialog(context) {
private lateinit var cvCountdown: CountdownCanvasView
private lateinit var btnStop: Button
private lateinit var btnRestart: Button
private lateinit var btnStop: View
private lateinit var btnRestart: View
private lateinit var btnDismiss: Button
private var timer: CountDownTimer? = null
private var toneGenerator: ToneGenerator? = null
@@ -61,14 +61,10 @@ class CountdownDialog(
val progress = millisUntilFinished.toFloat() / durationMillis
cvCountdown.setProgress(progress)
if (millisUntilFinished >= durationMillis) {
cvCountdown.setText(context.getString(R.string.countdown_text))
} else {
val secondsLeft = (millisUntilFinished / 1000).toInt() + 1
cvCountdown.setText(secondsLeft.toString())
}
val secondsLeft = (millisUntilFinished / 1000).toInt() + 1
cvCountdown.setText(secondsLeft.toString())
if (millisUntilFinished <= 3000 && millisUntilFinished > 1000) {
if (secondsLeft >= 1 && secondsLeft <= 3) {
playTone(ToneGenerator.TONE_PROP_BEEP)
if (prefs.getBoolean("vibration", true)) {
vibrator?.vibrate(50)
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="#81C784" />
<item android:color="#E8E8E8" />
</selector>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size android:width="120dp" android:height="120dp" />
android:shape="rectangle">
<corners android:radius="40dp" />
<gradient
android:angle="270"
android:startColor="#81C784"
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size android:width="120dp" android:height="120dp" />
android:shape="rectangle">
<corners android:radius="40dp" />
<gradient
android:angle="270"
android:startColor="#C8E6C9"
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size android:width="120dp" android:height="120dp" />
android:shape="rectangle">
<corners android:radius="40dp" />
<gradient
android:angle="270"
android:startColor="#66BB6A"
@@ -4,6 +4,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#6750A4"
android:fillColor="#FFFFFF"
android:pathData="M7.41,8.59L12,13.17l4.59,-4.58L18,10l-6,6 -6,-6z"/>
</vector>
+10 -2
View File
@@ -112,8 +112,8 @@
<Button
android:id="@+id/btnDurationLabel"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_width="180dp"
android:layout_height="80dp"
android:layout_marginTop="32dp"
android:background="@drawable/btn_duration_selector"
android:text="@string/start_timer"
@@ -146,6 +146,8 @@
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="56dp"
app:chipBackgroundColor="@color/chip_duration_bg"
android:text="5s" />
<com.google.android.material.chip.Chip
@@ -153,7 +155,9 @@
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="56dp"
android:checked="true"
app:chipBackgroundColor="@color/chip_duration_bg"
android:text="10s" />
<com.google.android.material.chip.Chip
@@ -161,6 +165,8 @@
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="56dp"
app:chipBackgroundColor="@color/chip_duration_bg"
android:text="15s" />
<com.google.android.material.chip.Chip
@@ -168,6 +174,8 @@
style="@style/Widget.Material3.Chip.Suggestion.Elevated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="56dp"
app:chipBackgroundColor="@color/chip_duration_bg"
android:text="30s" />
</com.google.android.material.chip.ChipGroup>
</HorizontalScrollView>
+24 -16
View File
@@ -26,33 +26,41 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
<FrameLayout
android:id="@+id/btnStop"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginEnd="16dp"
android:background="@drawable/btn_stop_selector"
android:drawableTop="@drawable/ic_stop_square"
android:gravity="center"
android:padding="16dp"
android:text="Stop"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:textStyle="bold" />
android:clickable="true"
android:focusable="true">
<Button
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:contentDescription="@string/stop_timer"
android:src="@drawable/ic_stop_square" />
</FrameLayout>
<FrameLayout
android:id="@+id/btnRestart"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="16dp"
android:background="@drawable/btn_restart_selector"
android:drawableTop="@drawable/ic_refresh_square"
android:gravity="center"
android:padding="16dp"
android:text="Restart"
android:textColor="#FFFFFF"
android:textSize="14sp"
android:textStyle="bold" />
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:contentDescription="@string/restart_timer"
android:src="@drawable/ic_refresh_square" />
</FrameLayout>
</LinearLayout>
+2
View File
@@ -2,4 +2,6 @@
<resources>
<color name="color_gradient_start">#1B3A1B</color>
<color name="color_gradient_end">#0D1F0D</color>
<color name="md_color_ring_progress">#A5D6A7</color>
<color name="md_color_ring_track">#2E7D32</color>
</resources>
+1
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="md_theme_dark_primary">#A5D6A7</color>
<color name="md_theme_dark_primaryContainer">#2E7D32</color>
<color name="md_theme_dark_secondary">#869F7C</color>
<style name="Theme.CountdownTimer" parent="Theme.Material3.DayNight.NoActionBar">
+2
View File
@@ -3,4 +3,6 @@
<color name="color_gradient_start">#E8F5E9</color>
<color name="color_gradient_end">#C8E6C9</color>
<color name="color_icon_tint">#2E7D32</color>
<color name="md_color_ring_progress">#2E7D32</color>
<color name="md_color_ring_track">#81C784</color>
</resources>
+2
View File
@@ -11,4 +11,6 @@
<string name="settings">Settings</string>
<string name="vibration">Vibration</string>
<string name="sounds">Sounds</string>
<string name="stop_timer">Stop Timer</string>
<string name="restart_timer">Restart Timer</string>
</resources>
+2
View File
@@ -1,12 +1,14 @@
<resources>
<style name="Theme.CountdownTimer" parent="Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/md_theme_light_primary</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer</item>
<item name="colorSecondary">@color/md_theme_light_secondary</item>
<item name="android:statusBarColor">@color/color_gradient_start</item>
<item name="android:windowLightStatusBar">true</item>
</style>
<color name="md_theme_light_primary">#2E7D32</color>
<color name="md_theme_light_primaryContainer">#81C784</color>
<color name="md_theme_light_secondary">#4C6842</color>
<color name="md_theme_light_surface">#F1F8E9</color>
</resources>