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 458 forks source link

Method does not override from its super class #262

Open meMuhammadkamal opened 5 years ago

meMuhammadkamal commented 5 years ago

After following the guide i got syntax error on this method

@Override
     public View onCreateCornerView(ViewGroup parent) {
         // Get Corner xml layout
         return LayoutInflater.from(parent.getContext())
              .inflate(R.layout.table_view_corner_layout, parent, false);
     }

then changed it to this:

@Override
    public View onCreateCornerView() {
        // Get Corner xml layout
        return null;
    }

then i got exception Cannot add a null child view to a ViewGroup i guess it is related to cornerview being set as null and can't find this variable ViewGroup parent after overriding the method using this version: implementation 'com.evrencoskun.library:tableview:0.8.8'

soumayla commented 5 years ago

Hello,

I had this same issue and i solved it as following :

The reason of the bug, is that the sources code from the master aren't the same (at least for the class TableViewAdapter) as the ones from the release, which i guess is to the fact that the v0.8.8 is an pre release version (alpha), therefore not pushed at the master branch yet.

Regards,

MGaetan89 commented 4 years ago

The Readme file does not reflect the latest release of the library, but the next one. You can find the documentation for version 0.8.8 here.

onCreateCornerView has been annotated as @NonNull in https://github.com/evrencoskun/TableView/pull/237 (to be released). Maybe it could be @Nullable and, at least, add a null check here: https://github.com/evrencoskun/TableView/blob/dc3c77e333e062fd65815b45052133d6b384c3db/tableview/src/main/java/com/evrencoskun/tableview/adapter/AbstractTableAdapter.java#L131-L132 What do you think @evrencoskun?

MGaetan89 commented 4 years ago

@evrencoskun the solution I proposed seem to be enough. Do you want me to submit a PR with it? Or do the library user have to return a valid corner view?