Skip to content

Commit

Permalink
Decrease number of items in layout
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Mar 15, 2024
1 parent 4eeb075 commit 4642a37
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.google.common.truth.Truth.assertThat
import com.rubensousa.dpadrecyclerview.ChildAlignment
import com.rubensousa.dpadrecyclerview.DpadRecyclerView
import com.rubensousa.dpadrecyclerview.ParentAlignment
import com.rubensousa.dpadrecyclerview.test.TestAdapterConfiguration
import com.rubensousa.dpadrecyclerview.test.TestLayoutConfiguration
import com.rubensousa.dpadrecyclerview.test.helpers.onRecyclerView
import com.rubensousa.dpadrecyclerview.test.helpers.selectLastPosition
Expand Down Expand Up @@ -52,6 +53,10 @@ class LayoutWhileScrollingTest : DpadRecyclerViewTest() {
)
}

override fun getDefaultAdapterConfiguration(): TestAdapterConfiguration {
return super.getDefaultAdapterConfiguration().copy(numberOfItems = 100)
}

@Before
fun setup() {
launchFragment()
Expand All @@ -76,7 +81,7 @@ class LayoutWhileScrollingTest : DpadRecyclerViewTest() {
waitForCondition("Wait for scroll state change") { recyclerView ->
recyclerView.scrollState != RecyclerView.SCROLL_STATE_IDLE
}
repeat(3) {
repeat(2) {
onRecyclerView("Request layout") { recyclerView ->
if (recyclerView.scrollState != RecyclerView.SCROLL_STATE_IDLE) {
recyclerView.requestLayout()
Expand Down Expand Up @@ -115,7 +120,7 @@ class LayoutWhileScrollingTest : DpadRecyclerViewTest() {
fun testRequestingLayoutDuringScrollIsNotIgnored() {
// given
var layoutCompleted = 0
val layoutRequests = 3
val layoutRequests = 2
onRecyclerView("Enable layout during scroll") { recyclerView ->
recyclerView.setLayoutWhileScrollingEnabled(true)
recyclerView.addOnLayoutCompletedListener(
Expand Down

0 comments on commit 4642a37

Please sign in to comment.