diff --git a/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/ColumnTest.java b/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/ColumnTest.java index 43f3c1b..1c0719f 100644 --- a/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/ColumnTest.java +++ b/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/ColumnTest.java @@ -1,6 +1,7 @@ package com.beloo.widget.chipslayoutmanager; import android.content.Context; +import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.res.Configuration; import android.graphics.Rect; @@ -86,7 +87,7 @@ public RecyclerView.LayoutManager layoutManager(Context context) { activity.runOnUiThread(() -> activity.initialize()); } - private IScrollingContract retrieveLayoutManager() { + private RecyclerView.LayoutManager retrieveLayoutManager() { this.layoutManager = getLayoutManager(); return layoutManager; } @@ -310,6 +311,13 @@ public void rotate_LMHasItems_firstItemNotChanged() throws Exception { assertNotEquals(-1, actual); assertEquals("first visible positions before and after rotation doesn't match", expected, actual); System.out.println("first visible position = " + actual); + + resetToInitialAfterRotate(); + } + + void resetToInitialAfterRotate() throws Exception { + activityTestRule.launchActivity(new Intent(activity, TestActivity.class)); + InstrumentalUtil.waitForIdle(); } @Test diff --git a/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/RowTest.java b/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/RowTest.java index 6d402f8..fbbe0e8 100644 --- a/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/RowTest.java +++ b/sample/src/androidTest/java/com/beloo/widget/chipslayoutmanager/RowTest.java @@ -102,7 +102,7 @@ public RecyclerView.LayoutManager layoutManager(Context context) { public void onSetUp() throws Exception {} - private IScrollingContract retrieveLayoutManager() { + private RecyclerView.LayoutManager retrieveLayoutManager() { layoutManager = getLayoutManager(); return layoutManager; }