Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Sabrina/cart recycler view adapter #23

Merged
merged 3 commits into from Mar 13, 2020

Conversation

sabrina-li
Copy link
Contributor

logic to populate RecyclerView for cart fragment, and handle click to remove 1 unit of item from cart

These code largely duplicate from the market fragment(mainly the adapter and maybe hanlders), however, I think it's worth separating the adapters and handlers. If the app evolves and get sophisticated, we may have more different functionalities between the two views to worth separating the code and.

Open to argument if we should reuse these code.

@patrick-fs
Copy link
Member

Open to argument if we should reuse these code.

If you're seeing a ton of functional overlap (i.e. market and cart components are doing the same thing but only the names are changing) then it might be a good idea to consolidate into a shared component. This can be a future refactor.

Copy link
Member

@patrick-fs patrick-fs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thoughts for a future enhancement from an Android newb: include a high-level outline of your architecture (basically a bullet-point list of how you've defined your directory structure and the relationships between ViewModels, Handler, Adapters, Layouts, etc.)

@sabrina-li
Copy link
Contributor Author

Thanks for the input!
I thought the view would be different but since everything is done through data binding, the adapter turned out to be largely the same. I'll create a simple readme later to explain the app and how to.

@sabrina-li sabrina-li merged commit a461aa8 into master Mar 13, 2020
@sabrina-li sabrina-li deleted the sabrina/CartRecyclerViewAdapter branch March 13, 2020 14:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants