// Path: app/src/main/java/com/topnews/android/keepfragment/KeepFragmentAdapter.java
// public class KeepFragmentAdapter extends FragmentPagerAdapter {
// 
//     private final String[] mTabNames;
// 
//     public KeepFragmentAdapter(FragmentManager fm) {
//         super(fm);
// 
//         mTabNames = new String[]{"文章","专题","跟帖"};
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
// 
//         BaseKeepFragment fragment=KeepFragmentFactory.creatFragment(position);
// 
//         return fragment;
//     }
// 
//     @Override
//     public int getCount() {
//         return mTabNames.length;
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
// 
//         return mTabNames[position];
//     }
// }


import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import com.topnews.android.R;
import com.topnews.android.keepfragment.KeepFragmentAdapter;
package com.topnews.android.ui;



public class UserKeepActivity extends AppCompatActivity {

    private Toolbar toolbar;
    private TabLayout mTabLayout;
    private ViewPager mViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_keep);

        mTabLayout = (TabLayout) findViewById(R.id.keep_tab_layout);
        mViewPager = (ViewPager) findViewById(R.id.keep_view_pager);

        toolbar = (Toolbar) findViewById(R.id.keep_toolBar);
        setSupportActionBar(toolbar);

// Path: app/src/main/java/com/topnews/android/keepfragment/KeepFragmentAdapter.java
// public class KeepFragmentAdapter extends FragmentPagerAdapter {
// 
//     private final String[] mTabNames;
// 
//     public KeepFragmentAdapter(FragmentManager fm) {
//         super(fm);
// 
//         mTabNames = new String[]{"文章","专题","跟帖"};
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
// 
//         BaseKeepFragment fragment=KeepFragmentFactory.creatFragment(position);
// 
//         return fragment;
//     }
// 
//     @Override
//     public int getCount() {
//         return mTabNames.length;
//     }
// 
//     @Override
//     public CharSequence getPageTitle(int position) {
// 
//         return mTabNames[position];
//     }
// }


// Path: app/src/main/java/com/topnews/android/ui/UserKeepActivity.java
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import com.topnews.android.R;
import com.topnews.android.keepfragment.KeepFragmentAdapter;

package com.topnews.android.ui;



public class UserKeepActivity extends AppCompatActivity {

    private Toolbar toolbar;
    private TabLayout mTabLayout;
    private ViewPager mViewPager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_keep);

        mTabLayout = (TabLayout) findViewById(R.id.keep_tab_layout);
        mViewPager = (ViewPager) findViewById(R.id.keep_view_pager);

        toolbar = (Toolbar) findViewById(R.id.keep_toolBar);
        setSupportActionBar(toolbar);

        mViewPager.setAdapter(new KeepFragmentAdapter(getSupportFragmentManager()));