Search in sources :

Example 1 with ImageViewAware

use of com.nostra13.universalimageloader.core.imageaware.ImageViewAware in project PhotoNoter by yydcdut.

the class CircleBitmapDisplayer method display.

@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    Bitmap roundedBitmap = roundCorners(bitmap, (ImageViewAware) imageAware);
    imageAware.setImageBitmap(roundedBitmap);
    return;
}
Also used : ImageViewAware(com.nostra13.universalimageloader.core.imageaware.ImageViewAware) Bitmap(android.graphics.Bitmap)

Example 2 with ImageViewAware

use of com.nostra13.universalimageloader.core.imageaware.ImageViewAware in project GalleryFinal by pengjianbo.

the class UILImageLoader method displayImage.

@Override
public void displayImage(Activity activity, String path, GFImageView imageView, Drawable defaultDrawable, int width, int height) {
    DisplayImageOptions options = new DisplayImageOptions.Builder().cacheOnDisk(false).cacheInMemory(false).bitmapConfig(mImageConfig).build();
    ImageSize imageSize = new ImageSize(width, height);
    ImageLoader.getInstance().displayImage("file://" + path, new ImageViewAware(imageView), options, imageSize, null, null);
}
Also used : ImageViewAware(com.nostra13.universalimageloader.core.imageaware.ImageViewAware) ImageSize(com.nostra13.universalimageloader.core.assist.ImageSize) DisplayImageOptions(com.nostra13.universalimageloader.core.DisplayImageOptions)

Example 3 with ImageViewAware

use of com.nostra13.universalimageloader.core.imageaware.ImageViewAware in project Android-Universal-Image-Loader by nostra13.

the class ImageSizeTest method setUp.

@Before
public void setUp() throws Exception {
    mActivity = new Activity();
    // Make and set view with some prelim values to test
    mView = new TestImageView(mActivity);
    mView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    mView.measure(View.MeasureSpec.makeMeasureSpec(250, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(250, View.MeasureSpec.EXACTLY));
    mImageAware = new ImageViewAware(mView);
}
Also used : ImageViewAware(com.nostra13.universalimageloader.core.imageaware.ImageViewAware) FrameLayout(android.widget.FrameLayout) Activity(android.app.Activity) Before(org.junit.Before)

Example 4 with ImageViewAware

use of com.nostra13.universalimageloader.core.imageaware.ImageViewAware in project Android-Universal-Image-Loader by nostra13.

the class OldRoundedBitmapDisplayer method display.

@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    Bitmap roundedBitmap = roundCorners(bitmap, (ImageViewAware) imageAware, roundPixels);
    imageAware.setImageBitmap(roundedBitmap);
}
Also used : ImageViewAware(com.nostra13.universalimageloader.core.imageaware.ImageViewAware) Bitmap(android.graphics.Bitmap)

Aggregations

ImageViewAware (com.nostra13.universalimageloader.core.imageaware.ImageViewAware)4 Bitmap (android.graphics.Bitmap)2 Activity (android.app.Activity)1 FrameLayout (android.widget.FrameLayout)1 DisplayImageOptions (com.nostra13.universalimageloader.core.DisplayImageOptions)1 ImageSize (com.nostra13.universalimageloader.core.assist.ImageSize)1 Before (org.junit.Before)1