package com.example.TreballFiGrau;

import java.util.ArrayList;
import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

class LlegirNoticiaFotosGA extends FragmentPagerAdapter {
	ArrayList<Fragment> fragments;
	
	public LlegirNoticiaFotosGA(android.support.v4.app.FragmentManager fm) {
		super(fm);
		fragments = new ArrayList<Fragment>();
		Log.d("aki", "dintre adapter fotos");
		ArrayList<String> llista = NoticiaSeleccionada.fotos;
		Log.d("aki", "llista size: "+llista.size());
		Log.d("aki", "id noticia: "+NoticiaSeleccionada.id);
		
		for(int i=0;i<llista.size();i++){
			Log.d("aki", llista.get(i));
			PontFotoVideoFragment.urlPath.add(llista.get(i));
			Foto fo= new Foto();
			fragments.add(fo);
		}
		
		
		
		
	}

	@Override 
	public Fragment getItem(int position) {
		return this.fragments.get(position);
	}


    @Override
    public int getCount() {
    	//Log.d("aki", "getCountAdapter");
    	return this.fragments.size();
    }

}
