Android habit tracker app built with Kotlin and Jetpack Compose to help users build and maintain daily habits through streaks, categories, and progress tracking.
Android 7.0+ (API 24) required. Enable "Install from unknown sources" when prompted.
- ✅ Create and manage daily habits with custom categories
- ✅ Today view — focused overview of what's pending for the day
- ✅ Swipe to delete habits with smooth gesture interaction
- ✅ Edit habits inline without leaving context
- ✅ Filter habits by All / Pending / Completed
- ✅ Streak tracking — consecutive days of completing a habit
- ✅ Completion history persisted with Room Database
- ✅ Automatic daily habit reset at midnight via WorkManager
- ✅ Stats screen with progress indicators and completion rate
- ✅ Badges screen to showcase achievements
- ✅ Category-based color coding across all screens
- ✅ User profile — name, email and birth date persisted via DataStore
- ✅ Custom habit schedule — pick specific days of the week
- ✅ Language support — English 🇺🇸 and Portuguese 🇧🇷
- ✅ Personalized top bar — shows user name after profile is saved
- ✅ Clean dark-themed UI with Material Design 3
com.example.taskhabit/
│
├── 📱 HabitApplication.kt # @HiltAndroidApp + WorkManager daily reset
├── 📱 MainActivity.kt # Navigation host + language-aware CompositionLocalProvider
│
├── 🗄️ data/
│ ├── local/
│ │ ├── dao/ # Room DAOs
│ │ │ ├── HabitDao.kt
│ │ │ ├── CategoryDao.kt
│ │ │ ├── HabitCompletionDao.kt
│ │ │ └── StreakDao.kt
│ │ ├── database/
│ │ │ ├── HabitDatabase.kt # Room database + migrations
│ │ │ └── converter/
│ │ │ └── DateConverter.kt # TypeConverter for Date ↔ Long
│ │ └── entity/
│ │ ├── Habit.kt # frequency field (DAILY / custom days)
│ │ ├── Category.kt
│ │ ├── HabitCompletion.kt
│ │ └── Streak.kt
│ ├── preferences/
│ │ └── UserPreferencesRepository.kt # DataStore — profile + language
│ └── repository/
│ ├── HabitRepository.kt
│ ├── CategoryRepository.kt
│ ├── HabitCompletionRepository.kt
│ └── StreakRepository.kt
│
├── 🧩 domain/
│ └── model/
│ ├── HabitWithCategory.kt
│ └── HabitWithStreak.kt
│
├── 💉 di/
│ ├── AppModule.kt # Provides DataStore<Preferences>
│ └── DatabaseModule.kt # Provides DAOs, repositories
│
├── 🖼️ presentation/
│ ├── ui/
│ │ ├── components/
│ │ │ ├── BottomNavBar.kt # Localized bottom navigation
│ │ │ └── KineticTopAppBar.kt # Shows user name + avatar/settings nav
│ │ ├── screens/
│ │ │ ├── TodayScreen.kt # Daily focus view
│ │ │ ├── HabitsScreen.kt # Full habit list with swipe-to-delete
│ │ │ ├── AddHabitScreen.kt # Habit creation + custom day picker
│ │ │ ├── EditHabitScreen.kt # Habit editing form
│ │ │ ├── ProfileScreen.kt # User profile (name, email, birth date)
│ │ │ ├── SettingsScreen.kt # Language selection
│ │ │ ├── StatsScreen.kt # Progress and completion stats
│ │ │ └── BadgesScreen.kt # Achievements display
│ │ └── util/
│ │ └── HabitIconMapper.kt # Maps habit names to Material icons
│ ├── viewmodel/
│ │ ├── HabitViewModel.kt # Habit CRUD + toggle + streak logic
│ │ ├── CategoryViewModel.kt # Category list management
│ │ └── ProfileViewModel.kt # Profile + language management
│ └── worker/
│ └── ResetHabitsWorker.kt # WorkManager — resets habits at midnight
│
└── 🎨 ui/theme/
├── Color.kt
├── Strings.kt # EN and PT string sets + LocalStrings
├── Theme.kt
└── Type.kt
- MVVM Architecture — clear separation between UI and business logic
- Repository Pattern — single source of truth for each data domain
- Unidirectional Data Flow — state flows down via StateFlow, events flow up via lambdas
- Dependency Injection — Hilt wires all dependencies automatically
- Single Responsibility — each file has one focused purpose
| Technology | Version | Description |
|---|---|---|
| Kotlin | 2.0.21 | Modern, concise Android language |
| Jetpack Compose | BOM 2024.09 | Declarative and reactive UI toolkit |
| Material 3 | Latest | Google's latest design system |
| Room | 2.6.1 | SQLite abstraction with compile-time safety |
| DataStore | 1.1.1 | Jetpack key-value persistence (profile/lang) |
| Hilt | 2.56.2 | Compile-time dependency injection |
| WorkManager | 2.9.1 | Guaranteed background task scheduling |
| Navigation Compose | 2.8.9 | Type-safe in-app navigation |
| Coroutines | 1.7.3 | Asynchronous and concurrent programming |
| StateFlow / Flow | — | Reactive state and stream management |
| KSP | 2.0.21-1.0.26 | Annotation processing for Room and Hilt |
| Android SDK | 24+ | Compatible with 95%+ of active devices |
- Android Studio Hedgehog (2023.1.1) or higher
- JDK 17+
- Android SDK 36
- Physical device or emulator with API 24+
-
Clone the repository
git clone https://github.com/TallesGuerra/TaskHabit.git cd TaskHabit -
Open in Android Studio
- File → Open → Select the project folder
-
Sync dependencies
- Gradle will sync automatically on first open
-
Run the app
- Click Run
▶️ or pressShift + F10 - Select a device or emulator
- Click Run
- MVVM with
@HiltViewModelandStateFlowfor reactive, lifecycle-aware state - Room Database with entities, DAOs, TypeConverters, foreign keys, and schema migrations
- DataStore Preferences for lightweight persistence of user profile and language
- Hilt DI with
@Module,@Provides,@Singleton, and@ApplicationContext - WorkManager with
CoroutineWorkerfor reliable midnight habit resets - Jetpack Navigation with typed route arguments (
NavType.IntType) - CompositionLocalProvider for app-wide language injection without rebuilding the tree
- SwipeToDismissBox for gesture-based deletion with animated background
collectAsStateWithLifecycle()for safe, lifecycle-scoped Flow collection in Compose- Coroutines with
viewModelScope.launchfor all database and DataStore operations LazyColumnwithkeyparameter for efficient, animated list rendering- Modular and reusable Composable component architecture
- Habit CRUD (create, read, update, delete)
- Category system with color coding
- Today screen — daily focus view
- Swipe-to-delete with gesture animation
- Filter bar — All / Pending / Completed
- Room database with full persistence
- Streak tracking with completion history
- WorkManager — automatic daily reset at midnight
- Stats screen with progress indicators
- Badges screen
- MVVM + Repository + Hilt architecture
- User profile with name, email and birth date
- Language support — EN / PT
- Custom habit schedule (specific days of the week)
- Push notifications for daily habit reminders
- Stats with real chart data (completion over time)
- Unlockable badges based on streak milestones
Made with ❤️ and Jetpack Compose