Skip to content

feat: Multi-List Watchlist System, Favorites UI, and Data Persistence Fixes

SHAFIZADA SULEYMAN requested to merge fix/navigation-and-ui into main

Summary

This MR overhauls the Watchlist feature to satisfy the requirement for multiple custom watchlists (e.g., "Horror", "My Watchlist"). It splits the Watchlist UI into a Manager screen and a Details screen. Additionally, it finalizes the Favorites screen and fixes data persistence issues where posters and ratings were not saving locally.

Key Changes

1. Watchlist Architecture Overhaul

  • Refactor: Split WatchlistFragment into:
    • WatchlistFragment (Manager): Displays list of custom lists.
    • WatchlistDetailFragment (Details): Displays the grid of movies inside a specific list.
  • Logic: Implemented "Current List" logic. Users can select an active list via radio button; new movies are added to the currently selected list.
  • CRUD: Users can now Create new lists via dialog and Delete lists via long-press.

2. Database & Repository

  • Schema Update: Added UserListEntity and UserListMovieCrossRef to handle many-to-many relationships between movies and lists.
  • Deletion Logic: Implemented cascading delete—removing a list also cleans up its movie associations in the cross-reference table.
  • Repository: Updated UserCollectionsRepository to handle switching active lists and removing movies from specific lists (not just toggling a flag).

3. Favorites Feature

  • Finalized FavoritesFragment and FavoritesViewModel.
  • Connected Profile navigation to the Favorites screen.

4. Critical Bug Fixes

  • Data Persistence: Fixed a bug in the Repository Mapper (toEntity) where Poster URLs and Ratings were not being saved to the Room database, causing blank images in offline mode.
  • Navigation: Fixed click listeners in Watchlist/Favorites adapters to correctly navigate to the Movie Details screen.

Technical Details

  • Database Version: Bumped to v5 (Schema change).
  • Architecture: MVVM with Repository pattern.
  • UI: Used NestedScrollView and RecyclerView with custom adapters for list management.

Important Note for Reviewers

Please uninstall the previous version of the app before running.
Since this update modifies the Room Database schema (adding tables for custom lists and updating Movie entities), a fresh install is required to avoid migration crashes.

How to Test

  1. Favorites: Go to Profile -> Favorites. Verify movies appear with Posters and Ratings.
  2. Watchlist Manager: Go to Profile -> Watchlist. Create a new list (e.g., "Action").
  3. Set Active: Click the Radio Button next to "Action" (turns Teal/Green).
  4. Add Movie: Go to Search, find a movie, and add it.
  5. Verify: Go back to Watchlist -> Click "Action". Verify the movie is there.
  6. Delete: Long-press the "Action" list to delete it. Verify it disappears.

Merge request reports