|
|
@@ -6,11 +6,13 @@ import android.support.v7.widget.RecyclerView;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
import kr.co.zumo.app.R;
|
|
|
import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailBean;
|
|
|
-import kr.co.zumo.app.lifeplus.view.Event;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.ContentsDetailImageBean;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.LifeplusImageBean;
|
|
|
import kr.co.zumo.app.lifeplus.view.IEventListener;
|
|
|
|
|
|
/**
|
|
|
@@ -55,11 +57,26 @@ public class ContentsOverviewAdapter extends RecyclerView.Adapter<ContentsOvervi
|
|
|
|
|
|
@Override
|
|
|
public void onBindViewHolder(@NonNull ContentsOverviewHolder holder, int position) {
|
|
|
- holder.bind(position, contentsDetailList.get(position), new IEventListener() {
|
|
|
- @Override
|
|
|
- public void onEvent(Event event) {
|
|
|
- listener.onEvent(event);
|
|
|
+
|
|
|
+ ContentsDetailBean contentsDetailBean = contentsDetailList.get(position);
|
|
|
+
|
|
|
+ if (LifeplusImageBean.TYPE_HTML.equals(contentsDetailBean.getImageType())) {
|
|
|
+ // html 일 경우 커버 이미지를 사용한다.
|
|
|
+ List<ContentsDetailImageBean> list = contentsDetailBean.getItemImageList();
|
|
|
+ ContentsDetailImageBean imageBean = new ContentsDetailImageBean();
|
|
|
+ imageBean.setImageUrlForOverview(contentsDetailList.get(0).getOverviewImageUrl());
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
+ list.set(0, imageBean);
|
|
|
}
|
|
|
+ else {
|
|
|
+ list = new ArrayList<>();
|
|
|
+ list.add(imageBean);
|
|
|
+ }
|
|
|
+ contentsDetailBean.setItemImageList(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ holder.bind(position, contentsDetailBean, event -> {
|
|
|
+ listener.onEvent(event);
|
|
|
});
|
|
|
}
|
|
|
|