Skip to content

Feature/dra 141#98

Open
rajdeveloper90 wants to merge 523 commits into
masterfrom
feature/DRA-141
Open

Feature/dra 141#98
rajdeveloper90 wants to merge 523 commits into
masterfrom
feature/DRA-141

Conversation

@rajdeveloper90

@rajdeveloper90 rajdeveloper90 commented Nov 9, 2021

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • Added address book upload functionality allowing users to sync their contacts to the app.
    • Implemented friend invitation flow integrated into the user registration process—users are now prompted to invite friends after account creation.
  • Improvements

    • Enhanced onboarding navigation with streamlined activity transitions.

semirzahirovic and others added 30 commits April 19, 2021 12:44
DRA-45 Load next video on tab reselect
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
JimClermonts and others added 24 commits October 30, 2021 20:08
* master:
  -bug/DRA-201 Added minimum line to 2 as per feedback
  -bug/DRA-205 done feedback changes
  -bug/DRA-205 Added ( ) as per feedback
  -bug/DRA-204 added apostrophe exception as per feedback
  -bug/DRA-205 done changes "-" between sentence/word will not change Added bit more spacing 2sp as asked
  -bug/DRA-204 added character to be accepted: ë é
  -bug/DRA-201 Fixed the button jump
  -bug/DRA-202 fixed images not preloading issue
  -bug/DRA-198 done feedback changes
  -bug/DRA-194 done feedback changes
  -bug/DRA-194 feedback changes
  -bug/DRA-198 Appended http before the url if url not contains
  -bug/DRA-194 finished the activity when starting the app Updated the code of the share Utils as it was not working properly
…DRA-140

* commit '7605f285719b822d355a7a32377ae1380e439c73':
  -bug/DRA-201 Added minimum line to 2 as per feedback
  -bug/DRA-205 done feedback changes
  -bug/DRA-205 Added ( ) as per feedback
  -bug/DRA-205 done changes "-" between sentence/word will not change Added bit more spacing 2sp as asked
  -bug/DRA-201 Fixed the button jump

# Conflicts:
#	app/src/main/res/layout/activity_instructions.xml
#	app/src/main/res/layout/fragment_favorites.xml
Figured out and solved video keeps playing issue even screen destroyed
If the username belongs to user itself, update other values and log in successfully
Added code for uploading the phonebook to the firebase and tested as well
Solved black glitch when video switch
Done feedback changes
Done uploading of address book
Managed flow as per JIRA ticket to display Invite Friends screen and food categories 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: 9d405c61-c472-4f13-a886-2956ce1009b6

📥 Commits

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

📒 Files selected for processing (13)
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/invite/AddressBookDataSource.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/data/invite/AddressBookRepository.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/di/SharedModule.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/domain/invite/UploadAddressBookUseCase.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/model/Contact.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/categories/CategoriesFragment.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/invite/addressbook/InviteFriendsFragment.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/invite/addressbook/InviteFriendsViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/launch/LauncherActivity.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/launch/LauncherViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/register/createuser/CreateUsernameFragment.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/ui/register/createuser/CreateUsernameViewModel.kt
  • app/src/main/java/eu/theappfactory/dailyrecipes/util/ViewModelFactory.kt

📝 Walkthrough

Walkthrough

This PR implements an address book contacts upload feature. After users create accounts and reach onboarding screens, they navigate to an invite friends flow where contacts are loaded from the device and uploaded to Firestore. Navigation in certain flows transitions from NavController-based to explicit activity Intent launches.

Changes

Cohort / File(s) Summary
Address Book Data Layer
app/src/main/java/eu/theappfactory/dailyrecipes/data/invite/AddressBookDataSource.kt, app/src/main/java/eu/theappfactory/dailyrecipes/data/invite/AddressBookRepository.kt
Added uploadContacts suspend function to both interface and implementation. DataSource fetches existing contacts from Firestore and writes missing ones; Repository delegates to DataSource.
Dependency Injection
app/src/main/java/eu/theappfactory/dailyrecipes/di/SharedModule.kt, app/src/main/java/eu/theappfactory/dailyrecipes/util/ViewModelFactory.kt
Updated DI provider to pass FirebaseFirestore to DefaultAddressBookDataSource. ViewModelFactory now injects UploadAddressBookUseCase and wires it into InviteFriendsViewModel.
Domain Layer
app/src/main/java/eu/theappfactory/dailyrecipes/domain/invite/UploadAddressBookUseCase.kt
New domain use case that delegates contact uploads to the repository through a coroutine dispatcher.
Model
app/src/main/java/eu/theappfactory/dailyrecipes/model/Contact.kt
Added companion object with DISPLAY_NAME and PHONE_NUMBER constants for serialization/mapping.
Registration & Onboarding Flow
app/src/main/java/eu/theappfactory/dailyrecipes/ui/register/createuser/CreateUsernameFragment.kt, app/src/main/java/eu/theappfactory/dailyrecipes/ui/register/createuser/CreateUsernameViewModel.kt
ViewModel now emits onUserNameCreated event; Fragment observes and navigates to InviteFriendsPermissionActivity.
Address Book Upload Flow
app/src/main/java/eu/theappfactory/dailyrecipes/ui/invite/addressbook/InviteFriendsViewModel.kt
Extended to upload contacts after loading. Retrieves current Firebase user ID and calls UploadAddressBookUseCase, setting preference flag only on success.
Navigation Changes
app/src/main/java/eu/theappfactory/dailyrecipes/ui/invite/addressbook/InviteFriendsFragment.kt, app/src/main/java/eu/theappfactory/dailyrecipes/ui/categories/CategoriesFragment.kt, app/src/main/java/eu/theappfactory/dailyrecipes/ui/launch/LauncherActivity.kt, app/src/main/java/eu/theappfactory/dailyrecipes/ui/launch/LauncherViewModel.kt
Replaced NavController navigation with explicit Intent-based activity launches; re-enabled ADD_FRIENDS as active launch destination in LauncherViewModel and LauncherActivity.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CreateUsernameFragment
    participant CreateUsernameViewModel
    participant InviteFriendsPermissionActivity
    participant InviteFriendsFragment
    participant InviteFriendsViewModel
    participant UploadAddressBookUseCase
    participant AddressBookRepository
    participant FirebaseFirestore

    User->>CreateUsernameFragment: Enter username
    CreateUsernameFragment->>CreateUsernameViewModel: createUser()
    CreateUsernameViewModel->>CreateUsernameViewModel: Post onUserNameCreated event
    CreateUsernameFragment->>InviteFriendsPermissionActivity: Start activity via Intent
    InviteFriendsFragment->>InviteFriendsViewModel: loadAddressBook()
    InviteFriendsViewModel->>InviteFriendsViewModel: Obtain contacts from device
    InviteFriendsViewModel->>InviteFriendsViewModel: Get current user ID
    InviteFriendsViewModel->>UploadAddressBookUseCase: execute(userId, contactList)
    UploadAddressBookUseCase->>AddressBookRepository: uploadContacts()
    AddressBookRepository->>FirebaseFirestore: Fetch existing contacts from users/{userId}/contacts
    FirebaseFirestore-->>AddressBookRepository: Return existing contacts
    AddressBookRepository->>FirebaseFirestore: Write missing contacts
    FirebaseFirestore-->>AddressBookRepository: Success
    AddressBookRepository-->>UploadAddressBookUseCase: Result.Success
    UploadAddressBookUseCase-->>InviteFriendsViewModel: Result received
    InviteFriendsViewModel->>InviteFriendsViewModel: Set userHasAddedFriends = true
    User->>InviteFriendsFragment: Proceed to main activity
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A carrot-load of contacts sent,
Through Firestore's green corridor they went,
From username bloom to friends so true,
The address book dances, shiny and new!
hops excitedly


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