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.13k stars 453 forks source link

Update dependencies #374

Closed MGaetan89 closed 3 years ago

MGaetan89 commented 3 years ago

I've updated the dependencies of the project to the latest version:

Most changes come from the deprecation of ActivityTestRule in AndroidX Test. I tried to adapt the code to keep the changes to a minimum.

Zardozz commented 3 years ago

For the changes to the tests for deprecation of ActivityTestRule in AndroidX tests mostly you have replaced a check via an API method to a test for does it exist in the Layout hierarchy.

i.e.

 RelativeLayout cornerView = (RelativeLayout) tableView.getAdapter().getCornerView();
        Assert.assertNotNull(cornerView);
        // Check the corner view is visible
        Assert.assertEquals(View.VISIBLE, cornerView.getVisibility());

with

 onView(withId(R.id.corner_view))
                .check(matches(not(doesNotExist())))
                .check(matches(withEffectiveVisibility(Visibility.VISIBLE)));

So not checking the exact same thing, but I'm undecided whether this is OK or not. I guess the intent of the check was to check it was drawn and not to check the getCornerView method.
BUT the .check(matches(not(doesNotExist()))) part is redundant as the onView part will fail to find it in the layout if it did not exist

I note that CornerViewTest.java and SimpleActivityTest.java tests did not get converted to the onView methodology instead of the using Api methods for consistency.

MGaetan89 commented 3 years ago

Hey, thanks for having a look.

I've started to update my changes. I'll update my PR tomorrow.

MGaetan89 commented 3 years ago

I've updated the PR in https://github.com/evrencoskun/TableView/pull/374/commits/644e08ac8ed80c6be469f89a424d27a53904e5dc to use the latest version of the dependencies.