Bug 1402481 - Reverse incorrect sign of margin calculation. r=mcomella

MozReview-Commit-ID: ICS81o8pLOE

--HG--
extra : rebase_source : 9ee338ea1726ff529a77af8a93ba5fda52caa698
This commit is contained in:
Chenxia Liu 2017-09-22 09:12:38 -07:00
Родитель 9a193dcc02
Коммит f13df1a160
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -61,7 +61,9 @@ import android.view.View;
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child
.getLayoutParams();
final int topOfDivider = child.getTop() + params.topMargin;
final int dividerHeight = divider.getIntrinsicHeight();
// Use dividerHeight / 2 to account for divider height and place it evenly between the two views.
final int topOfDivider = child.getTop() - params.topMargin - dividerHeight / 2;
final int bottomOfDivider = topOfDivider + divider.getIntrinsicHeight();
divider.setBounds(left, topOfDivider, right, bottomOfDivider);
divider.draw(c);