|
|
@@ -1,106 +0,0 @@
|
|
|
-package kr.co.zumo.app.lifeplus.view.fragment;
|
|
|
-
|
|
|
-import android.os.Bundle;
|
|
|
-import android.support.v4.app.Fragment;
|
|
|
-import android.support.v4.app.FragmentManager;
|
|
|
-import android.support.v4.app.FragmentPagerAdapter;
|
|
|
-import android.util.Log;
|
|
|
-import android.view.LayoutInflater;
|
|
|
-import android.view.View;
|
|
|
-import android.view.ViewGroup;
|
|
|
-import android.widget.TextView;
|
|
|
-
|
|
|
-import kr.co.zumo.app.R;
|
|
|
-import kr.co.zumo.app.lifeplus.view.presenter.Event;
|
|
|
-import kr.co.zumo.app.lifeplus.view.presenter.Presenter;
|
|
|
-
|
|
|
-/**
|
|
|
- * SectionsPagerAdapter
|
|
|
- * <pre>
|
|
|
- * tutorial viewpager adapter 클래스
|
|
|
- * </pre>
|
|
|
- *
|
|
|
- * @author 하세미
|
|
|
- * @version 1.0
|
|
|
- * @history 하세미 [2018-09-18] [최초 작성]
|
|
|
- * @since 2018-09-18
|
|
|
- */
|
|
|
-public class SectionsPagerAdapter extends FragmentPagerAdapter {
|
|
|
-
|
|
|
- private Presenter presenter;
|
|
|
-
|
|
|
- public SectionsPagerAdapter(FragmentManager fm) {
|
|
|
- super(fm);
|
|
|
- }
|
|
|
-
|
|
|
- public void setPresenter(Presenter presenter){
|
|
|
- this.presenter = presenter;
|
|
|
- }
|
|
|
- @Override
|
|
|
- public Fragment getItem(int position) {
|
|
|
- return PlaceholderFragment.newInstance((position + 1), presenter);
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public int getCount() {
|
|
|
- return 5;
|
|
|
- }
|
|
|
-
|
|
|
- public static class PlaceholderFragment extends Fragment {
|
|
|
-
|
|
|
- private Presenter presenter;
|
|
|
- private static final String ARG_SECTION_NUMBER = "section_number";
|
|
|
-
|
|
|
- public PlaceholderFragment() {
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Returns a new instance of this fragment for the given section
|
|
|
- * number.
|
|
|
- */
|
|
|
- public static PlaceholderFragment newInstance(int sectionNumber, Presenter presenter) {
|
|
|
- PlaceholderFragment fragment = new PlaceholderFragment();
|
|
|
- Bundle args = new Bundle();
|
|
|
- args.putInt(ARG_SECTION_NUMBER, sectionNumber);
|
|
|
- fragment.setArguments(args);
|
|
|
- fragment.setPresenter(presenter);
|
|
|
- return fragment;
|
|
|
- }
|
|
|
-
|
|
|
- public void setPresenter(Presenter presenter){
|
|
|
- this.presenter = presenter;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
|
- Bundle savedInstanceState) {
|
|
|
- View rootView = inflater.inflate(R.layout.tutorial_layout2, container, false);
|
|
|
- int count = getArguments().getInt(ARG_SECTION_NUMBER);
|
|
|
- Log.e("APP# PlaceholderFragment | onCreateView", "|" + count);
|
|
|
-
|
|
|
- TextView button1Tutorial = (TextView) rootView.findViewById(R.id.button1_tutorial);
|
|
|
- TextView button2Tutorial = (TextView) rootView.findViewById(R.id.button2_tutorial);
|
|
|
-
|
|
|
- TextView textViewTutorial = (TextView) rootView.findViewById(R.id.text_view_tutorial);
|
|
|
- textViewTutorial.setText("Tutorial " + getArguments().getInt(ARG_SECTION_NUMBER));
|
|
|
-
|
|
|
- if (count == 5) {
|
|
|
- button1Tutorial.setVisibility(View.INVISIBLE);
|
|
|
- button2Tutorial.setText("닫기");
|
|
|
- }
|
|
|
-
|
|
|
- button1Tutorial.setOnClickListener(new View.OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View view) {
|
|
|
- Log.e("APP# PlaceholderFragment | onClick", "|" + "onClick");
|
|
|
- presenter.onEvent(Event.TUTORIAL_CLOSE);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- return rootView;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|