package com.blango.cubeutil;

import android.*;
import android.os.*;
import android.support.v4.app.*;
import android.view.*;
import java.util.*;
import com.blango.cubeutil.card.*;
import it.gmariotti.cardslib.library.internal.*;
import it.gmariotti.cardslib.library.view.*;
import android.content.*;
import android.widget.*;
import com.squareup.picasso.*;
import com.google.android.youtube.player.*;

public class OLLFragment extends Fragment {

	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		// Defines the xml file for the fragment
		View view = inflater.inflate(R.layout.card_list_layout, container, false);

		return view;
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

		initCards();
	}

	protected void initCards() {
		ArrayList<Card> cards = new ArrayList<Card>();

		for (int i = 1; i < 6; i++) {
			OLLCard card = new OLLCard(i, getActivity());

			cards.add(card);
		}

		CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);

        CardListView listView = (CardListView) getActivity().findViewById(R.id.cardList);
        if (listView != null){
            listView.setAdapter(mCardArrayAdapter);
        }
	}

}
