Android Utililty Methods ImageView Set

List of utility methods to do ImageView Set

Description

The list of methods to do ImageView Set are organized into topic(s).

Method

voidswapImages(ImageView src, ImageView dst)
swap Images
Drawable tempImage = src.getDrawable();
src.setImageDrawable(dst.getDrawable());
dst.setImageDrawable(tempImage);
voidloadAnimation(ImageView imageView, Animation animation, int animationResource)
Load animation for the imageview.
if (imageView == null)
    return;
if (animation == null && animationResource != 0)
    animation = AnimationUtils.loadAnimation(
            imageView.getContext(), animationResource);
if (animation == null) {
    imageView.setAnimation(null);
    return;
...
voidloadScaledPicture(String image_path, ImageView target)
load Scaled Picture
int targetW = target.getWidth();
int targetH = target.getHeight();
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
bmOptions.inJustDecodeBounds = true;
BitmapFactory.decodeFile(image_path, bmOptions);
int photoW = bmOptions.outWidth;
int photoH = bmOptions.outHeight;
int scaleFactor = Math.min(photoW / targetW, photoH / targetH);
...