Back to project page Joetz-Android-V2.
The source code is released under:
GNU General Public License
If you think the Android project Joetz-Android-V2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.jens.myapplication.home; /*w w w . ja v a 2 s .com*/ import android.content.Context; import android.support.v4.view.PagerAdapter; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.example.jens.myapplication.R; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import java.util.List; /** * Created by Jens on 9/12/2014. */ public class ImageSlideAdapter extends PagerAdapter { ImageLoader imageLoader = ImageLoader.getInstance(); DisplayImageOptions options; List<Reclame> boodschappen; Context mContext; LayoutInflater mLayoutInflater; public ImageSlideAdapter(Context context, List<Reclame> boodschappen) { this.boodschappen = boodschappen; options = new DisplayImageOptions.Builder() .showImageOnLoading(R.drawable.stub) .cacheOnDisk(true) .considerExifParams(true) .build(); mContext = context; mLayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Override public int getCount() { return boodschappen.size(); } @Override public View instantiateItem(ViewGroup container, final int position) { View view = mLayoutInflater.inflate(R.layout.vp_image, container, false); ImageView mImageView = (ImageView) view .findViewById(R.id.imageView); imageLoader.displayImage( ((Reclame) boodschappen.get(position)).getImageUrl(), mImageView, options); container.addView(view); return view; } @Override public void destroyItem(ViewGroup container, int position, Object object) { container.removeView((View) object); } @Override public boolean isViewFromObject(View view, Object object) { return view == object; } }