// Path: app/src/main/java/com/gersion/pictureshow/ui/factory/JokeFragmentFactory.java
// public class JokeFragmentFactory {
//     static TextFragment mTextFragment;
//     static PictureFragment mPictureFragment ;
//     static RandomFragment mRandomFragment ;
//     static Fragment mFragment;
//     public static Fragment getFragment(int position){
//         switch (position){
//             case 0:
//                 mFragment =  getPictureFragment();
//                 break;
//             case 1:
//                 mFragment = getTextFragment();
//             break;
//             case 2:
//                 mFragment =  getRandomFragment();
//             break;
//         }
//         return mFragment;
//     }
// 
//     private static TextFragment getTextFragment(){
//         if (mTextFragment == null){
//             synchronized (JokeFragmentFactory.class){
//                 if (mTextFragment == null){
//                     mTextFragment = new TextFragment();
//                 }
//             }
//         }
//         return mTextFragment;
//     }
// 
//     private static RandomFragment getRandomFragment(){
//         if (mRandomFragment == null){
//             synchronized (JokeFragmentFactory.class){
//                 if (mRandomFragment == null){
//                     mRandomFragment = new RandomFragment();
//                 }
//             }
//         }
//         return mRandomFragment;
//     }
// 
//     private static PictureFragment getPictureFragment(){
//         if (mPictureFragment == null){
//             synchronized (JokeFragmentFactory.class){
//                 if (mPictureFragment == null){
//                     mPictureFragment = new PictureFragment();
//                 }
//             }
//         }
//         return mPictureFragment;
//     }
// }


import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import com.gersion.pictureshow.ui.factory.JokeFragmentFactory;
import com.orhanobut.logger.Logger;
import java.util.List;
package com.gersion.pictureshow.ui.adapter;




/**
 * @作者 Gersy
 * @版本
 * @包名 com.gersion.pictureshow.ui.adapter
 * @待完成
 * @创建时间 2016/11/23
 * @功能描述 TODO
 * @更新人 $
 * @更新时间 $
 * @更新版本 $
 */
public class JokePagerAdapter extends FragmentStatePagerAdapter {

    public JokePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = JokeFragmentFactory.getFragment(position);
        return fragment;
    }

    @Override
// Path: app/src/main/java/com/gersion/pictureshow/ui/factory/JokeFragmentFactory.java
// public class JokeFragmentFactory {
//     static TextFragment mTextFragment;
//     static PictureFragment mPictureFragment ;
//     static RandomFragment mRandomFragment ;
//     static Fragment mFragment;
//     public static Fragment getFragment(int position){
//         switch (position){
//             case 0:
//                 mFragment =  getPictureFragment();
//                 break;
//             case 1:
//                 mFragment = getTextFragment();
//             break;
//             case 2:
//                 mFragment =  getRandomFragment();
//             break;
//         }
//         return mFragment;
//     }
// 
//     private static TextFragment getTextFragment(){
//         if (mTextFragment == null){
//             synchronized (JokeFragmentFactory.class){
//                 if (mTextFragment == null){
//                     mTextFragment = new TextFragment();
//                 }
//             }
//         }
//         return mTextFragment;
//     }
// 
//     private static RandomFragment getRandomFragment(){
//         if (mRandomFragment == null){
//             synchronized (JokeFragmentFactory.class){
//                 if (mRandomFragment == null){
//                     mRandomFragment = new RandomFragment();
//                 }
//             }
//         }
//         return mRandomFragment;
//     }
// 
//     private static PictureFragment getPictureFragment(){
//         if (mPictureFragment == null){
//             synchronized (JokeFragmentFactory.class){
//                 if (mPictureFragment == null){
//                     mPictureFragment = new PictureFragment();
//                 }
//             }
//         }
//         return mPictureFragment;
//     }
// }


// Path: app/src/main/java/com/gersion/pictureshow/ui/adapter/JokePagerAdapter.java
import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import com.gersion.pictureshow.ui.factory.JokeFragmentFactory;
import com.orhanobut.logger.Logger;
import java.util.List;

package com.gersion.pictureshow.ui.adapter;




/**
 * @作者 Gersy
 * @版本
 * @包名 com.gersion.pictureshow.ui.adapter
 * @待完成
 * @创建时间 2016/11/23
 * @功能描述 TODO
 * @更新人 $
 * @更新时间 $
 * @更新版本 $
 */
public class JokePagerAdapter extends FragmentStatePagerAdapter {

    public JokePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = JokeFragmentFactory.getFragment(position);
        return fragment;
    }

    @Override
    public int getCount() {