Android Open Source - wpaper Co View Pager Adapter






From Project

Back to project page wpaper.

License

The source code is released under:

MIT License

If you think the Android project wpaper 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.uniwall;
/*from w  ww .  ja  va 2  s.  c o m*/
import java.util.ArrayList;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;


//This is a adapter
public class CoViewPagerAdapter extends PagerAdapter{
  
  private ArrayList<View> arrayList;
  @Override
  public int getCount() {
    // TODO Auto-generated method stub
    return arrayList.size();
  }

  @Override
  public boolean isViewFromObject(View arg0, Object arg1) {
    // TODO Auto-generated method stub
    return arg0 == arg1;
  }
  
  public void setViews(ArrayList<View> arrayList){
    this.arrayList = arrayList;
  }

  @Override
  public void destroyItem(View container, int position, Object object){
    ((ViewPager)container).removeView(arrayList.get(position));
  }
  
  @Override
  public  Object instantiateItem(View container, int position){
    ((ViewPager)container).addView(arrayList.get(position));
    return arrayList.get(position);
  }
}




Java Source Code List

com.example.uniwall.BitmapOperation.java
com.example.uniwall.CoViewPagerAdapter.java
com.example.uniwall.Controller.java
com.example.uniwall.MainActivity.java
com.example.uniwall.MainApplication.java
net.DownloadImageTask.java
net.DownloadMethod.java