From 4b244921d4c11ebb19817f4b5a40a7e172e5592e Mon Sep 17 00:00:00 2001 From: Brendan Ingham Date: Wed, 21 Mar 2018 06:18:01 +0000 Subject: [PATCH] feat(List-View) : Add the ability to check if an item is visible or not. (#5557) * feat(list-view): Adds the ability to check whether or not an Item at index is Visible on screen within a listView * feat(list-view): add the unit-test for checking if list-item is visible. * clean(list-view): fix invalid reference in list-view-common * chore(list-view): remove unused logic * test(list-view) updates the tests for checking if item at index is visible * chore(ListView Tests): update the test_check_if_item_at_index_is_visible unit test to include 40 children, and test if the last item is visible or not. * Chore(ListView IOS): Apply requested changes to the for-loop, and replace with Array.some for readability. * chore(ListView android): Fix TSLint issues. --- tests/app/ui/list-view/list-view-tests.ts | 20 +++++++++++++++++++ .../ui/list-view/list-view-common.ts | 5 ++++- .../ui/list-view/list-view.android.ts | 9 ++++++++- tns-core-modules/ui/list-view/list-view.d.ts | 6 ++++++ .../ui/list-view/list-view.ios.ts | 5 +++++ 5 files changed, 43 insertions(+), 2 deletions(-) diff --git a/tests/app/ui/list-view/list-view-tests.ts b/tests/app/ui/list-view/list-view-tests.ts index b6a671841..96c823811 100644 --- a/tests/app/ui/list-view/list-view-tests.ts +++ b/tests/app/ui/list-view/list-view-tests.ts @@ -705,6 +705,26 @@ export class ListViewTest extends testModule.UITest { TKUnit.assert(weakRef.get(), weakRef.get() + " died prematurely!"); } + public test_check_if_item_at_index_is_visible() { + var listView = this.testView; + + listView.itemTemplate = "