Android Open Source - Joetz-Android-V2 Image Slide Adapter

From Project

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.

Java Source Code

package com.example.jens.myapplication.home;
/*w w w  .  ja  v  a 2  s  .com*/
import android.content.Context;
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()

        mContext = context;
        mLayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    public int getCount() {
        return boodschappen.size();

    public View instantiateItem(ViewGroup container, final int position) {
        View view = mLayoutInflater.inflate(R.layout.vp_image, container, false);

        ImageView mImageView = (ImageView) view .findViewById(;

                ((Reclame) boodschappen.get(position)).getImageUrl(), mImageView,
        return view;

    public void destroyItem(ViewGroup container, int position, Object object) {
        container.removeView((View) object);

    public boolean isViewFromObject(View view, Object object) {
        return view == object;

Java Source Code List