|
|
@@ -129,13 +129,13 @@ public class BookMarkListModel extends Model {
|
|
|
* bookmarkBeans 과 size가 연동되야하므로 항상 요청할 때 동적 생성을 해야한다.
|
|
|
*/
|
|
|
|
|
|
- List<ArrayList<BookmarkBean>> bookmarks = new ArrayList<>(5);
|
|
|
- bookmarks.add(new ArrayList<>());
|
|
|
+ List<ArrayList<BookmarkBean>> bookmarks = new ArrayList<>(4);
|
|
|
bookmarks.add(new ArrayList<>());
|
|
|
bookmarks.add(new ArrayList<>());
|
|
|
bookmarks.add(new ArrayList<>());
|
|
|
bookmarks.add(new ArrayList<>());
|
|
|
|
|
|
+ // 카테고리 별로 구분
|
|
|
for (BookmarkBean bean : bookmarkBeans) {
|
|
|
int index;
|
|
|
String categoryNumber = bean.getCategoryNumber();
|
|
|
@@ -147,10 +147,6 @@ public class BookMarkListModel extends Model {
|
|
|
|
|
|
if (index > -1) {
|
|
|
List<BookmarkBean> beans = bookmarks.get(index);
|
|
|
-// if (null == beans) {
|
|
|
-// beans = new ArrayList<>();
|
|
|
-// bookmarks.set(index, beans);
|
|
|
-// }
|
|
|
// 복사해서 넣어준다.
|
|
|
beans.add(bean.getClone());
|
|
|
}
|
|
|
@@ -170,7 +166,7 @@ public class BookMarkListModel extends Model {
|
|
|
categoryAnchorIndies.add(categorizedBookmarkList.size());
|
|
|
|
|
|
// 첫번째 아이템에 타이틀 지정
|
|
|
- beans.get(0).setCategoryTitle(i);
|
|
|
+ beans.get(0).setCategoryTitleByIndex(i);
|
|
|
categorizedBookmarkList.addAll(beans);
|
|
|
|
|
|
// 카테고리 인덱스 저장
|
|
|
@@ -190,28 +186,7 @@ public class BookMarkListModel extends Model {
|
|
|
}
|
|
|
|
|
|
private int getCategoryIndexById(String categoryNumber) {
|
|
|
- int index;
|
|
|
- switch (categoryNumber) {
|
|
|
- case CategoryID.CATEGORY_1:
|
|
|
- index = 0;
|
|
|
- break;
|
|
|
- case CategoryID.CATEGORY_2:
|
|
|
- index = 1;
|
|
|
- break;
|
|
|
- case CategoryID.CATEGORY_3:
|
|
|
- index = 2;
|
|
|
- break;
|
|
|
- case CategoryID.CATEGORY_4:
|
|
|
- index = 3;
|
|
|
- break;
|
|
|
- case CategoryID.CATEGORY_5:
|
|
|
- index = 4;
|
|
|
- break;
|
|
|
- default:
|
|
|
- index = -1;
|
|
|
- break;
|
|
|
- }
|
|
|
- return index;
|
|
|
+ return CategoryID.ofIndex(categoryNumber);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -299,7 +274,7 @@ public class BookMarkListModel extends Model {
|
|
|
/**
|
|
|
* 좋아요 갱신
|
|
|
*
|
|
|
- * @param index data 의 index
|
|
|
+ * @param index data 의 index
|
|
|
* @param viewListIndex view 의 index
|
|
|
*/
|
|
|
public void updateLiked(int index, int viewListIndex) {
|
|
|
@@ -323,7 +298,7 @@ public class BookMarkListModel extends Model {
|
|
|
/**
|
|
|
* 북마크 갱신
|
|
|
*
|
|
|
- * @param index data 의 index
|
|
|
+ * @param index data 의 index
|
|
|
* @param viewListIndex view 의 index
|
|
|
*/
|
|
|
public void updateBookmarked(int index, int viewListIndex) {
|