fun createFooterLayout(invalidList: List<ShopCarInfo.ListBean.DetailListBean>) {
val invalidgoodsView = LayoutInflater.from(activity).inflate(R.layout.cart_invalid_goods_layout, null)
val ll_good_container = invalidgoodsView.find<LinearLayout>(R.id.ll_good_container)
invalidList.forEachIndexed { index, detailListBean ->
val goodItem = mInflater.inflate(R.layout.item_shop_car_invalid_goods, ll_good_container, false)
val swipeLayout = goodItem.find<SwipeLayout>(R.id.swipeLayout)
swipeLayout.setCanDrag(false)
val ivGoodIcon = goodItem.find<ImageView>(R.id.iv_goods_icon)
val tvName = goodItem.find<TextView>(R.id.tv_name)
//
Global.displayImage(detailListBean.logoPath, ivGoodIcon)
tvName.text = detailListBean.commodityName
ll_good_container.addView(goodItem)
}
mAdapter.setFooterView(invalidgoodsView)
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:background="@color/colorPrimaryDark"
app:cardCornerRadius="@dimen/dp_4">
<LinearLayout
android:id="@+id/ll_good_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</android.support.v7.widget.CardView>
</LinearLayout>