evrencoskun / TableView

TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
MIT License
3.14k stars 454 forks source link

Add option to display the Corner View when there are Column headers but no rows or cells #327

Closed Zardozz closed 3 years ago

Zardozz commented 4 years ago

This should resolve the issue #308

It adds the flag to tableview tableView.setShowCornerView(true); to change the behaviour of setAllItems in the adaptor.

It also adds automated test instrumented test infrastructure to the tableview to test the behaviour change.
The test infrastructure is based on ideas of how androidx recyclerview and it's layout managers are tested and how flexbox layout manager is tested.
Code Coverage for these tests is also enabled (created by running the "createDebugCoverageReport" gradle task in the "tableview" module)

The non "ShowCorner" set of test were developed before "ShowCorner" feature was developed and all passed.
Code Coverage report before feature for setAllItems image

Note some branches not covered as the tests only target the "Is not empty" not the "is not null" condition checks.

Test results after the "ShowCorner" feature image

Code Coverage report after feature changes for setAllItems
image

These tests passed on emulators API 22 and API 29 (Note Instrumented tests are note available before API 21 so cannot be used to cover down to the minimum specified API of 14)

Manual test of the sample app showed no change as this does not exhibit the conditions where the feature changes the behaviour (the sample app also does not enable the feature)