ImageView setAdjustViewBounds - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ImageView setAdjustViewBounds method.

This code example shows how to use the following methods: setLayoutParams, setPadding, setAdjustViewBounds, setImageResource, setScaleType
This code example shows how to use the following methods: setBackgroundResource, setLayoutParams, setAdjustViewBounds, setImageResource
        public long getItemId(int position) {
            return position;
        } 
 
        public View getView(final int position, View convertView, ViewGroup parent) {
            ImageView i = new ImageView(mContext);
 
            i.setImageResource(THUMB_IDS[position]);
            i.setAdjustViewBounds(true);
            i.setLayoutParams(new Gallery.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
            i.setBackgroundResource(android.R.drawable.picture_frame);
            return i;
        } 
 
    } 
 
} 
 
     
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setAdjustViewBounds, setImageBitmap, setScaleType
		} 
	} 
 
	public void render( Context context ) {
		if ( imageView == null ) {
			imageView = new ImageView( context );
			imageView.setAdjustViewBounds( false );
			imageView.setScaleType( ImageView.ScaleType.MATRIX );
		}		 
		imageView.setImageBitmap( bitmap );
	} 
 
	public void destroy() { 
		if ( imageView != null ) {
			imageView.clearAnimation();
			imageView.setImageBitmap( null );
			ViewParent parent = imageView.getParent();
			if ( parent != null && parent instanceof ViewGroup ) {
				ViewGroup group = (ViewGroup) parent;
				group.removeView( imageView );
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setAdjustViewBounds, setScaleType
		} else { 
			if (viewWidthDefined && viewHeightDefined) {
				imageView.setAdjustViewBounds(false);
				imageView.setScaleType(ScaleType.FIT_XY);
			} else if (!enableScale) {
				imageView.setAdjustViewBounds(false);
				imageView.setScaleType(ScaleType.CENTER);
			} else { 
				imageView.setAdjustViewBounds(true);
				imageView.setScaleType(ScaleType.FIT_CENTER);
			} 
		} 
		requestLayout();
	} 
 
	public void setWidthDefined(boolean defined)
	{ 
		viewWidthDefined = defined;
		updateScaleType(); 
	} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setAdjustViewBounds, setImageBitmap, setScaleType
 
	} 
 
	public boolean render( Context context ) {
		if ( imageView == null ) {
			imageView = new ImageView( context );
			imageView.setAdjustViewBounds( false );
			imageView.setScaleType( ImageView.ScaleType.MATRIX );
		} 
		imageView.setImageBitmap( bitmap );
		return true; 
	} 
 
	public void destroy() { 
		if ( imageView != null ) {
			imageView.setImageBitmap( null );
			ViewParent parent = imageView.getParent();
			if ( parent != null && parent instanceof ViewGroup ) {
				ViewGroup group = (ViewGroup) parent;
				group.removeView( imageView );
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related ImageView setAdjustViewBounds Questions & Answers:

setAdjustViewBounds Method Overview
Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.
See Code Examples for other Android ImageView Methods: