A simple Android Timer app in Kotlin, which allows users to set a countdown timer, start/pause/stop it, and adjust the timer dynamically.
- Fragments: The app uses multiple fragments (
FragmentForm
for input andFragmentMain
for displaying and controlling the countdown) to promote a modular design, which allows for better reuse and maintainability. - Object-Oriented Design: The app follows object-oriented principles like encapsulation, where the
CountdownTimerManager
class encapsulates all the timer-related logic. It also employs separation of concerns by keeping the UI logic separate from the business logic, ensuring the app is modular and easier to extend or maintain.
MainActivity
: Initializes the app and displays theFragmentForm
.FragmentForm
: UI to set timer duration in minutes and seconds.FragmentMain
: Displays the timer and allows controls for starting, pausing, stopping, and adjusting time.CountdownTimerManager
: Handles all the timer logic - start, pause, stop, adjust time.
- Set Timer: Input minutes and seconds.
- Start/Pause/Stop: Control the countdown.
- Dynamically Adjust Time: Add or subtract time in predefined increments.
- Notifications: Alarm and toast when time is up.