fix(ui): Fix Rating Bar Interaction and Data Persistence
What does this MR do?
This MR resolves two critical issues with the Rating feature in the Movie Details screen:
- Interaction: The RatingBar was previously read-only. It is now interactive, allowing users to tap and slide to set a score (0.5 - 5.0).
- Persistence: Previously, the rating would reset to 0 visually when reopening the screen, even if it was saved in the database.
Technical Changes:
- Modified
DetailsUiStateto include a nullableuserRatingfield. - Updated
DetailsViewModelto query the local database for the user's rating duringloadMovieandcheckDatabaseStatus. - Refactored
ActionBottomSheetto observe theuiState.userRatingflow instead of relying on static arguments, ensuring the UI always reflects the database state.
How to Test:
- Open a movie details screen.
- Click the "..." action button.
- Rate the movie (e.g., 4 stars). Verify the "Rated" toast appears.
- Close the bottom sheet or navigate back.
- Open the same movie again.
- Verify: The RatingBar should properly display the 4 stars you set previously.