From 4b26cca1e6f1b3264544835b7e7fa76014b5957e Mon Sep 17 00:00:00 2001 From: Ruben Sousa Date: Thu, 30 May 2024 12:32:45 +0200 Subject: [PATCH] Remove waitForLayout --- .../test/helpers/RecyclerViewTestExtensions.kt | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/helpers/RecyclerViewTestExtensions.kt b/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/helpers/RecyclerViewTestExtensions.kt index 8e4b5ac1..53ebee4b 100644 --- a/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/helpers/RecyclerViewTestExtensions.kt +++ b/dpadrecyclerview/src/androidTest/kotlin/com/rubensousa/dpadrecyclerview/test/helpers/RecyclerViewTestExtensions.kt @@ -186,22 +186,6 @@ fun waitForIdleScrollState(id: Int = R.id.recyclerView) { Espresso.onView(withId(id)).perform(DpadRecyclerViewActions.waitForIdleScroll()) } -fun waitForLayout() { - var completedLayout = false - onRecyclerView("Add listener") { recyclerView -> - recyclerView.addOnLayoutCompletedListener(object : - DpadRecyclerView.OnLayoutCompletedListener { - override fun onLayoutCompleted(state: RecyclerView.State) { - completedLayout = true - } - }) - } - waitForCondition("Waiting for layout") { recyclerView -> - !recyclerView.isLayoutRequested && completedLayout - } -} - - fun waitForAdapterUpdate(id: Int = R.id.recyclerView) { Espresso.onView(withId(id)).perform(DpadRecyclerViewActions.waitForAdapterUpdate()) }