migrate timer to ForegroundService for background survival

Move CountDownTimer logic from a Dialog into a ForegroundService so
the timer survives when the user tabs away or the activity is
destroyed. The activity becomes a thin UI projection bound to the
service via TimerStateListener callbacks.

- Create CountdownService with notification, state persistence,
  and ToneGenerator/Vibrator ownership
- Persist timer state to SharedPreferences for process death recovery
- Add notification with progress bar and Stop/Restart actions
- Embed countdown UI in activity_main.xml alongside picker UI
- Delete CountdownDialog and dialog_countdown.xml
- Update AndroidManifest with foreground service permissions
This commit is contained in:
2026-06-23 01:49:11 +00:00
parent da29e51993
commit d7ce314c22
9 changed files with 697 additions and 438 deletions
+2 -1
View File
@@ -9,7 +9,8 @@
"felipecaslazana.vscode-android-logcat",
"ms-azuretools.vscode-docker",
"fwcd.kotlin",
"vscjava.vscode-java-pack"
"vscjava.vscode-java-pack",
"Anthropic.claude-code"
]
}
},