Explorar el Código

[컨텐츠상세][Common] 함께본 콘텐츠 구현 중

Hasemi hace 7 años
padre
commit
8e6713287e

+ 2 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/custom/category/banner/MainBannerViewItemDotIndicator.java

@@ -59,11 +59,11 @@ public class MainBannerViewItemDotIndicator extends RecyclerView.ItemDecoration
 
   private IndexScrollListener indexScrollListener;
 
-  public MainBannerViewItemDotIndicator(Context context, @ColorRes int inActiveColor, @ColorRes int activeColor, int bottomOffest) {
+  public MainBannerViewItemDotIndicator(Context context, @ColorRes int inActiveColor, @ColorRes int activeColor, int bottomOffset) {
     this.context = context;
     this.inActiveColor = inActiveColor;
     this.activeColor = activeColor;
-    this.bottomOffset = bottomOffest;
+    this.bottomOffset = bottomOffset;
 
     mPaint.setStrokeCap(Paint.Cap.ROUND);
     mPaint.setStrokeWidth(mIndicatorStrokeWidth);

+ 13 - 2
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsAdapter.java

@@ -119,6 +119,9 @@ public class ContentsAdapter extends RecyclerView.Adapter<ContentsHolder> {
       seriesListBean.setContentsItemNumber(itemNumber);
       holder.bind(activity, position, seriesListBean, getItemCount(), eventListener);
     }
+    else if (holder instanceof ContentsWithShownHolder) {
+      holder.bindInternal();
+    }
     else {
       Log.e("APP#  ContentsAdapter | onBindViewHolder", "| position: " + position + " - " + this.hashCode());
       ContentsDetailBean bean = contentsDetailBeans.get(position);
@@ -141,7 +144,7 @@ public class ContentsAdapter extends RecyclerView.Adapter<ContentsHolder> {
     if (null == contentsDetailBeans) {
       return 0;
     }
-    return contentsDetailBeans.size() + (hasSeries() ? 1 : 0);
+    return contentsDetailBeans.size() + (hasSeries() ? 1 : 0) + 1;
   }
 
   protected boolean hasSeries() {
@@ -150,13 +153,18 @@ public class ContentsAdapter extends RecyclerView.Adapter<ContentsHolder> {
 
   protected int getSeriesPosition() {
     if (hasSeries()) {
-      return getItemCount() - 1;
+      //return getItemCount() - 1;
+      return getItemCount() - 2;
     }
     else {
       return -1;
     }
   }
 
+  protected int getShownWithContentsPosition() {
+    return getItemCount() - 1;
+  }
+
   @Override
   public int getItemViewType(int position) {
     int type = CARD_LISTICLE_COVER;
@@ -180,6 +188,9 @@ public class ContentsAdapter extends RecyclerView.Adapter<ContentsHolder> {
           break;
       }
     }
+    else if (position == getShownWithContentsPosition()) {
+      return WITH_SHOWN_CONTENTS;
+    }
     else {
       // contents
       switch (listType) {

+ 1 - 3
app/src/main/java/kr/co/zumo/app/lifeplus/view/screen/contents/ContentsWithShownHolder.java

@@ -10,7 +10,6 @@ import kr.co.zumo.app.R;
 import kr.co.zumo.app.lifeplus.util.ResourceUtil;
 import kr.co.zumo.app.lifeplus.view.Event;
 import kr.co.zumo.app.lifeplus.view.IEventListener;
-import kr.co.zumo.app.lifeplus.view.custom.Snapper;
 import kr.co.zumo.app.lifeplus.view.custom.category.banner.MainBannerViewItemDotIndicator;
 
 /**
@@ -48,11 +47,10 @@ public class ContentsWithShownHolder extends ContentsHolder {
 
       }
     });
+
     recyclerViewWithShownContents.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
     recyclerViewWithShownContents.setAdapter(shownWithContentsAdapter);
 
-    Snapper snapper = new Snapper(recyclerViewWithShownContents, 800);
-    snapper.attachToRecyclerView(recyclerViewWithShownContents);
 
     recyclerViewWithShownContents.addItemDecoration(new RecyclerView.ItemDecoration() {
       @Override