package openfoodfacts.github.scrachx.openfood.fragments;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import openfoodfacts.github.scrachx.openfood.R;

/**
 * Created by scotscriven on 04/05/15.
 */
public class IngredientsProductFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_ingredients_product,container,false);
        return rootView;
    }
}

@@ -80,16 +80,47 @@
 agment;%0A
+import android.content.Intent;%0A
 import a
@@ -133,24 +133,24 @@
 .os.Bundle;%0A
-
 import andro
@@ -273,16 +273,48 @@
 ewGroup;
+%0Aimport android.widget.TextView;
 %0A%0Aimport
@@ -354,16 +354,75 @@
 nfood.R;
+%0Aimport openfoodfacts.github.scrachx.openfood.models.State;
 %0A%0A/**%0A *
@@ -522,16 +522,139 @@
 ment %7B%0A%0A
+    TextView ingredientProduct, substanceProduct, traceProduct, additiveProduct, palmOilProduct, mayBeFromPalmOilProduct;%0A%0A
     @Nul
@@ -777,16 +777,16 @@
 tate) %7B%0A
-
         
@@ -874,16 +874,1439 @@
 false);%0A
+%0A        ingredientProduct = (TextView) rootView.findViewById(R.id.textIngredientProduct);%0A        substanceProduct = (TextView) rootView.findViewById(R.id.textSubstanceProduct);%0A        traceProduct = (TextView) rootView.findViewById(R.id.textTraceProduct);%0A        additiveProduct = (TextView) rootView.findViewById(R.id.textAdditiveProduct);%0A        palmOilProduct = (TextView) rootView.findViewById(R.id.textPalmOilProduct);%0A        mayBeFromPalmOilProduct = (TextView) rootView.findViewById(R.id.textMayBeFromPalmOilProduct);%0A%0A        Intent intent = getActivity().getIntent();%0A        State state = (State) intent.getExtras().getSerializable(%22state%22);%0A%0A        ingredientProduct.setText(getString(R.string.txtIngredients) + ' ' + state.getProduct().getIngredientsText());%0A        substanceProduct.setText(getString(R.string.txtSubstances) + ' ' + state.getProduct().getAllergens());%0A        traceProduct.setText(getString(R.string.txtTraces) + ' ' + state.getProduct().getTraces());%0A        additiveProduct.setText(getString(R.string.txtAdditives) + ' ' + state.getProduct().getAdditivesTags().toString());%0A        palmOilProduct.setText(getString(R.string.txtPalmOilProduct) + ' ' + state.getProduct().getIngredientsFromPalmOilTags().toString());%0A        mayBeFromPalmOilProduct.setText(getString(R.string.txtMayBeFromPalmOilProduct) + ' ' + state.getProduct().getIngredientsThatMayBeFromPalmOilTags().toString());%0A%0A
         

Test data view for product ingredients information