// Path: app/src/main/java/org/kaerdan/mvp_navigation/core/ui/article_list/ArticleListContract.java
// public interface ArticleListContract {
//     interface Presenter extends org.kaerdan.mvp_navigation.core.Presenter<View> {
//         void setNavigator(@NonNull Navigator navigator);
// 
//         void onFavoriteArticleClick();
//     }
// 
//     interface View extends org.kaerdan.mvp_navigation.core.Presenter.View {
//         void displayArticles(@NonNull List<Article> articles, @NonNull OnArticleClickListener onArticleClickListener);
//     }
// 
//     interface Navigator {
//         void openArticle(int id);
// 
//         void openFavoriteArticles();
//     }
// 
//     interface NavigatorProvider {
// 
//         @NonNull
//         Navigator getNavigator(ArticleListContract.Presenter presenter);
//     }
// }
// 
// Path: app/src/main/java/org/kaerdan/mvp_navigation/core/ui/favorite_list/FavoriteListContract.java
// public interface FavoriteListContract {
//     interface Presenter extends org.kaerdan.mvp_navigation.core.Presenter<View> {
//         void setNavigator(@NonNull Navigator navigator);
//     }
// 
//     interface View extends org.kaerdan.mvp_navigation.core.Presenter.View {
//         void displayArticles(@NonNull List<Article> articles, @NonNull OnArticleClickListener onArticleClickListener);
//     }
// 
//     interface Navigator {
//         void openArticle(int id);
//     }
// 
//     interface NavigatorProvider {
// 
//         @NonNull
//         Navigator getNavigator(FavoriteListContract.Presenter presenter);
//     }
// }


import org.kaerdan.mvp_navigation.R;
import org.kaerdan.mvp_navigation.core.ui.article_list.ArticleListContract;
import org.kaerdan.mvp_navigation.core.ui.favorite_list.FavoriteListContract;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
package org.kaerdan.mvp_navigation.example3_viewpager;







public class ViewPagerActivity extends AppCompatActivity implements ArticleListContract.NavigatorProvider,
    FavoriteListContract.NavigatorProvider {

    private ViewPager mViewPager;

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

        mViewPager = (ViewPager) findViewById(R.id.container);
        mViewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager()));
        ((TabLayout) findViewById(R.id.tabs)).setupWithViewPager(mViewPager);
    }

    @NonNull
    @Override
    public ArticleListContract.Navigator getNavigator(final ArticleListContract.Presenter presenter) {
        return new ViewPagerArticleListNavigator(this, mViewPager);
    }

    @NonNull
    @Override
    public FavoriteListContract.Navigator getNavigator(final FavoriteListContract.Presenter presenter) {
// Path: app/src/main/java/org/kaerdan/mvp_navigation/core/ui/article_list/ArticleListContract.java
// public interface ArticleListContract {
//     interface Presenter extends org.kaerdan.mvp_navigation.core.Presenter<View> {
//         void setNavigator(@NonNull Navigator navigator);
// 
//         void onFavoriteArticleClick();
//     }
// 
//     interface View extends org.kaerdan.mvp_navigation.core.Presenter.View {
//         void displayArticles(@NonNull List<Article> articles, @NonNull OnArticleClickListener onArticleClickListener);
//     }
// 
//     interface Navigator {
//         void openArticle(int id);
// 
//         void openFavoriteArticles();
//     }
// 
//     interface NavigatorProvider {
// 
//         @NonNull
//         Navigator getNavigator(ArticleListContract.Presenter presenter);
//     }
// }
// 
// Path: app/src/main/java/org/kaerdan/mvp_navigation/core/ui/favorite_list/FavoriteListContract.java
// public interface FavoriteListContract {
//     interface Presenter extends org.kaerdan.mvp_navigation.core.Presenter<View> {
//         void setNavigator(@NonNull Navigator navigator);
//     }
// 
//     interface View extends org.kaerdan.mvp_navigation.core.Presenter.View {
//         void displayArticles(@NonNull List<Article> articles, @NonNull OnArticleClickListener onArticleClickListener);
//     }
// 
//     interface Navigator {
//         void openArticle(int id);
//     }
// 
//     interface NavigatorProvider {
// 
//         @NonNull
//         Navigator getNavigator(FavoriteListContract.Presenter presenter);
//     }
// }


// Path: app/src/main/java/org/kaerdan/mvp_navigation/example3_viewpager/ViewPagerActivity.java
import org.kaerdan.mvp_navigation.R;
import org.kaerdan.mvp_navigation.core.ui.article_list.ArticleListContract;
import org.kaerdan.mvp_navigation.core.ui.favorite_list.FavoriteListContract;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

package org.kaerdan.mvp_navigation.example3_viewpager;







public class ViewPagerActivity extends AppCompatActivity implements ArticleListContract.NavigatorProvider,
    FavoriteListContract.NavigatorProvider {

    private ViewPager mViewPager;

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

        mViewPager = (ViewPager) findViewById(R.id.container);
        mViewPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager()));
        ((TabLayout) findViewById(R.id.tabs)).setupWithViewPager(mViewPager);
    }

    @NonNull
    @Override
    public ArticleListContract.Navigator getNavigator(final ArticleListContract.Presenter presenter) {
        return new ViewPagerArticleListNavigator(this, mViewPager);
    }

    @NonNull
    @Override
    public FavoriteListContract.Navigator getNavigator(final FavoriteListContract.Presenter presenter) {
        return new ViewPagerFavoriteListNavigator(this);