package com.cwainner.chris.recipecentral.adapters;

import android.content.Context;
import android.widget.ArrayAdapter;

/**
 * Created by Chris on 5/26/2017.
 */

public class RecipePagerAdapter extends ArrayAdapter {
    private Context context;
    private String[] recipes;

    public RecipePagerAdapter(Context context, int resource, String[] recipes){
        super(context, resource);
        this.context = context;
        this.recipes = recipes;
    }

    @Override
    public Object getItem(int position){
        String recipe = recipes[position];
        return recipe;
    }

    @Override
    public int getCount(){
        return recipes.length;
    }
}

@@ -64,103 +64,281 @@
 oid.
-content.Context;%0Aimport android.widget.ArrayAdapter;%0A%0A/**%0A * Created by Chris on 5/26/2017.%0A */
+support.v4.app.Fragment;%0Aimport android.support.v4.app.FragmentManager;%0Aimport android.support.v4.app.FragmentPagerAdapter;%0A%0Aimport com.cwainner.chris.recipecentral.models.Recipe;%0Aimport com.cwainner.chris.recipecentral.ui.RecipeDetailFragment;%0A%0Aimport java.util.ArrayList;
 %0A%0Apu
@@ -375,21 +375,29 @@
 extends 
-Array
+FragmentPager
 Adapter 
@@ -414,45 +414,25 @@
 ate 
-Context context;%0A    private String%5B%5D
+ArrayList%3CRecipe%3E
  rec
@@ -472,122 +472,73 @@
 ter(
-Context context, int resource, String%5B%5D recipes)%7B%0A        super(context, resource);%0A        this.context = context
+FragmentManager fm, ArrayList%3CRecipe%3E recipes)%7B%0A        super(fm)
 ;%0A  
@@ -603,13 +603,15 @@
 lic 
-Objec
+Fragmen
 t ge
@@ -643,40 +643,68 @@
     
-String recipe = 
+return RecipeDetailFragment.newInstance(
 recipes
-%5B
+.get(
 position
 %5D;%0A 
@@ -703,11 +703,60 @@
 tion
-%5D
+))
 ;%0A
+    %7D%0A%0A    @Override%0A    public int getCount()%7B%0A
     
@@ -772,16 +772,24 @@
 n recipe
+s.size()
 ;%0A    %7D%0A
@@ -810,37 +810,62 @@
 %0A    public 
-int getCount(
+CharSequence getPageTitle(int position
 )%7B%0A        r
@@ -882,14 +882,32 @@
 pes.
-length
+get(position).getTitle()
 ;%0A  

Update Recipe Pager Adapter to handle fragments