我想在使用Universal Image Loader时只显示一半的图像

时间:2014-02-27 17:24:03

标签: android universal-image-loader

目前这是我的装载机:

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);
            }
        }
    }
}

这是做什么的: enter image description here

但我希望它能做到这一点: enter image description here

那么我怎么才能让它只显示一半的图像而不缩放或拉伸呢?

0 个答案:

没有答案