public View getView(int position, View convertView, ViewGroup parent) {
Log.d(TAG, "convertView = " + convertView + " position = " + position);
ImageView imageview = new ImageView(mContext);
//给ImageView设置资源
imageview.setImageResource(mImageIds[position % mImageIds.length]); //循环显示
imageview.setScaleType(ImageView.ScaleType.FIT_CENTER);
if(selectItem==position){
//Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.hyperspace_out);
//ScaleAnimation animation = new ScaleAnimation(0, 2, 0, 2,
// ScaleAnimation.RELATIVE_TO_SELF, 0, ScaleAnimation.RELATIVE_TO_SELF, 0);
//animation.setDuration(2000);
//imageview.startAnimation(animation);
imageview.setLayoutParams(new Gallery.LayoutParams(150,150));
}
else{
imageview.setLayoutParams(new Gallery.LayoutParams(120,120));
}
return imageview;
}
public void setSelectItem(int selectItem) {
if (this.selectItem != selectItem) {
this.selectItem = selectItem;
notifyDataSetChanged();
}
}
}