Skip to content

Commit

Permalink
Automated g4 rollback of changelist 458265064
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 461012017
  • Loading branch information
mnlmato authored and paulfthomas committed Jul 14, 2022
1 parent e968929 commit 34ac0ec
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,18 +317,16 @@ private void drawForVerticalOrientation(@NonNull Canvas canvas, @NonNull Recycle
left += isRtl ? insetEnd : insetStart;
right -= isRtl ? insetStart : insetEnd;

int itemCount = parent.getAdapter() == null ? 0 : parent.getAdapter().getItemCount();
int dividerCount = lastItemDecorated ? itemCount : itemCount - 1;
int childCount = parent.getChildCount();
int dividerCount = lastItemDecorated ? childCount : childCount - 1;
for (int i = 0; i < dividerCount; i++) {
View child = parent.getChildAt(i);
if (child != null) {
parent.getDecoratedBoundsWithMargins(child, tempRect);
// Take into consideration any translationY added to the view.
int bottom = tempRect.bottom + Math.round(child.getTranslationY());
int top = bottom - dividerDrawable.getIntrinsicHeight() - thickness;
dividerDrawable.setBounds(left, top, right, bottom);
dividerDrawable.draw(canvas);
}
parent.getDecoratedBoundsWithMargins(child, tempRect);
// Take into consideration any translationY added to the view.
int bottom = tempRect.bottom + Math.round(child.getTranslationY());
int top = bottom - dividerDrawable.getIntrinsicHeight() - thickness;
dividerDrawable.setBounds(left, top, right, bottom);
dividerDrawable.draw(canvas);
}
canvas.restore();
}
Expand Down

0 comments on commit 34ac0ec

Please sign in to comment.