I want to only showing half the Image while using Universal Image Loader

◇◆丶佛笑我妖孽 提交于 2019-12-24 21:03:30

问题


Currently here is my 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);
            }
        }
    }
}

What its doing is this:

But i want it to do this:

So how do i get it to only show half the image like so without scaling or stretching it?

来源:https://stackoverflow.com/questions/22075767/i-want-to-only-showing-half-the-image-while-using-universal-image-loader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!