|
|
@@ -0,0 +1,89 @@
|
|
|
+package kr.co.zumo.app.lifeplus.view.fragment.my.coin;
|
|
|
+
|
|
|
+import android.graphics.Color;
|
|
|
+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 android.widget.ImageView;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import kr.co.zumo.app.R;
|
|
|
+import kr.co.zumo.app.lifeplus.bean.MyCoinBean;
|
|
|
+import kr.co.zumo.app.lifeplus.manager.ActionBarManager;
|
|
|
+import kr.co.zumo.app.lifeplus.model.BlankModel;
|
|
|
+import kr.co.zumo.app.lifeplus.view.fragment.FragmentBase;
|
|
|
+import kr.co.zumo.app.lifeplus.view.fragment.setting.SettingExpandableListViewDecoration;
|
|
|
+import kr.co.zumo.app.lifeplus.view.presenter.MyCoinPresenter;
|
|
|
+
|
|
|
+/**
|
|
|
+ * MyCoinFragment
|
|
|
+ * <pre>
|
|
|
+ * </pre>
|
|
|
+ *
|
|
|
+ * @author 하세미
|
|
|
+ * @version 1.0
|
|
|
+ * @history 하세미 [2018-10-17] [최초 작성]
|
|
|
+ * @since 2018-10-17
|
|
|
+ */
|
|
|
+public class MyCoinFragment extends FragmentBase<MyCoinPresenter> {
|
|
|
+
|
|
|
+ private RecyclerView recyclerViewCoinList;
|
|
|
+ private ImageView imageViewFilter;
|
|
|
+ private List<MyCoinBean> myCoinBeanList;
|
|
|
+
|
|
|
+
|
|
|
+ @Nullable
|
|
|
+ @Override
|
|
|
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
|
|
+ return inflater.inflate(R.layout.fragment_my_coin, container, false);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void onAfterActivityCreated(Bundle savedInstanceState) {
|
|
|
+ imageViewFilter = findViewById(R.id.image_view_filter);
|
|
|
+ //imageViewFilter.setOnClickListener(view -> {presenter.onEvent();});
|
|
|
+ doDummyData();
|
|
|
+ recyclerViewCoinList = findViewById(R.id.recycler_view_coin_list);
|
|
|
+ MyCoinListViewAdapter adapter = new MyCoinListViewAdapter(getActivity(), myCoinBeanList);
|
|
|
+ recyclerViewCoinList.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
|
|
|
+ SettingExpandableListViewDecoration decoration = new SettingExpandableListViewDecoration(getActivity(), Color.parseColor("#ebebeb"), 1);
|
|
|
+ recyclerViewCoinList.addItemDecoration(decoration);
|
|
|
+ recyclerViewCoinList.setAdapter(adapter);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void defineActionBar() {
|
|
|
+ ActionBarManager actionBarManager = ActionBarManager.getInstance();
|
|
|
+ actionBarManager.setProgressVisible(false);
|
|
|
+ actionBarManager.setTitleVisible(true);
|
|
|
+ actionBarManager.setTitle(R.string.use_coin);
|
|
|
+ actionBarManager.setBiVisible(false);
|
|
|
+ actionBarManager.setMenuVisible(true);
|
|
|
+ actionBarManager.setSearchVisible(true);
|
|
|
+ actionBarManager.setBackVisible(true);
|
|
|
+ actionBarManager.setScrollable(true);
|
|
|
+ actionBarManager.show();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public void doDummyData(){
|
|
|
+ myCoinBeanList = new ArrayList<>();
|
|
|
+ myCoinBeanList.add(new MyCoinBean("스타벅스 아이스 아메리카노 Tall","2018.05.27","사용", "-4,100" ));
|
|
|
+ myCoinBeanList.add(new MyCoinBean("4월 출석체크 미션 성공","2018.05.27","적립", "+1,500" ));
|
|
|
+ myCoinBeanList.add(new MyCoinBean("메소드 친환경 핸드워시 ","2018.05.27","사용", "-4,100" ));
|
|
|
+ myCoinBeanList.add(new MyCoinBean("호텔앤리조트 가평 힐링 스토리\n" + "펜션 1박","2018.05.27","사용", "-4,100" ));
|
|
|
+ myCoinBeanList.add(new MyCoinBean("스타벅스 아이스 아메리카노 Tall","2018.05.27","사용", "-4,100" ));
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ protected MyCoinPresenter definePresenter() {
|
|
|
+ return new MyCoinPresenter(getModel(BlankModel.class), this);
|
|
|
+ }
|
|
|
+}
|