package com.ghx.app.lulu.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;

import com.ghx.app.lulu.fragment.other.HomeItemFragment;
import com.ghx.app.lulu.model.HomeViewPagerBean;
import com.ghx.app.lulu.utils.LogUtil;

import java.util.List;

/**
 * Created by guo_hx on 2016/9/26.17:08
 */

public class HomeViewPagerAdapter extends FragmentStatePagerAdapter {


    private List<HomeViewPagerBean> mList;

    public HomeViewPagerAdapter(FragmentManager fm, List<HomeViewPagerBean> list) {
        super(fm);
        mList = list;
    }

    @Override
    public Fragment getItem(int position) {
        HomeItemFragment homeItemFragment = new HomeItemFragment();
        homeItemFragment.setFlag(mList.get(position).id);
        LogUtil.i_log("new HomeItemFragment()");
        return homeItemFragment;
    }

    @Override
    public int getCount() {
        return mList == null ? 0 : mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mList.get(position).title;
    }

}

@@ -204,16 +204,176 @@
 Group;%0A%0A
+import com.ghx.app.lulu.fragment.home.FourthFragment;%0Aimport com.ghx.app.lulu.fragment.home.HomeFragment;%0Aimport com.ghx.app.lulu.fragment.other.GuideFragment;%0A
 import c
@@ -413,32 +413,32 @@
 meItemFragment;%0A
-
 import com.ghx.a
@@ -654,17 +654,16 @@
 pter %7B%0A%0A
-%0A
     priv
@@ -880,32 +880,65 @@
 int position) %7B%0A
+        if (position == 0) %7B%0A    
         HomeItem
@@ -997,16 +997,20 @@
         
+   
+ 
 homeItem
@@ -1059,16 +1059,20 @@
         
+    
 LogUtil.
@@ -1108,24 +1108,28 @@
 %22);%0A        
+  
+  
 return homeI
@@ -1141,16 +1141,85 @@
 agment;%0A
+        %7D else %7B%0A            return new FourthFragment();%0A        %7D%0A%0A
     %7D%0A%0A 

Revert "Revert "2016.9.28""