|
|
@@ -1,15 +1,24 @@
|
|
|
package kr.co.zumo.app.lifeplus.view.fragment.main.category;
|
|
|
|
|
|
+import android.graphics.Rect;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.annotation.NonNull;
|
|
|
import android.support.annotation.Nullable;
|
|
|
+import android.support.v7.widget.LinearLayoutManager;
|
|
|
+import android.support.v7.widget.RecyclerView;
|
|
|
import android.view.LayoutInflater;
|
|
|
import android.view.View;
|
|
|
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.TextImageBean;
|
|
|
import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
|
|
|
import kr.co.zumo.app.lifeplus.model.BlankModel;
|
|
|
+import kr.co.zumo.app.lifeplus.util.ResourceUtil;
|
|
|
+import kr.co.zumo.app.lifeplus.view.custom.main.series.MainSeriesView;
|
|
|
import kr.co.zumo.app.lifeplus.view.fragment.FragmentBase;
|
|
|
import kr.co.zumo.app.lifeplus.view.presenter.main.category.SecondCategoryMainPresenter;
|
|
|
|
|
|
@@ -25,6 +34,11 @@ import kr.co.zumo.app.lifeplus.view.presenter.main.category.SecondCategoryMainPr
|
|
|
* @since 2018-10-24
|
|
|
*/
|
|
|
public class SecondCategoryMainFragment extends FragmentBase<SecondCategoryMainPresenter> {
|
|
|
+
|
|
|
+ private List<TextImageBean> textImageBeanList;
|
|
|
+ private RecyclerView recyclerViewSecondCategoryMain;
|
|
|
+ private MainSeriesView mainSeriesView;
|
|
|
+
|
|
|
@Override
|
|
|
protected View onAfterCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
return inflater.inflate(R.layout.fragment_second_category_main, container, false);
|
|
|
@@ -32,6 +46,22 @@ public class SecondCategoryMainFragment extends FragmentBase<SecondCategoryMainP
|
|
|
|
|
|
@Override
|
|
|
protected void onAfterActivityCreated(Bundle savedInstanceState) {
|
|
|
+ mainSeriesView = findViewById(R.id.series_image_text_view);
|
|
|
+ recyclerViewSecondCategoryMain = findViewById(R.id.recycler_view_second_category_main);
|
|
|
+ doDataSetting();
|
|
|
+ mainSeriesView.init(getActivity(), textImageBeanList, 10);
|
|
|
+ SecondCategoryMainAdapter secondCategoryMainAdapter = new SecondCategoryMainAdapter(getActivity());
|
|
|
+ LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false);
|
|
|
+ recyclerViewSecondCategoryMain.setLayoutManager(linearLayoutManager);
|
|
|
+ recyclerViewSecondCategoryMain.addItemDecoration(new RecyclerView.ItemDecoration() {
|
|
|
+ @Override
|
|
|
+ public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
|
|
|
+ super.getItemOffsets(outRect, view, parent, state);
|
|
|
+ outRect.bottom = ResourceUtil.dpToPx(7);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ recyclerViewSecondCategoryMain.setLayoutManager(linearLayoutManager);
|
|
|
+ recyclerViewSecondCategoryMain.setAdapter(secondCategoryMainAdapter);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -42,10 +72,26 @@ public class SecondCategoryMainFragment extends FragmentBase<SecondCategoryMainP
|
|
|
.search(actionBar -> presenter.onClickSearch(actionBar))
|
|
|
.back(actionBar -> presenter.onClickBack(actionBar))
|
|
|
.show();
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected SecondCategoryMainPresenter definePresenter() {
|
|
|
return new SecondCategoryMainPresenter(getModel(BlankModel.class), this);
|
|
|
}
|
|
|
+
|
|
|
+ public void doDataSetting() {
|
|
|
+ textImageBeanList = new ArrayList<>();
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_1, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_2, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_3, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_4, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_5, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_6, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_7, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_8, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_9, R.string.my_coin));
|
|
|
+ textImageBeanList.add(new TextImageBean(R.drawable.img_select_bg_10, R.string.my_coin));
|
|
|
+
|
|
|
+ }
|
|
|
}
|