<commit_before>package linchom.com.linchomspace.shopping.goodsadapter;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.shizhefei.view.indicator.IndicatorViewPager;

import org.xutils.x;

import java.util.List;

import linchom.com.linchomspace.R;

/**
 * Created by Administrator on 2016/10/12.
 */
public class MyGoodsIndicatorAdapter extends IndicatorViewPager.IndicatorViewPagerAdapter {

    Context context ;
    List<String> advList;

    public MyGoodsIndicatorAdapter(Context context, List<String> advList){
        this.context =context;
        this.advList =advList;

    }

    @Override
    public int getCount() {

        return advList.size();
    }

    @Override
    public View getViewForTab(int position, View convertView, ViewGroup container) {

            if(convertView==null){

                convertView= View.inflate(context, R.layout.goods_tab_guide,null);

            }



        return convertView;
    }

    @Override
    public View getViewForPage(int position, View convertView, ViewGroup container) {

        if(convertView==null){

            convertView=new ImageView(context);

            convertView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));

        }

        ImageView imageView =(ImageView)convertView;

        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);

        //写工具类????



        x.image().bind(imageView, advList.get(position%advList.size()));




        return convertView;


    }
}<commit_msg>author:徐小龙 desc:时间10/13 修改adapter<commit_after>package linchom.com.linchomspace.shopping.goodsadapter;


import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.shizhefei.view.indicator.IndicatorViewPager;

import org.xutils.image.ImageOptions;
import org.xutils.x;

import java.util.List;

import linchom.com.linchomspace.R;

/**
 * Created by Administrator on 2016/10/12.
 */
public class MyGoodsIndicatorAdapter extends IndicatorViewPager.IndicatorViewPagerAdapter {

    Context context ;
    List<String> advList;

    public MyGoodsIndicatorAdapter(Context context, List<String> advList){
        this.context =context;
        this.advList =advList;

    }

    @Override
    public int getCount() {

        return advList.size();
    }

    @Override
    public View getViewForTab(int position, View convertView, ViewGroup container) {

            if(convertView==null){

                convertView= View.inflate(context, R.layout.goods_tab_guide,null);

            }



        return convertView;
    }

    @Override
    public View getViewForPage(int position, View convertView, ViewGroup container) {

        if(convertView==null){

            convertView=new ImageView(context);

            convertView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));

        }

        ImageView imageView =(ImageView)convertView;

        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);

        //写工具类????

        ImageOptions imageOptions = new ImageOptions.Builder()
                .setCrop(true)// 如果ImageView的大小不是定义为wrap_content, 不要crop.
                .setImageScaleType(ImageView.ScaleType.CENTER_CROP)
                .setLoadingDrawableId(R.drawable.goods_background)//加载中默认显示图片
                .setFailureDrawableId(R.drawable.goods_background)//加载失败后默认显示图片
                .build();

        x.image().bind(imageView, advList.get(position%advList.size()),imageOptions);



        x.image().bind(imageView, advList.get(position%advList.size()));




        return convertView;


    }
}
{'fraction_non_alphanumeric': 0.09776021080368906, 'fraction_numerical': 0.005270092226613966, 'mean_word_length': 3.099352051835853, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6277243', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1135, 'n_words': 187}