目前这是我的装载机:
doption=new DisplayImageOptions.Builder().showImageForEmptyUri(R.drawable.empty_photo).showImageOnFail(R.drawable.empty_photo).showStubImage(R.drawable.empty_photo).cacheInMemory(true).cacheOnDisc(true).displayer(new RoundedBitmapDisplayer(20)).build();
animateFirstListener = new AnimateFirstDisplayListener();
...
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage(strUrl, image, doption, animateFirstListener);
...
static class AnimateFirstDisplayListener extends SimpleImageLoadingListener {
static final List<String> displayedImages = Collections.synchronizedList(new LinkedList<String>());
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
if (loadedImage != null) {
ImageView imageView = (ImageView) view;
boolean firstDisplay = !displayedImages.contains(imageUri);
if (firstDisplay) {
FadeInBitmapDisplayer.animate(imageView, 500);
displayedImages.add(imageUri);
}
}
}
}
这是做什么的:
但我希望它能做到这一点:
那么我怎么才能让它只显示一半的图像而不缩放或拉伸呢?