package com.example.profbola.bakingtime.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.profbola.bakingtime.R;
import com.example.profbola.bakingtime.models.Step;
import com.example.profbola.bakingtime.utils.StepAdapter;

/**
 * Created by prof.BOLA on 7/1/2017.
 */

public class StepsFragment extends Fragment {

    private RecyclerView mStepsListing;
    private StepAdapter mAdapter;
    private Step[] mSteps;

    public static final String STEPS_KEY = "steps_key";

    public StepsFragment() {
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

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

        if (savedInstanceState != null) {
            mSteps = (Step[]) savedInstanceState.getParcelableArray(STEPS_KEY);
        }
        View view = inflater.inflate(R.layout.fragment_steps_listing, container, false);

        mStepsListing = (RecyclerView) view.findViewById(R.id.steps_listing);
        setUpIngredientView();

        return view;
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        outState.putParcelableArray(STEPS_KEY, mSteps);
    }

    private void setUpIngredientView() {
        mAdapter = new StepAdapter(getContext());
        mStepsListing.setAdapter(mAdapter);
        mAdapter.swapSteps(mSteps);
        mStepsListing.setLayoutManager(new LinearLayoutManager(getContext()));
        mStepsListing.setHasFixedSize(true);
    }

    public void addData(Step[] steps) {
       mSteps = steps;
    }
}

@@ -57,17 +57,94 @@
 oid.
-os.Bundle
+content.Context;%0Aimport android.os.Bundle;%0Aimport android.os.health.PackageHealthStats
 ;%0Aim
@@ -773,21 +773,22 @@
 ;%0A%0A    p
-ublic
+rivate
  static 
@@ -826,16 +826,144 @@
 _key%22;%0A%0A
+    OnVideoPlayerSelected mCallback;%0A%0A    public interface OnVideoPlayerSelected %7B%0A        void videoClicked(Step step);%0A    %7D%0A%0A
     publ
@@ -1581,34 +1581,28 @@
        setUp
-Ingredient
+Step
 View();%0A%0A   
@@ -1766,36 +1766,367 @@
     
-private void setUpIngredient
+@Override%0A    public void onAttach(Context context) %7B%0A        super.onAttach(context);%0A%0A        try %7B%0A            mCallback = (OnVideoPlayerSelected) context;%0A        %7D catch (ClassCastException e) %7B%0A            throw new ClassCastException(context.toString()%0A            + %22 must implement OnVideoPlayerSelected%22);%0A        %7D%0A    %7D%0A%0A    private void setUpStep
 View
@@ -2177,16 +2177,55 @@
 ontext()
+, (OnVideoPlayerSelected) getActivity()
 );%0A     

Add OnVideoPlayerSelected interface