|
|
@@ -6,13 +6,16 @@ import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
import android.support.v7.widget.LinearLayoutManager;
|
|
|
import android.support.v7.widget.RecyclerView;
|
|
|
+import android.util.Log;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+
|
|
|
import kr.co.zumo.app.R;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.api.BookmarkBean;
|
|
|
import kr.co.zumo.app.lifeplus.helper.ActionBarHelper;
|
|
|
-import kr.co.zumo.app.lifeplus.model.BlankModel;
|
|
|
import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
|
|
|
@@ -26,7 +29,7 @@ import kr.co.zumo.app.lifeplus.view.screen.FragmentBase;
|
|
|
* @history 하세미 [2018-10-26] [최초 작성]
|
|
|
* @since 2018-10-26
|
|
|
*/
|
|
|
-public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> {
|
|
|
+public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> implements IBookMarkListView{
|
|
|
|
|
|
private RecyclerView recyclerViewBookMarkList;
|
|
|
|
|
|
@@ -38,18 +41,7 @@ public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> {
|
|
|
@Override
|
|
|
protected void onAfterActivityCreated(Bundle savedInstanceState) {
|
|
|
recyclerViewBookMarkList = findViewById(R.id.recycler_view_book_mark_list);
|
|
|
- BookMarkListAdapter bookMarkListAdapter = new BookMarkListAdapter();
|
|
|
- recyclerViewBookMarkList.setLayoutManager( new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
- recyclerViewBookMarkList.setAdapter(bookMarkListAdapter);
|
|
|
- recyclerViewBookMarkList.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
- // TODO: 클래스 분리 필요함
|
|
|
- @Override
|
|
|
- public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
|
|
- super.getItemOffsets(outRect, view, parent, state);
|
|
|
- outRect.bottom = ResourceUtil.dpToPx(10);
|
|
|
- outRect.top = ResourceUtil.dpToPx(10);
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -64,7 +56,7 @@ public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> {
|
|
|
|
|
|
@Override
|
|
|
protected BookMarkListPresenter definePresenter() {
|
|
|
- return new BookMarkListPresenter(getModel(BlankModel.class), this);
|
|
|
+ return new BookMarkListPresenter(getModel(BookMarkListModel.class), this);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -81,4 +73,21 @@ public class BookMarkListFragment extends FragmentBase<BookMarkListPresenter> {
|
|
|
protected boolean isSkipScreenWhenBack() {
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void drawContents(ArrayList<BookmarkBean> bookmarkBeans) {
|
|
|
+
|
|
|
+ BookMarkListAdapter bookMarkListAdapter = new BookMarkListAdapter(getActivity(), bookmarkBeans);
|
|
|
+ recyclerViewBookMarkList.setLayoutManager( new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
|
|
+ recyclerViewBookMarkList.setAdapter(bookMarkListAdapter);
|
|
|
+ recyclerViewBookMarkList.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
+ // TODO: 클래스 분리 필요함
|
|
|
+ @Override
|
|
|
+ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
|
|
+ super.getItemOffsets(outRect, view, parent, state);
|
|
|
+ outRect.bottom = ResourceUtil.dpToPx(10);
|
|
|
+ outRect.top = ResourceUtil.dpToPx(10);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|