I want to only showing half the Image while using

2019-09-13 19:48发布

问题:

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?