1

I am reading this manual https://developer.android.com/topic/libraries/data-binding/index.html and it is not clear for me, how to fill the TableLayout with rows if my data is kept in ObservableArrayList? All examples assume there to show a single record, but I want to show all records in the table.
Or may be it is impossible and I should use RecyclerView instead?

Almaz
  • 920
  • 11
  • 13
  • This is not impossible but you will have to handle much of the coding. You can either inflate a `TableRow` and add it to your `TableView` or you can create it from scratch. Use `addView(View)` method to add views. This is easier to do with a `RecyclerView` though. – Naveen Dissanayake Mar 01 '17 at 12:52

1 Answers1

2

You might find this article helpful:

https://medium.com/google-developers/android-data-binding-list-tricks-ef3d5630555e#.c1vesyobm

It discusses how to turn lists in to Views in a ViewGroup. When you make it work for TableView, you might want to publish it here for people to use.

That said, if you have only a few Views, you can use data binding. If you're planning on having a scrolling list, you should use RecyclerView.

George Mount
  • 20,708
  • 2
  • 73
  • 61