Lucas-Israel / trybnb

0 stars 0 forks source link

data binding nit #7

Closed FilipeLipan closed 2 months ago

FilipeLipan commented 3 months ago

https://github.com/Lucas-Israel/trybnb/blob/b8ec8285ecb51c3396b7840be2fa4a55662e3f9d/app/src/main/res/layout/list_item_reservation.xml#L8

This works fine, but it is not well-regarded in the industry. We should avoid using data binding to set data and instead use a RecyclerView

https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView

you already have an Adapter it's a easy change

Lucas-Israel commented 3 months ago

like this? https://github.com/Lucas-Israel/trybnb/commit/d7ce754dfd15374a433a822298e52db1d7a9df1e

FilipeLipan commented 2 months ago

@Lucas-Israel yes, but avoid keeping this empty fields -> android:text=""

also it's not a good practice to use "textview1" "textview2" "textview3" Try to use names that clearly explain the purpose of the field.

Lucas-Israel commented 2 months ago

solved here: https://github.com/Lucas-Israel/trybnb/commit/9be8644dc385e5ba8cd44c6b28617679e784c0de