Located under task_manager/data/, this layer handles data storage and retrieval.
TaskDao: Data Access Object (DAO) interface for database queries.TaskDatabase: Singleton Room Database instance.TaskDatabase_Impl: Auto-generated implementation forTaskDatabase.
Task: Data class defining the attributes of a task.
TaskRepository: Mediates between the DAO and ViewModels.
A repository pattern is used to provide a clean API for data access, ensuring separation of concerns between the database and business logic.
Located under task_manager/domain/, this layer contains business logic.
NotificationWorker: Handles task notifications using WorkManager.ScheduleWorkManager: Manages background task scheduling.
Keeping business logic separate from UI ensures better testability and maintainability.
Located under task_manager/ui/, this layer handles user interaction and presentation.
TaskAdapter: RecyclerView adapter for displaying tasks.TaskDiffCallback: Optimizes updates by checking item differences.
HomeFragment: Displays tasks and provides sorting/filtering.CreateFragment: Handles task creation.SettingsFragment: Manages app settings.TaskViewFragment: Displays detailed task information.
The app follows the MVVM pattern, with Fragments acting as UI components that observe data from ViewModels.
TaskViewModel: Handles task-related operations (add, delete, update).TaskViewModelFactory: Provides ViewModel instances with dependencies.
ViewModels decouple UI from business logic and ensure data persistence during configuration changes.