repositories {
jcenter()
}
implementation 'io.github.aimsio:table-recyclerview:[latest-version]'
This library provides TableViewLayout
and TableViewAdapter
to help create a 2D table representation of any data on Android, enabling consumer classes to use
different custom cell layouts of their own logic and desire.
This library provides TableRecyclerView
to help create a 2D tabular representation of any data, using recyclerview in Android.
-
fluent and easy to understand api.
-
lightweight library size.
-
maximum flexibility in enabling the consumer to use different logic and views for each column.
-
Handling row heights automatically
-
Enabling the rows to use Android DiffUtil for handling data updates in UI.
-
Providing access to the whole model object of the row.
-
make your data model extend
TableModel
. This is just a marker interface and won't affect your design of classes. -
implement
TableColumnNameView
providing a single row layout that will host the column names in the table -
implement
TableRowView
providing the general layout for your data in the table. Notice thatTableRecyclerView
will handle row height, but columns width are up to you to handle. So it's recommended to use the same layout structure forTableColumnNameView
andTableRowView
. Take a look at demo app for understanding this part. -
Call
TableRecyclerView.setUp()
, passing your implementations ofTableColumnNameView
andTableRowView
-
Call
TableRecyclerView.updateTable()
with a list of your model data.
Copyright (C) 2020 Farhad Faghihi
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.