Open Sum41forever opened 7 years ago
现在好像只有线性的
public XRecyclerView noDivider() { setItemAnimator(new DefaultItemAnimator()); setHasFixedSize(true); return this; } public XRecyclerView horizontalDivider(@ColorRes int colorRes, @DimenRes int dimenRes) { setItemAnimator(new DefaultItemAnimator()); setHasFixedSize(true); addItemDecoration(new HorizontalDividerItemDecoration.Builder(getContext()) .colorResId(colorRes) .size(getContext().getResources().getDimensionPixelSize(dimenRes)) .build() ); return this; } public XRecyclerView verticalDivider(@ColorRes int colorRes, @DimenRes int dimenRes) { setItemAnimator(new DefaultItemAnimator()); setHasFixedSize(true); addItemDecoration(new VerticalDividerItemDecoration.Builder(getContext()) .colorResId(colorRes) .size(getContext().getResources().getDimensionPixelSize(dimenRes)) .build() ); return this; }
感谢反馈 @Sum41forever
现在好像只有线性的