|
|
@@ -6,7 +6,7 @@ import android.view.View;
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
/**
|
|
|
- * 第一个item顶部有分割线,其他item的顶部没有
|
|
|
+ * 第一个item顶部有分割线,其他item的顶部没有,因为CardView自带margin_bottom
|
|
|
*/
|
|
|
public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
|
|
|
private int space;
|
|
|
@@ -20,7 +20,6 @@ public class SpacesItemDecoration extends RecyclerView.ItemDecoration {
|
|
|
RecyclerView parent, RecyclerView.State state) {
|
|
|
outRect.left = space;
|
|
|
outRect.right = space;
|
|
|
- outRect.bottom = 0;
|
|
|
|
|
|
// Add top margin only for the first item to avoid double space between items
|
|
|
if (parent.getChildLayoutPosition(view) == 0) {
|