Skip to content

Commit ef4a0c5

Browse files
entdarkhunterstich
authored andcommitted
[MaterialDividerItemDecoration] Fixed divider instant appearing or disappearing on insertion or removal
Resolves #4014 Resolves #3651 GIT_ORIGIN_REV_ID=d044f541f9928db1d03dea1866e8b8e4c699bf87 PiperOrigin-RevId: 601257154 (cherry picked from commit 1371091)
1 parent 540f5ee commit ef4a0c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/java/com/google/android/material/divider/MaterialDividerItemDecoration.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ private void drawForVerticalOrientation(@NonNull Canvas canvas, @NonNull Recycle
331331
int bottom = tempRect.bottom + Math.round(child.getTranslationY());
332332
int top = bottom - thickness;
333333
dividerDrawable.setBounds(left, top, right, bottom);
334+
int alpha = Math.round(child.getAlpha() * 255);
335+
dividerDrawable.setAlpha(alpha);
334336
dividerDrawable.draw(canvas);
335337
}
336338
}
@@ -375,8 +377,9 @@ private void drawForHorizontalOrientation(@NonNull Canvas canvas, @NonNull Recyc
375377
right = tempRect.right + translationX;
376378
left = right - thickness;
377379
}
378-
379380
dividerDrawable.setBounds(left, top, right, bottom);
381+
int alpha = Math.round(child.getAlpha() * 255);
382+
dividerDrawable.setAlpha(alpha);
380383
dividerDrawable.draw(canvas);
381384
}
382385
}

0 commit comments

Comments
 (0)