// Path: app/src/main/java/com/idisfkj/hightcopywx/contact/ContactFragment.java
// public class ContactFragment extends Fragment {
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.contact_layout, null);
//         return view;
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//     }
// }
// 
// Path: app/src/main/java/com/idisfkj/hightcopywx/find/FindFragment.java
// public class FindFragment extends Fragment{
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.find_layout,null);
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/idisfkj/hightcopywx/me/MeFragment.java
// public class MeFragment extends Fragment{
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.me_layout,null);
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/idisfkj/hightcopywx/wx/widget/WXFragment.java
// public class WXFragment extends Fragment implements WXView, LoaderManager.LoaderCallbacks<Cursor> {
//     @InjectView(R.id.wx_recyclerView)
//     RecyclerView wxRecyclerView;
//     private WXAdapter wxAdapter;
//     private WXPresent mWXPresent;
//     private WXDataHelper mHelper;
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.wx_layout, null);
//         ButterKnife.inject(this, view);
//         init();
//         return view;
//     }
// 
//     public void init() {
//         wxAdapter = new WXAdapter(getContext());
//         mWXPresent = new WXPresentImp(this);
//         wxRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
//         wxRecyclerView.addItemDecoration(new WXItemDecoration(getContext()));
//         wxRecyclerView.setAdapter(wxAdapter);
//         wxRecyclerView.addOnItemTouchListener(new OnItemTouchListener(wxRecyclerView) {
//             @Override
//             public void onItemListener(RecyclerView.ViewHolder vh) {
//                 Intent intent = new Intent(getActivity(), ChatActivity.class);
//                 Bundle bundle = new Bundle();
//                 bundle.putInt("_id", vh.getLayoutPosition()+1);
//                 intent.putExtras(bundle);
//                 startActivity(intent);
//             }
//         });
//         mHelper = new WXDataHelper(getContext());
//         getLoaderManager().initLoader(0, null, this);
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//         ButterKnife.reset(this);
//     }
// 
//     @Override
//     public Loader<Cursor> onCreateLoader(int id, Bundle args) {
//         return mHelper.getCursorLoader(SPUtils.getString("userPhone"));
//     }
// 
//     @Override
//     public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
//         if (loader != null && data.getCount() <= 0) {
//             mWXPresent.initData(mHelper);
//         }
//         wxAdapter.changeCursor(data);
//     }
// 
//     @Override
//     public void onLoaderReset(Loader<Cursor> loader) {
//         wxAdapter.changeCursor(null);
//     }
// }


import android.support.v4.app.Fragment;
import com.idisfkj.hightcopywx.contact.ContactFragment;
import com.idisfkj.hightcopywx.find.FindFragment;
import com.idisfkj.hightcopywx.me.MeFragment;
import com.idisfkj.hightcopywx.wx.widget.WXFragment;
package com.idisfkj.hightcopywx.main;



/**
 * Fragment工厂
 * Created by idisfkj on 16/4/19.
 * Email : idisfkj@qq.com.
 */
public class FragmentFactory {
    private Fragment mFragment;
    private int mSize;
    public FragmentFactory(int size) {
        mSize = size;
    }

    public int getSize(){
        return mSize;
    }

    public Fragment createFragment(int position){
        switch (position){
            case 0:
                mFragment = new WXFragment();
                break;
            case 1:
                mFragment = new ContactFragment();
                break;
            case 2:
// Path: app/src/main/java/com/idisfkj/hightcopywx/contact/ContactFragment.java
// public class ContactFragment extends Fragment {
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.contact_layout, null);
//         return view;
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//     }
// }
// 
// Path: app/src/main/java/com/idisfkj/hightcopywx/find/FindFragment.java
// public class FindFragment extends Fragment{
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.find_layout,null);
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/idisfkj/hightcopywx/me/MeFragment.java
// public class MeFragment extends Fragment{
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.me_layout,null);
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/idisfkj/hightcopywx/wx/widget/WXFragment.java
// public class WXFragment extends Fragment implements WXView, LoaderManager.LoaderCallbacks<Cursor> {
//     @InjectView(R.id.wx_recyclerView)
//     RecyclerView wxRecyclerView;
//     private WXAdapter wxAdapter;
//     private WXPresent mWXPresent;
//     private WXDataHelper mHelper;
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         View view = LayoutInflater.from(getContext()).inflate(R.layout.wx_layout, null);
//         ButterKnife.inject(this, view);
//         init();
//         return view;
//     }
// 
//     public void init() {
//         wxAdapter = new WXAdapter(getContext());
//         mWXPresent = new WXPresentImp(this);
//         wxRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
//         wxRecyclerView.addItemDecoration(new WXItemDecoration(getContext()));
//         wxRecyclerView.setAdapter(wxAdapter);
//         wxRecyclerView.addOnItemTouchListener(new OnItemTouchListener(wxRecyclerView) {
//             @Override
//             public void onItemListener(RecyclerView.ViewHolder vh) {
//                 Intent intent = new Intent(getActivity(), ChatActivity.class);
//                 Bundle bundle = new Bundle();
//                 bundle.putInt("_id", vh.getLayoutPosition()+1);
//                 intent.putExtras(bundle);
//                 startActivity(intent);
//             }
//         });
//         mHelper = new WXDataHelper(getContext());
//         getLoaderManager().initLoader(0, null, this);
//     }
// 
//     @Override
//     public void onDestroyView() {
//         super.onDestroyView();
//         ButterKnife.reset(this);
//     }
// 
//     @Override
//     public Loader<Cursor> onCreateLoader(int id, Bundle args) {
//         return mHelper.getCursorLoader(SPUtils.getString("userPhone"));
//     }
// 
//     @Override
//     public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
//         if (loader != null && data.getCount() <= 0) {
//             mWXPresent.initData(mHelper);
//         }
//         wxAdapter.changeCursor(data);
//     }
// 
//     @Override
//     public void onLoaderReset(Loader<Cursor> loader) {
//         wxAdapter.changeCursor(null);
//     }
// }


// Path: app/src/main/java/com/idisfkj/hightcopywx/main/FragmentFactory.java
import android.support.v4.app.Fragment;
import com.idisfkj.hightcopywx.contact.ContactFragment;
import com.idisfkj.hightcopywx.find.FindFragment;
import com.idisfkj.hightcopywx.me.MeFragment;
import com.idisfkj.hightcopywx.wx.widget.WXFragment;

package com.idisfkj.hightcopywx.main;



/**
 * Fragment工厂
 * Created by idisfkj on 16/4/19.
 * Email : idisfkj@qq.com.
 */
public class FragmentFactory {
    private Fragment mFragment;
    private int mSize;
    public FragmentFactory(int size) {
        mSize = size;
    }

    public int getSize(){
        return mSize;
    }

    public Fragment createFragment(int position){
        switch (position){
            case 0:
                mFragment = new WXFragment();
                break;
            case 1:
                mFragment = new ContactFragment();
                break;
            case 2:
                mFragment = new FindFragment();