List of utility methods to do ImageView Set
void | swapImages(ImageView src, ImageView dst) swap Images Drawable tempImage = src.getDrawable(); src.setImageDrawable(dst.getDrawable()); dst.setImageDrawable(tempImage); |
void | loadAnimation(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; ... |
void | loadScaledPicture(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); ... |