部分UI修改
This commit is contained in:
@ -20,6 +20,8 @@ public class GridDivider extends RecyclerView.ItemDecoration {
|
||||
private int mDividerHight = 1;
|
||||
private int mGridCount;
|
||||
|
||||
private boolean mIsFilterLast;
|
||||
|
||||
/*
|
||||
int dividerHight 分割线的线宽
|
||||
int dividerColor 分割线的颜色
|
||||
@ -32,6 +34,15 @@ public class GridDivider extends RecyclerView.ItemDecoration {
|
||||
mColorPaint.setColor(dividerColor);
|
||||
}
|
||||
|
||||
public GridDivider(Context context, int dividerHight, int gridCount, int dividerColor, boolean isFilterLast) {
|
||||
this(context);
|
||||
mDividerHight = dividerHight;
|
||||
mGridCount = gridCount;
|
||||
mColorPaint = new Paint();
|
||||
mColorPaint.setColor(dividerColor);
|
||||
mIsFilterLast = isFilterLast;
|
||||
}
|
||||
|
||||
public GridDivider(Context context) {
|
||||
final TypedArray ta = context.obtainStyledAttributes(ATRRS);
|
||||
this.mDividerDarwable = ta.getDrawable(0);
|
||||
@ -60,6 +71,7 @@ public class GridDivider extends RecyclerView.ItemDecoration {
|
||||
|
||||
final int childCount = parent.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
if (mIsFilterLast && i == childCount - 1) continue;
|
||||
final View child = parent.getChildAt(i);
|
||||
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user