Our team presents a new library that makes it possible to read, edit and write CSV files on Android apps — AdaptiveTableLayout. This library allows you to swap rows and columns, display the picture from URL, and align the required data. Below we are describing key features of the library and sharing our key challenges/takeaways.

Why we decided to build a new library

We needed diagonal scrolling and convenient work with CSV files

We needed to read and process large CSV files without lags

What benefits AdaptiveTableLayout can offer you

New library can boast about new unexampled features you won’t come across other CSV libraries. It allows you to perform the following:

You can make diagonal scrolling

Use drag-and-drop feature to change rows/columns

Fix your headers to the edge

Solid rows — row header can change its position while dragging the row

Also, you can read and edit CSV files, change cell margins, operate with heavy files without lagging.

In addition, developers can make use of two data adapters:

BaseDataAdaptiveTableLayoutAdapter that is created to work with a light data. Then you can change original data after switching on each column/row

that is created to work with a light data. Then you can change original data after switching on each column/row LinkedAdaptiveTableAdapter, in turn, can work the heavy data. It uses the matrix with changed items with links on it. Here you can not change original data

But it is worth noting that before you start using adapters, you need to indicate precise number, width, and height of the rows and columns.

Key challenges we had to overcome

Scrolling integration . Other CSV libraries can provide you only with scroll horizontally or vertically at the same time. We decided to integrate obliquely scrolling. It was not simple task since we wanted to do it on the RecyclerView basis, but the code and logic behind looked awful. We decided to manage it all manually and remove RecyclerView from library at all

. Other CSV libraries can provide you only with scroll horizontally or vertically at the same time. We decided to integrate obliquely scrolling. It was not simple task since we wanted to do it on the RecyclerView basis, but the code and logic behind looked awful. We decided to manage it all manually and remove RecyclerView from library at all Calculation of the element position. It was necessary to calculate precisely what element and where it shall be located. It was not easy process since we had to perform many calculations

In future we plan to add pinch-in/pinch-out feature as well as zooming feature. Besides, we were advised to add right to left writing model for people from the Middle East countries.

Library Setup and Dependencies

Method count: 429 (verion 1.0.1)

The only dependency: com.android.support:appcompat-v7

Minimum SDK version: 16

ProGuard custom configuration is not needed

Thanks for reading and please check out AdaptiveTableLayout at GitHub!