Skip to content

Commit d0c735f

Browse files
author
Adam Cohen
committed
Fix issue 5905210, AdapterViewAnimator sending negative index to Adapter
Change-Id: I6c1a3c17f1009d9512328f5844e17025f95a216c
1 parent e8bb6fe commit d0c735f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/java/android/widget/AdapterViewAnimator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ void showOnly(int childIndex, boolean animate) {
558558
mCurrentWindowEnd = newWindowEnd;
559559
mCurrentWindowStartUnbounded = newWindowStartUnbounded;
560560
if (mRemoteViewsAdapter != null) {
561-
mRemoteViewsAdapter.setVisibleRangeHint(mCurrentWindowStart, mCurrentWindowEnd);
561+
int adapterStart = modulo(mCurrentWindowStart, adapterCount);
562+
int adapterEnd = modulo(mCurrentWindowEnd, adapterCount);
563+
mRemoteViewsAdapter.setVisibleRangeHint(adapterStart, adapterEnd);
562564
}
563565
}
564566
requestLayout();

0 commit comments

Comments
 (0)