// Path: app/src/main/java/com/zmj/qvod/adapter/MyFragmentPagerAdapter.java
// public class MyFragmentPagerAdapter<T> extends FragmentPagerAdapter {
// 
//     private List<T> mFragment;
//     private List<String> mTitleList;
// 
//     /**
//      * 普通，主页使用
//      */
//     public MyFragmentPagerAdapter(FragmentManager fm, List<T> mFragment) {
//         super(fm);
//         this.mFragment = mFragment;
//     }
// 
//     /**
//      * 接收传递的标题
//      */
//     public MyFragmentPagerAdapter(FragmentManager fm, List<T> mFragment, List<String> mTitleList) {
//         super(fm);
//         this.mFragment = mFragment;
//         this.mTitleList = mTitleList;
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return (Fragment) mFragment.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragment.size();
//     }
// 
//     @Override
//     public void destroyItem(ViewGroup container, int position, Object object) {
//         super.destroyItem(container, position, object);
//     }
// 
//     /**
//      * 首页显示title，每日推荐等..
//      * 若有问题，移到对应单独页面
//      */
//     @Override
//     public CharSequence getPageTitle(int position) {
//         if (mTitleList != null) {
//             return mTitleList.get(position);
//         } else {
//             return "";
//         }
//     }
// 
// 
// }
// 
// Path: app/src/main/java/com/zmj/qvod/view/fragment/MineFragment.java
// @RequiresPresenter(MineFragmentPresenter.class)
// public class MineFragment extends BeamFragment<MineFragmentPresenter> {
// 
//     @BindView(R.id.tl_mine)
//     public TabLayout tlMine;
//     @BindView(R.id.vp_mine)
//     public ViewPager vpMine;
// 
//     private Unbinder unbinder;
// 
//     public static MineFragment newInstance() {
//         return new MineFragment();
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(R.layout.fragment_mine, null);
//         unbinder = ButterKnife.bind(this, view);
//         return view;
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//         unbinder.unbind();
//     }
// }
// 
// Path: app/src/main/java/com/zmj/qvod/view/fragment/PictureFragment.java
// @RequiresPresenter(PictureFragmentPresenter.class)
// public class PictureFragment extends BeamListFragment<PictureFragmentPresenter, PicBean.ItemsBean> {
// 
// 
//     public static PictureFragment newInstance(String tab) {
//         PictureFragment pictureFragment = new PictureFragment();
//         Bundle bundle = new Bundle();
//         bundle.putString("tab", tab);
//         pictureFragment.setArguments(bundle);
//         return pictureFragment;
//     }
// 
//     @Override
//     public ListConfig getConfig() {
//         return Constant.getLoadMoreConfig();
//     }
// 
//     @Override
//     public BaseViewHolder getViewHolder(ViewGroup parent, int viewType) {
//         return new PictureViewHolder(parent);
//     }
// }


import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import com.jude.beam.expansion.BeamBasePresenter;
import com.zmj.qvod.R;
import com.zmj.qvod.adapter.MyFragmentPagerAdapter;
import com.zmj.qvod.view.fragment.MineFragment;
import com.zmj.qvod.view.fragment.PictureFragment;
import java.util.ArrayList;
import java.util.List;
package com.zmj.qvod.presenter;




/**
 * Created by matt on 2017/4/18.
 */

public class MineFragmentPresenter extends BeamBasePresenter<MineFragment> {

    @Override
    protected void onCreateView(@NonNull MineFragment view) {
        super.onCreateView(view);

        initView();
    }

    private void initView() {
        List<Fragment> fragments = new ArrayList<>();
        List<String> titles = new ArrayList<>();
        //
        String[] tabs = getView().getResources().getStringArray(R.array.tab);
        //titles = Arrays.asList(tabs);
        for (String tab : tabs) {
            fragments.add(PictureFragment.newInstance(tab));
            titles.add(tab);
        }
// Path: app/src/main/java/com/zmj/qvod/adapter/MyFragmentPagerAdapter.java
// public class MyFragmentPagerAdapter<T> extends FragmentPagerAdapter {
// 
//     private List<T> mFragment;
//     private List<String> mTitleList;
// 
//     /**
//      * 普通，主页使用
//      */
//     public MyFragmentPagerAdapter(FragmentManager fm, List<T> mFragment) {
//         super(fm);
//         this.mFragment = mFragment;
//     }
// 
//     /**
//      * 接收传递的标题
//      */
//     public MyFragmentPagerAdapter(FragmentManager fm, List<T> mFragment, List<String> mTitleList) {
//         super(fm);
//         this.mFragment = mFragment;
//         this.mTitleList = mTitleList;
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return (Fragment) mFragment.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragment.size();
//     }
// 
//     @Override
//     public void destroyItem(ViewGroup container, int position, Object object) {
//         super.destroyItem(container, position, object);
//     }
// 
//     /**
//      * 首页显示title，每日推荐等..
//      * 若有问题，移到对应单独页面
//      */
//     @Override
//     public CharSequence getPageTitle(int position) {
//         if (mTitleList != null) {
//             return mTitleList.get(position);
//         } else {
//             return "";
//         }
//     }
// 
// 
// }
// 
// Path: app/src/main/java/com/zmj/qvod/view/fragment/MineFragment.java
// @RequiresPresenter(MineFragmentPresenter.class)
// public class MineFragment extends BeamFragment<MineFragmentPresenter> {
// 
//     @BindView(R.id.tl_mine)
//     public TabLayout tlMine;
//     @BindView(R.id.vp_mine)
//     public ViewPager vpMine;
// 
//     private Unbinder unbinder;
// 
//     public static MineFragment newInstance() {
//         return new MineFragment();
//     }
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(R.layout.fragment_mine, null);
//         unbinder = ButterKnife.bind(this, view);
//         return view;
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//         unbinder.unbind();
//     }
// }
// 
// Path: app/src/main/java/com/zmj/qvod/view/fragment/PictureFragment.java
// @RequiresPresenter(PictureFragmentPresenter.class)
// public class PictureFragment extends BeamListFragment<PictureFragmentPresenter, PicBean.ItemsBean> {
// 
// 
//     public static PictureFragment newInstance(String tab) {
//         PictureFragment pictureFragment = new PictureFragment();
//         Bundle bundle = new Bundle();
//         bundle.putString("tab", tab);
//         pictureFragment.setArguments(bundle);
//         return pictureFragment;
//     }
// 
//     @Override
//     public ListConfig getConfig() {
//         return Constant.getLoadMoreConfig();
//     }
// 
//     @Override
//     public BaseViewHolder getViewHolder(ViewGroup parent, int viewType) {
//         return new PictureViewHolder(parent);
//     }
// }


// Path: app/src/main/java/com/zmj/qvod/presenter/MineFragmentPresenter.java
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import com.jude.beam.expansion.BeamBasePresenter;
import com.zmj.qvod.R;
import com.zmj.qvod.adapter.MyFragmentPagerAdapter;
import com.zmj.qvod.view.fragment.MineFragment;
import com.zmj.qvod.view.fragment.PictureFragment;
import java.util.ArrayList;
import java.util.List;

package com.zmj.qvod.presenter;




/**
 * Created by matt on 2017/4/18.
 */

public class MineFragmentPresenter extends BeamBasePresenter<MineFragment> {

    @Override
    protected void onCreateView(@NonNull MineFragment view) {
        super.onCreateView(view);

        initView();
    }

    private void initView() {
        List<Fragment> fragments = new ArrayList<>();
        List<String> titles = new ArrayList<>();
        //
        String[] tabs = getView().getResources().getStringArray(R.array.tab);
        //titles = Arrays.asList(tabs);
        for (String tab : tabs) {
            fragments.add(PictureFragment.newInstance(tab));
            titles.add(tab);
        }
        MyFragmentPagerAdapter pagerAdapter = new MyFragmentPagerAdapter(getView().getFragmentManager(), fragments, titles);