//滑动控制
private OnScrollListener mScrollListener=new OnScrollListener(){
@Override
public void onScrollStateChanged(AbsListView view,int scrollState){
if(scrollState==OnScrollListener.SCROLL_STATE_FLING){
Log.d(TAG,"luzechun scroll fling");
isLoadThumbNail=false;
}else if(scrollState==OnScrollListener.SCROLL_STATE_IDLE||
scrollState==OnScrollListener.SCROLL_STATE_TOUCH_SCROLL){
Log.d(TAG,"luzechun scroll not fling");
if(!isLoadThumbNail){
isLoadThumbNail=true;
mStaticScreemAdapter.notifyDataSetChanged();
}
}
}
@Override
public void onScroll(AbsListView arg0,int arg1,int arg2,int arg3){
}
};
private class LocalStaticScreenAdapter extends AbstractScreenAdapter{
public LocalStaticScreemAdapter(Context context,List<String>items){
super(context, items);
}
@SuppressLint("NewApi")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder = null;
if (convertView == null) {
convertView =inflateLayout(R.layout.static_screem_thumbnail_layout, null);
holder = new ViewHolder();
holder.mImageView =(ImageView)convertView.findViewById(R.id.ItemImage);
convertView.setTag(holder);
} else {
holder = (ViewHolder)convertView.getTag();
}
String path=(String)getItem(position);
//isLoadThumbNail标识是否可以加载 bitmap
mDynWallpaperLoader.load(path, holder.mImageView, !isLoadThumbNail);
return convertView;
}
}
public static class ViewHolder {
public ImageView mImageView;
}