Code example for ImageView

Methods: setPadding

0
	 *            in Dp 
	 * @since 1.1 
	 */ 
	public void setWidth(int width) {
		int padding = CalculationUtil.convertDpToPx(width, getContext());
		imageView.setPadding(padding, padding, padding, padding);
		bar.setWidthInDp(width);
	} 
 
	/** 
	 * This sets the alpha of the image in the view. Actually I need to use the 
	 * deprecated method here as the new one is only available for the API-level 
	 * 16. And the min API level o this library is 14. 
	 *  
	 * Use this only as private method. 
	 *  
	 * @param progress 
	 *            the progress 
	 */ 
	private void setOpacity(int progress) {
		imageView.setAlpha((int) (2.55 * progress));