Fix dividers for LinearLayout (TabWidget)
child.getTop()/child.getLeft - already contains offset for divider height/width, so we need to subtract it, otherwise divider will be drawn behind the child. Change-Id: Idd6e5aa4b20e84c64daaefdf393bc00fafb26c45 Signed-off-by: Vladimir Baryshnikov <vovkab@gmail.com>
This commit is contained in:
@@ -307,7 +307,7 @@ public class LinearLayout extends ViewGroup {
|
||||
if (child != null && child.getVisibility() != GONE) {
|
||||
if (hasDividerBeforeChildAt(i)) {
|
||||
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
|
||||
final int top = child.getTop() - lp.topMargin;
|
||||
final int top = child.getTop() - lp.topMargin - mDividerHeight;
|
||||
drawHorizontalDivider(canvas, top);
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,7 @@ public class LinearLayout extends ViewGroup {
|
||||
if (child != null && child.getVisibility() != GONE) {
|
||||
if (hasDividerBeforeChildAt(i)) {
|
||||
final LayoutParams lp = (LayoutParams) child.getLayoutParams();
|
||||
final int left = child.getLeft() - lp.leftMargin;
|
||||
final int left = child.getLeft() - lp.leftMargin - mDividerWidth;
|
||||
drawVerticalDivider(canvas, left);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user