|
|
@@ -11,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|
|
import com.itant.shibei.R;
|
|
|
import com.itant.shibei.adapter.GoodsAdapter;
|
|
|
import com.itant.shibei.bean.GoodsBean;
|
|
|
+import com.itant.shibei.widget.DividerItemDecoration;
|
|
|
import com.miekir.mvp.presenter.InjectPresenter;
|
|
|
import com.miekir.mvp.view.BaseMVPFragment;
|
|
|
|
|
|
@@ -49,6 +50,10 @@ public class GoodsFragment extends BaseMVPFragment implements IGoodsView {
|
|
|
// 必须要设置LayoutManager,否则RecyclerView不知道要使用什么布局,从而在界面上不显示
|
|
|
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false);
|
|
|
rv_goods.setLayoutManager(layoutManager);
|
|
|
+
|
|
|
+ int dividerWidth = (int) getResources().getDimension(R.dimen.margin_s);
|
|
|
+ DividerItemDecoration decoration = new DividerItemDecoration(dividerWidth);
|
|
|
+ rv_goods.addItemDecoration(decoration);
|
|
|
mAdapter = new GoodsAdapter(getActivity(), R.layout.item_goods, mGoodsList);
|
|
|
rv_goods.setAdapter(mAdapter);
|
|
|
|