Skip to content

Feature/dra 166#76

Open
rajdeveloper90 wants to merge 537 commits into
masterfrom
feature/DRA-166
Open

Feature/dra 166#76
rajdeveloper90 wants to merge 537 commits into
masterfrom
feature/DRA-166

Conversation

@rajdeveloper90

@rajdeveloper90 rajdeveloper90 commented Oct 22, 2021

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • User profile system with follow/unfollow functionality
    • User details page displaying creator information and social network links
    • Creator profile display in feed items
    • User image caching and preloading
  • Database

    • Added user data persistence layer
  • UI Updates

    • Updated favorites screen with follow/unfollow button
    • Enhanced feed to show content creator profiles

JimClermonts and others added 30 commits May 4, 2021 17:55
DRA-44 Added food categories screen
* master:
  DRA-72 More clear view for preferences
  Filter food by category
  Changed the theme so that it works for all phones.
  Adding app bar.
  DRA-44 Added Fingerfood type
  Added pastry category
  PR updates
  DRA-45 Load next video on tab reselect

# Conflicts:
#	app/src/main/java/eu/theappfactory/dailyrecipes/data/userEvent/FirestoreUserEventDataSource.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/ui/preferences/PreferencesViewModel.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/ui/preferences/UserPreferencesFragment.kt
#	app/src/main/res/layout/fragment_preferences.xml
#	app/src/main/res/layout/list_item_food_type.xml
#	app/src/main/res/values/strings.xml
* master:
  Added active and unactive icons bottom navigation.
  changed the icons for back and forward.
  also added mixpanel event.
  DRA-72 More clear view for preferences
  Filter food by category
  DRA-44 Added Fingerfood type
  Added pastry category
  added the Google I/O implementation of the snackbar.
  PR updates
  DRA-44 Added food categores screen

# Conflicts:
#	app/src/main/java/eu/theappfactory/dailyrecipes/ui/home/pager/ItemViewModel.kt
#	app/src/main/res/values/strings.xml
…eselect strategy, DRA-75 Better seek controls
DRA-56 Show keyboard when opening search screen, DRA-73 Changed tab r…
JimClermonts and others added 25 commits October 31, 2021 16:49
Done feedback changes as per git
Created user list database to store all user and used it to fetch details
Changed the flow to get food categories from username
Added image preloading of users list -> photo thumbnail
Added live data to change image in adapter
# Conflicts:
#	app/src/main/java/eu/theappfactory/dailyrecipes/data/UserRepository.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/data/userEvent/FirestoreUserDetailParser.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/data/userEvent/FirestoreUserEventDataSource.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/data/userEvent/UserEventDataSource.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/domain/userdetails/GetUserUseCase.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/model/UserResponse.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/ui/favorites/FavoritesFragment.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/ui/favorites/FavoritesViewModel.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/ui/home/pager/ItemAdapter.kt
#	app/src/main/java/eu/theappfactory/dailyrecipes/util/ViewModelFactory.kt
#	app/src/main/res/layout/fragment_favorites.xml
#	app/src/main/res/layout/list_item_items.xml
#	app/src/main/res/values/strings.xml
Solved merge conflicts and done application testing
Fixed known issue
Added required entity
Null handling
Figured out and solved video keeps playing issue even screen destroyed
changed loading icon in search and favorite screen
Added visual feedback on button
If the username belongs to user itself, update other values and log in successfully
Added optional paramter in indegredients screen as per task, and filtered the list with optional parameter true or false
Solved black glitch when video switch
updated get categories code to fetch from username
Done feedback changes
…DRA-166

* commit '4eb0d30e24f2892f9c7a47c5a576a87d8614fc1d':
  -bug/DRA-210 Done feedback changes
  -bug/DRA-208 Solved black glitch when video switch
  -bug/DRA-213 Added optional paramter in indegredients screen as per task, and filtered the list with optional parameter true or false
  -bug/DRA-212 If the username belongs to user itself, update other values and log in successfully
  -bug/DRA-210 Figured out and solved video keeps playing issue even screen destroyed
…DRA-166

* commit '5d23e547227e241bc6937eb97f598c700a316be2':
  -bug/DRA-209 changed loading icon in search and favorite screen
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: fe3d5ee3-4cc2-4ddb-8c7c-808f6e1873cb

📥 Commits

Reviewing files that changed from the base of the PR and between d724c58 and 1a58f06.

⛔ Files ignored due to path filters (5)
  • app/src/main/res/drawable-hdpi/ic_instagram.png is excluded by !**/*.png
  • app/src/main/res/drawable-mdpi/ic_instagram.png is excluded by !**/*.png
  • app/src/main/res/drawable-xhdpi/ic_instagram.png is excluded by !**/*.png
  • app/src/main/res/drawable-xxhdpi/ic_instagram.png is excluded by !**/*.png
  • app/src/main/res/drawable-xxxhdpi/ic_instagram.png is excluded by !**/*.png
📒 Files selected for processing (37)
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/UserDataDownloader.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/UserRepository.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/db/AppDatabase.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/db/Converters.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/db/UserDao.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/db/UserEntity.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/userEvent/FirestoreUserDetailParser.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/userEvent/FirestoreUserEventDataSource.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/userEvent/UserEventDataSource.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/di/RepositoryModule.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/di/SharedModule.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/domain/home/GetUserDetailsWithUserNameUseCase.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/domain/home/GetUsersUseCase.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/domain/home/UpdateUserFollowersCount.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/domain/preferences/GetUserFoodCategoriesUseCase.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/domain/userdetails/GetUserUseCase.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/media/ImagePreLoader.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/model/FollowItem.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/model/ItemResponse.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/model/UserResponse.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/categories/CategoriesViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/favorites/FavoritesFragment.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/favorites/FavoritesViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/home/ItemEventActions.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/home/pager/ItemAdapter.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/home/pager/ItemFragment.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/home/pager/ItemHolder.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/home/pager/ItemViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/launch/LauncherViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/register/createuser/CreateUsernameViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/util/ImageView.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/util/ViewModelFactory.kt
  • app/src/main/res/layout/fragment_favorites.xml
  • app/src/main/res/layout/list_item_items.xml
  • app/src/main/res/navigation/main_navigation.xml
  • app/src/main/res/values/colors.xml
  • app/src/main/res/values/strings.xml

📝 Walkthrough

Walkthrough

A feature set is added enabling user profile management: fetching and persisting users to local database, implementing follow/unfollow operations, displaying creator profiles in feeds, and retrieving user details by username. The user authentication flow is updated to support paired string-boolean parameters for determining data retrieval context.

Changes

Cohort / File(s) Summary
User Data Persistence Layer
data/UserDataDownloader, data/db/UserEntity, data/db/UserDao, data/db/Converters, data/db/AppDatabase
New Firestore data downloader class, Room entity and DAO for user storage, JSON type converters for list serialization, and database schema upgrade to version 3 with type converter registration.
Repository & Data Source
data/UserRepository, data/userEvent/FirestoreUserEventDataSource, data/userEvent/UserEventDataSource
Extended user repository and Firestore data source with follow/unfollow, username-based user lookup, remote users list retrieval, and food categories by username. Repository now integrates local database caching.
Domain Use Cases
domain/home/GetUsersUseCase, domain/home/GetUserDetailsWithUserNameUseCase, domain/home/UpdateUserFollowersCount, domain/userdetails/GetUserUseCase, domain/preferences/GetUserFoodCategoriesUseCase
New use cases for fetching users list, looking up user by username, and updating follow counts. Modified GetUserUseCase to accept Pair<String, Boolean> parameter; updated food categories use case to use new repository method.
Data Models
model/UserResponse, model/FollowItem, model/ItemResponse
Extended UserResponse with social network handle and photo URI thumbnail fields. New FollowItem data class for follow/unfollow operations. Minor formatting update to ItemResponse.
Favorites Feature
ui/favorites/FavoritesFragment, ui/favorites/FavoritesViewModel, res/layout/fragment_favorites
Fragment and ViewModel now support viewing other users' profiles and follow/unfollow interaction. Layout refactored with new follow button, unfollow button, and social network button.
Feed/Home Feature
ui/home/pager/ItemViewModel, ui/home/pager/ItemFragment, ui/home/pager/ItemHolder, ui/home/pager/ItemAdapter, ui/home/ItemEventActions, res/layout/list_item_items
Feed items now display creator profiles and names with image preloading. Replaced social network button click handling with username-based navigation to user profile. Updated adapter to bind creator profile data. Layout restructured with creator avatar and name display.
Categories Feature
ui/categories/CategoriesViewModel
Updated to resolve and use username instead of user ID when fetching user food categories.
Authentication Flow
ui/launch/LauncherViewModel, ui/register/createuser/CreateUsernameViewModel
Modified to pass Pair<String, Boolean> to GetUserUseCase for context-aware user retrieval.
Utilities & Infrastructure
media/ImagePreLoader, util/ImageView, util/ViewModelFactory, di/RepositoryModule, di/SharedModule, res/navigation/main_navigation, res/values/colors, res/values/strings
Added user image preloading support. Extended image loading utility with placeholder parameter. Updated dependency injection and view model factory with new use cases. Added navigation argument for username passing. New color and string resources for follow/unfollow UI.

Sequence Diagram

sequenceDiagram
    participant User as User (UI)
    participant ViewModel as FavoritesViewModel
    participant Repo as UserRepository
    participant DataSource as FirestoreUserEventDataSource
    participant Firestore as Firestore
    participant DB as Room Database

    User->>ViewModel: updateUserFollowers()
    ViewModel->>ViewModel: Create FollowItem(selfUserName, selectedUserName, isFollow)
    ViewModel->>Repo: updateFollowUnFollowCount(FollowItem)
    Repo->>DataSource: updateFollowUnFollowCount(FollowItem)
    DataSource->>Firestore: Query user documents by username
    Firestore-->>DataSource: User document IDs
    DataSource->>DataSource: Update in-memory follower list
    DataSource->>Firestore: Batch write FieldValue.arrayUnion/arrayRemove
    Firestore-->>DataSource: Updated followers list
    DataSource-->>Repo: Result<ArrayList<String>>
    Repo->>DB: Insert updated UserEntity
    DB-->>Repo: Complete
    Repo-->>ViewModel: Result with updated followers
    ViewModel->>ViewModel: Update _onUserLoaded with new followers
    ViewModel-->>User: Emit updated LiveData
Loading
sequenceDiagram
    participant Fragment as ItemFragment
    participant ViewModel as ItemViewModel
    participant UseCase as GetUsersUseCase
    participant Repo as UserRepository
    participant DataSource as FirestoreUserEventDataSource
    participant Downloader as UserDataDownloader
    participant Firestore as Firestore
    participant Preloader as ImagePreLoader

    Fragment->>ViewModel: fetchUsersList()
    ViewModel->>UseCase: execute(Unit)
    UseCase->>Repo: retrieveRemoteUsers()
    Repo->>DataSource: getRemoteUsersList()
    DataSource->>DataSource: Check network connectivity
    alt Network Available
        DataSource->>Downloader: fetch()
        Downloader->>Firestore: get() from users collection
        Firestore-->>Downloader: DocumentSnapshots
        Downloader-->>DataSource: MutableList<UserResponse>
    end
    DataSource-->>Repo: MutableList<UserResponse>
    Repo->>Repo: Map to UserEntity and persist
    Repo-->>UseCase: List<UserResponse>
    UseCase-->>ViewModel: List<UserResponse>
    ViewModel->>ViewModel: Update usersList LiveData
    ViewModel->>Preloader: preloadUserFrames(items)
    Preloader-->>ViewModel: Complete
    Fragment->>Fragment: Update UI with user data
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 A warren of users now hops through our app,
Following friends fills the social-network map,
With profiles and pictures in beautiful arrays,
Room persists their details through all of our days,
From Firestore to database, data does flow—
Hoppy refactoring! Watch the features grow! 🌟


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@JimClermonts JimClermonts force-pushed the master branch 2 times, most recently from 71a4471 to 4fd34f4 Compare April 7, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants