|
|
@@ -112,7 +112,7 @@ public class SecondCategoryMainAdapter extends RecyclerView.Adapter<SecondCatego
|
|
|
|
|
|
@Override
|
|
|
public int getItemCount() {
|
|
|
- return (int) Math.ceil((float)contentsBeans.size() / 3f);
|
|
|
+ return (int) Math.ceil((float) contentsBeans.size() / 3f);
|
|
|
}
|
|
|
|
|
|
private boolean hasBanner() {
|
|
|
@@ -121,11 +121,18 @@ public class SecondCategoryMainAdapter extends RecyclerView.Adapter<SecondCatego
|
|
|
|
|
|
@Override
|
|
|
public int getItemViewType(int position) {
|
|
|
- position = position % 3;
|
|
|
- switch (position) {
|
|
|
+ int position2 = position % 3;
|
|
|
+
|
|
|
+ switch (position2) {
|
|
|
case 0:
|
|
|
return FIRST_ROW;
|
|
|
case 1:
|
|
|
+ /**
|
|
|
+ * // 두 번째 row 이지만 마지막에 표시되어 큰 이미지가 표시되지 않을 경우 큰 이미지의 여백을 없애기 위해서 third 로 표시한다.
|
|
|
+ */
|
|
|
+ if (contentsBeans.size() - position * 3 < 3) {
|
|
|
+ return THIRD_ROW;
|
|
|
+ }
|
|
|
return SECOND_ROW;
|
|
|
case 2:
|
|
|
return THIRD_ROW;
|