Skip to content

Commit cbe2f48

Browse files
Adam CohenAndroid (Google) Code Review
authored andcommitted
Merge "Fix issue 5905210, AdapterViewAnimator sending negative index to Adapter"
2 parents 50aca29 + d0c735f commit cbe2f48

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)