Summary
The App Categorization feature allows users to organize their installed applications into logical groups (like Productivity, Social, or Games). While the app automatically assigns categories using a background synchronization process, this interface gives users full control to manually override these categories or assign them to apps that haven’t been recognized yet. It serves as the central hub for managing how apps are grouped throughout the rest of the application.How It Works
The system combines the list of installed apps on the phone with a database of known categories. It then presents them in an expandable, grouped list.Data Aggregation
When the user opens the screen, the ViewModel performs two checks simultaneously. It asks the Metadata Repository for a list of all currently installed apps and asks the Category Repository for the category assigned to each app. It combines this information to determine which apps are “Categorized” and which are “Uncategorized.”
Grouping and Display
The Screen displays these apps in a list.
- Uncategorized Apps: If any apps lack a category (or failed to sync), they appear at the very top in a red-tinted group, prompting the user to take action.
- Categorized Apps: The remaining apps are grouped by their category name (e.g., “Finance”, “Health”). Users can tap a group header to expand or collapse the list of apps inside.
Manual Categorization
If a user disagrees with an automatic category or wants to fix an uncategorized app, they tap the app in the list. This opens a containing a list of all available categories.
Data Stored
This feature manages the relationship between an app package and its category.| Field | Type | Description |
|---|---|---|
| packageName | String | The unique ID of the app (e.g., com.whatsapp) |
| category | String | The assigned category (e.g., COMMUNICATION) |
| isUserCategorized | Boolean | True if the user manually set this category |
| status | Enum | Current sync status (Synced, Pending, or Failed) |
Key Components
AppCategoryScreen
Renders the expandable lists and handles the scroll-aware search bar animation.
AppCategoryViewModel
Filters apps based on search queries and merges app data with category data.
Repositories
Fetches installed app icons/names and retrieves stored category assignments.
Sync Worker
A background process triggered by the ViewModel to retry fetching categories if the device was previously offline.