Skip to content

Commit

Permalink
[MaterialDividerItemDecoration] Fixed divider instant appearing or di…
Browse files Browse the repository at this point in the history
…sappearing on insertion or removal

Resolves #4014
Resolves #3651

GIT_ORIGIN_REV_ID=d044f541f9928db1d03dea1866e8b8e4c699bf87
PiperOrigin-RevId: 601257154

(cherry picked from commit 1371091)
  • Loading branch information
entdark authored and hunterstich committed Mar 21, 2024
1 parent 540f5ee commit ef4a0c5
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -331,6 +331,8 @@ private void drawForVerticalOrientation(@NonNull Canvas canvas, @NonNull Recycle
int bottom = tempRect.bottom + Math.round(child.getTranslationY());
int top = bottom - thickness;
dividerDrawable.setBounds(left, top, right, bottom);
int alpha = Math.round(child.getAlpha() * 255);
dividerDrawable.setAlpha(alpha);
dividerDrawable.draw(canvas);
}
}
Expand Down Expand Up @@ -375,8 +377,9 @@ private void drawForHorizontalOrientation(@NonNull Canvas canvas, @NonNull Recyc
right = tempRect.right + translationX;
left = right - thickness;
}

dividerDrawable.setBounds(left, top, right, bottom);
int alpha = Math.round(child.getAlpha() * 255);
dividerDrawable.setAlpha(alpha);
dividerDrawable.draw(canvas);
}
}
Expand Down

0 comments on commit ef4a0c5

Please sign in to comment.