content: package com.c9mj.platform.gallery.adapter;
  
  import android.support.v4.view.PagerAdapter;
  import android.view.View;
  import android.view.ViewGroup;
  
  import java.util.ArrayList;
  import java.util.List;
  
  /**
   * Created by Administrator on 2016/12/16.
   */
  
  public class GalleryAdapter extends PagerAdapter {
  
      private List<View> viewList = new ArrayList<>();
  
      public GalleryAdapter(List<View> viewList) {
          this.viewList = viewList;
      }
  
      @Override
      public int getCount() {
          return viewList.size();
      }
  
      @Override
      public boolean isViewFromObject(View view, Object object) {
          return view == object;
      }
  
      @Override
      public Object instantiateItem(ViewGroup container, int position) {
          View view = viewList.get(position);
          container.addView(view);
          return view;
      }
  
      @Override
      public void destroyItem(ViewGroup container, int position, Object object) {
          container.removeView((View) object);
      }
  
      @Override
      public int getItemPosition(Object object) {
          return POSITION_NONE;
      }
  }
  