Backstory: Reason for the APP A group of 4 friends - Anuradha, Raju, Baburao Apte and Ghanshyam used to hang out together quite often. Every time they went out for either a meal or some coffee, someone or the other always got away with not paying their share. It was becoming increasingly difficult to track expenses. Anuradha, being the smart and the responsible one amongst the four, decided to build a mobile application that will track all the expenses they make together as a group. She remembered that every time Raju got out of paying for his share, he used to say "Thanks buddy, I owe you" and hence decided to name the application - IOU(I Owe You)
- adapters: To render the recyclerview data on view
- models: Here all the ENTITIES(Data) class are declared which stores the data information
- dao: Data Access Objects - In this package DAO are defines which holds the methods for data operations
- database: Room Database Class.
- repository: These class used to access data from DB and Provide to ViewModels
- viewmodels: These are intermeadioter between UI and Repositiry. It takes Data from Repo and provide to UI.
- ui: All the User intrection classes placed here.
- utils: this packege is used for declare application level utility class like Prefrense and Appconstants
- Splash: After launching app 1st screen will be a splash screen with "IOU" name and has a 1000 milisecong delay. It has condition (if user loggedin -> MainActivity else -> LoginActivity)
- Login: From here User can Login by providing credientials.
- MainActivity: Here i render Expense list and using 2 fragments for profile and add expense
- Profile Fragment: It shows logged-in user information with LogOut button
- Add Expense Fragment: From here user can add new expense in the list
- There is one table of users which work like a Group for the current requirement
- After providing loging crediantials user will redirect to Main Activity here user can see all the expenses create by group.
- By clicking UserName user can see profile and have an option to Logout from app
- By Add Expense button user can create Expense which will devide equally in the current group members and save to the Expense Table
- While Rendring expenses to Adapter logic for converting UserName into You written in adapter class.
- Same after edit data passed to the detail page so there is no logic required to show data.
- I am using ListAdapter with DiffUtil in RecyclerViewAdapter (It improves performance by calculates the difference between two lists and outputs a list of update operations that converts the first list into the second one)
- The MVVM Architecture workes great with Dagger2 (Dependency Injection). Will work on that part in future updates.
- I have Write some extra DB operations like INSERT, DELETE and UPDATE which are not in use now but it can be used when needed.
- I thought Side Navigation Drawer is not required to show user profile so i use Simple Fragment for this with behaviour like Drawer 😉