// Path: app/src/main/java/com/bean/simplenews/common/Constants.java
// public class Constants {
//     public static boolean DEBUG = true;
//     public static boolean NIGHT = false;
//     public static final String TYPE = "TYPE";
//     public static final String NEWS = "NEWS";
//     public static final int NEWS_TYPE_TOP = 0;
//     public static final int NEWS_TYPE_NBA = 1;
//     public static final int NEWS_TYPE_TEC = 2;
//     public static final int NEWS_TYPE_FIN = 3;
//     public static final int NEWS_TYPE_CARS = 4;
//     public static final int NEWS_TYPE_JOKES = 5;
//     public static final String prefix =
//             "<style type=\"text/css\">body{font-size:100%;text-align:justify;color:#424242;padding:10px;}p{font-weight:500;font-size:0.78em;line-height:1.5;}p strong{font-weight:600}h3{font-size:1.4em}</style><body>";
//     public static final String suffix = "</body>";
// }
// 
// Path: app/src/main/java/com/bean/simplenews/common/adapter/BaseFragmentPagerAdapter.java
// public class BaseFragmentPagerAdapter extends FragmentPagerAdapter{
// 
//     private final List<Fragment> mFragments = new ArrayList<>();
//     private final List<String> mFragmentTitles = new ArrayList<>();
// 
//     public BaseFragmentPagerAdapter(FragmentManager fm) {
//         super(fm);
//     }
// 
//     public void addFragment(Fragment fragment, String title) {
//         mFragments.add(fragment);
//         mFragmentTitles.add(title);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mFragments.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragments.size();
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
//         return mFragmentTitles.get(position);
//     }
// }
// 
// Path: app/src/main/java/com/bean/simplenews/util/LogUtils.java
// public class LogUtils {
// 
//     public static void v(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.v(tag, message);
//         }
//     }
// 
//     public static void d(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.d(tag, message);
//         }
//     }
// 
//     public static void i(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.i(tag, message);
//         }
//     }
// 
//     public static void w(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.w(tag, message);
//         }
//     }
// 
//     public static void e(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.e(tag, message);
//         }
//     }
// 
//     public static void e(String tag, String message, Exception e) {
//         if(Constants.DEBUG) {
//             Log.e(tag, message, e);
//         }
//     }
// }


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bean.simplenews.R;
import com.bean.simplenews.common.Constants;
import com.bean.simplenews.common.adapter.BaseFragmentPagerAdapter;
import com.bean.simplenews.util.LogUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
package com.bean.simplenews.module.news.widget;




public class NewsFragment extends Fragment {

    @BindView(R.id.tab_layout)
    TabLayout mTabLayout;
    @BindView(R.id.viewpager)
    ViewPager mViewPager;
    private Unbinder unbinder;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_news, null);
        unbinder=ButterKnife.bind(this, view);

        BaseFragmentPagerAdapter adapter = new BaseFragmentPagerAdapter(getChildFragmentManager());
        adapter.addFragment(NewsListFragment.newInstance(Constants.NEWS_TYPE_TOP), getString(R.string.top));
        adapter.addFragment(NewsListFragment.newInstance(Constants.NEWS_TYPE_NBA), getString(R.string.nba));
// Path: app/src/main/java/com/bean/simplenews/common/Constants.java
// public class Constants {
//     public static boolean DEBUG = true;
//     public static boolean NIGHT = false;
//     public static final String TYPE = "TYPE";
//     public static final String NEWS = "NEWS";
//     public static final int NEWS_TYPE_TOP = 0;
//     public static final int NEWS_TYPE_NBA = 1;
//     public static final int NEWS_TYPE_TEC = 2;
//     public static final int NEWS_TYPE_FIN = 3;
//     public static final int NEWS_TYPE_CARS = 4;
//     public static final int NEWS_TYPE_JOKES = 5;
//     public static final String prefix =
//             "<style type=\"text/css\">body{font-size:100%;text-align:justify;color:#424242;padding:10px;}p{font-weight:500;font-size:0.78em;line-height:1.5;}p strong{font-weight:600}h3{font-size:1.4em}</style><body>";
//     public static final String suffix = "</body>";
// }
// 
// Path: app/src/main/java/com/bean/simplenews/common/adapter/BaseFragmentPagerAdapter.java
// public class BaseFragmentPagerAdapter extends FragmentPagerAdapter{
// 
//     private final List<Fragment> mFragments = new ArrayList<>();
//     private final List<String> mFragmentTitles = new ArrayList<>();
// 
//     public BaseFragmentPagerAdapter(FragmentManager fm) {
//         super(fm);
//     }
// 
//     public void addFragment(Fragment fragment, String title) {
//         mFragments.add(fragment);
//         mFragmentTitles.add(title);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mFragments.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragments.size();
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
//         return mFragmentTitles.get(position);
//     }
// }
// 
// Path: app/src/main/java/com/bean/simplenews/util/LogUtils.java
// public class LogUtils {
// 
//     public static void v(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.v(tag, message);
//         }
//     }
// 
//     public static void d(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.d(tag, message);
//         }
//     }
// 
//     public static void i(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.i(tag, message);
//         }
//     }
// 
//     public static void w(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.w(tag, message);
//         }
//     }
// 
//     public static void e(String tag, String message) {
//         if(Constants.DEBUG) {
//             Log.e(tag, message);
//         }
//     }
// 
//     public static void e(String tag, String message, Exception e) {
//         if(Constants.DEBUG) {
//             Log.e(tag, message, e);
//         }
//     }
// }


// Path: app/src/main/java/com/bean/simplenews/module/news/widget/NewsFragment.java
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.bean.simplenews.R;
import com.bean.simplenews.common.Constants;
import com.bean.simplenews.common.adapter.BaseFragmentPagerAdapter;
import com.bean.simplenews.util.LogUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

package com.bean.simplenews.module.news.widget;




public class NewsFragment extends Fragment {

    @BindView(R.id.tab_layout)
    TabLayout mTabLayout;
    @BindView(R.id.viewpager)
    ViewPager mViewPager;
    private Unbinder unbinder;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_news, null);
        unbinder=ButterKnife.bind(this, view);

        BaseFragmentPagerAdapter adapter = new BaseFragmentPagerAdapter(getChildFragmentManager());
        adapter.addFragment(NewsListFragment.newInstance(Constants.NEWS_TYPE_TOP), getString(R.string.top));
        adapter.addFragment(NewsListFragment.newInstance(Constants.NEWS_TYPE_NBA), getString(R.string.nba));
        adapter.addFragment(NewsListFragment.newInstance(Constants.NEWS_TYPE_TEC), getString(R.string.tec));