// Path: app/src/main/java/org/kaerdan/mvp_navigation/core/ui/article/ArticleFragment.java
// public class ArticleFragment extends Fragment implements ArticleContract.View {
// 
//     private static final String ARTICLE_ID_TAG = "Article id";
// 
//     public static ArticleFragment newInstance(final int id) {
//         Bundle args = new Bundle();
//         args.putInt(ARTICLE_ID_TAG, id);
// 
//         ArticleFragment fragment = new ArticleFragment();
//         fragment.setArguments(args);
//         return fragment;
//     }
// 
//     private ArticleContract.Presenter mPresenter;
//     private TextView mArticleTextView;
// 
//     public ArticleFragment() {
//         // Required empty public constructor
//     }
// 
//     @Override
//     public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
//             final Bundle savedInstanceState) {
// 
//         // Inflate the layout for this fragment
//         mPresenter = new ArticlePresenter(getArguments().getInt(ARTICLE_ID_TAG));
// 
//         View v = inflater.inflate(R.layout.fragment_article, container, false);
//         mArticleTextView = (TextView) v.findViewById(R.id.article_body);
//         return v;
//     }
// 
//     @Override
//     public void onStart() {
//         super.onStart();
//         mPresenter.onAttachView(this);
//     }
// 
//     @Override
//     public void onStop() {
//         super.onStop();
//         mPresenter.onDetachView();
//     }
// 
//     @Override
//     public void displayArticle(@NonNull final Article article) {
//         mArticleTextView.setText(article.getBody());
//     }
// }


import org.kaerdan.mvp_navigation.R;
import org.kaerdan.mvp_navigation.core.ui.article.ArticleFragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
package org.kaerdan.mvp_navigation.example1_activities;






public class ArticleActivity extends AppCompatActivity {

    private static final String ARTICLE_ID_TAG = "Article id";

    public static Intent createIntent(final Context context, final int id) {
        Intent intent = new Intent(context, ArticleActivity.class);
        intent.putExtra(ARTICLE_ID_TAG, id);
        return intent;
    }

    @Override
    protected void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_fragment);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                                       .add(R.id.content_frame,
// Path: app/src/main/java/org/kaerdan/mvp_navigation/core/ui/article/ArticleFragment.java
// public class ArticleFragment extends Fragment implements ArticleContract.View {
// 
//     private static final String ARTICLE_ID_TAG = "Article id";
// 
//     public static ArticleFragment newInstance(final int id) {
//         Bundle args = new Bundle();
//         args.putInt(ARTICLE_ID_TAG, id);
// 
//         ArticleFragment fragment = new ArticleFragment();
//         fragment.setArguments(args);
//         return fragment;
//     }
// 
//     private ArticleContract.Presenter mPresenter;
//     private TextView mArticleTextView;
// 
//     public ArticleFragment() {
//         // Required empty public constructor
//     }
// 
//     @Override
//     public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
//             final Bundle savedInstanceState) {
// 
//         // Inflate the layout for this fragment
//         mPresenter = new ArticlePresenter(getArguments().getInt(ARTICLE_ID_TAG));
// 
//         View v = inflater.inflate(R.layout.fragment_article, container, false);
//         mArticleTextView = (TextView) v.findViewById(R.id.article_body);
//         return v;
//     }
// 
//     @Override
//     public void onStart() {
//         super.onStart();
//         mPresenter.onAttachView(this);
//     }
// 
//     @Override
//     public void onStop() {
//         super.onStop();
//         mPresenter.onDetachView();
//     }
// 
//     @Override
//     public void displayArticle(@NonNull final Article article) {
//         mArticleTextView.setText(article.getBody());
//     }
// }


// Path: app/src/main/java/org/kaerdan/mvp_navigation/example1_activities/ArticleActivity.java
import org.kaerdan.mvp_navigation.R;
import org.kaerdan.mvp_navigation.core.ui.article.ArticleFragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;

package org.kaerdan.mvp_navigation.example1_activities;






public class ArticleActivity extends AppCompatActivity {

    private static final String ARTICLE_ID_TAG = "Article id";

    public static Intent createIntent(final Context context, final int id) {
        Intent intent = new Intent(context, ArticleActivity.class);
        intent.putExtra(ARTICLE_ID_TAG, id);
        return intent;
    }

    @Override
    protected void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_fragment);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                                       .add(R.id.content_frame,
                ArticleFragment.newInstance(getIntent().getIntExtra(ARTICLE_ID_TAG, 0)), null).commit();