Best code examples for ImageView setAdjustViewBounds method (android.widget.ImageView.setAdjustViewBounds)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ImageView setAdjustViewBounds method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

ImageView setAdjustViewBounds examples from Open Source projects
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setScaleType, setLayoutParams, setPadding
66:	imageView = new ImageView(mContext); 
67:	imageView.setLayoutParams(new GridView.LayoutParams(45, 45)); 
68:	imageView.setAdjustViewBounds(false); 
69:	imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); 
70:	imageView.setPadding(8, 8, 8, 8); 
-
75:	imageView.setImageResource(mThumbIds[position]); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setBackgroundResource, setLayoutParams
137:	ImageView i = new ImageView(mContext); 
-
139:	i.setImageResource(THUMB_IDS[position]); 
140:	i.setAdjustViewBounds(true); 
141:	i.setLayoutParams(new Gallery.LayoutParams( 
-
143:	i.setBackgroundResource(android.R.drawable.picture_frame); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageBitmap, setScaleType
81:	imageView = new ImageView( context ); 
82:	imageView.setAdjustViewBounds( false ); 
83:	imageView.setScaleType( ImageView.ScaleType.MATRIX ); 
-
85:	imageView.setImageBitmap( bitmap ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setScaleType
425:	imageView.setAdjustViewBounds(false); 
426:	imageView.setScaleType(ScaleType.CENTER); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageBitmap, setScaleType
141:	imageView = new ImageView( context ); 
142:	imageView.setAdjustViewBounds( false ); 
143:	imageView.setScaleType( ImageView.ScaleType.MATRIX ); 
-
145:	imageView.setImageBitmap( bitmap ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageDrawable, setScaleType, setLayoutParams
46:	myImageView = new ImageView(mContext); 
47:	myImageView.setLayoutParams(new GridView.LayoutParams(120, 120)); 
48:	myImageView.setAdjustViewBounds(false); 
49:	myImageView.setScaleType(ImageView.ScaleType.CENTER_CROP); 
-
56:	myImageView.setImageDrawable(drawableImage); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageDrawable, setLayoutParams
199:	ImageView i = new ImageView(mContext); 
200:	i.setImageDrawable(getDrawable(position)); 
201:	i.setAdjustViewBounds(true); 
202:	i.setLayoutParams(new Gallery.LayoutParams(LayoutParams.WRAP_CONTENT, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setScaleType, setBackgroundColor, setId
57:	imageView = new ImageButton(this.context); 
58:	imageView.setId(buttonIds[position]); 
-
60:	imageView.setAdjustViewBounds(true); 
61:	imageView.setBackgroundColor(Color.BLACK); 
62:	imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE); 
-
68:	imageView.setImageResource(cardImages[position]); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setMaxHeight, setMaxWidth
25:	display.setAdjustViewBounds(true); 
26:	display.setMaxHeight(320); 
27:	display.setMaxWidth(480); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setScaleType, setBackgroundDrawable, setClickable
71:	imageButton = new ImageButton(mContext); 
72:	imageButton.setLayoutParams(new GridView.LayoutParams(150,150)); 
73:	imageButton.setScaleType(ImageButton.ScaleType.CENTER_CROP); 
74:	imageButton.setPadding(7, 8, 7, 8); 
75:	imageButton.setAdjustViewBounds(true); 
-
79:	imageButton.setBackgroundDrawable(d); 
-
86:	imageButton.setImageResource(mThumbIds[position]); 
-
101:	imageButton.setFocusable(false); 
102:	imageButton.setClickable(false); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setScaleType, setBackgroundDrawable, setClickable
72:	imageButton = new ImageButton(mContext); 
73:	imageButton.setLayoutParams(new GridView.LayoutParams(150,150)); 
74:	imageButton.setScaleType(ImageButton.ScaleType.CENTER_CROP); 
75:	imageButton.setPadding(7, 8, 7, 8); 
76:	imageButton.setAdjustViewBounds(true); 
-
80:	imageButton.setBackgroundDrawable(d); 
-
87:	imageButton.setImageResource(mThumbIds[position]); 
-
102:	imageButton.setFocusable(false); 
103:	imageButton.setClickable(false); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setScaleType, setBackgroundDrawable, setClickable
77:	imageButton = new ImageButton(mContext); 
78:	imageButton.setLayoutParams(new GridView.LayoutParams(150,150)); 
79:	imageButton.setScaleType(ImageButton.ScaleType.CENTER_CROP); 
80:	imageButton.setPadding(7, 8, 7, 8); 
81:	imageButton.setAdjustViewBounds(true); 
-
85:	imageButton.setBackgroundDrawable(d); 
-
92:	imageButton.setImageResource(mThumbIds[position]); 
-
107:	imageButton.setFocusable(false); 
108:	imageButton.setClickable(false); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setScaleType, setBackgroundDrawable, setClickable
78:	imageButton = new ImageButton(mContext); 
79:	imageButton.setLayoutParams(new GridView.LayoutParams(150,150)); 
80:	imageButton.setScaleType(ImageButton.ScaleType.CENTER_CROP); 
81:	imageButton.setPadding(7, 8, 7, 8); 
82:	imageButton.setAdjustViewBounds(true); 
-
86:	imageButton.setBackgroundDrawable(d); 
-
93:	imageButton.setImageResource(mThumbIds[position]); 
-
108:	imageButton.setFocusable(false); 
109:	imageButton.setClickable(false); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setAdjustViewBounds, setImageResource, setScaleType, setBackgroundDrawable, setClickable
78:	imageButton = new ImageButton(mContext); 
79:	imageButton.setLayoutParams(new GridView.LayoutParams(150,150)); 
80:	imageButton.setScaleType(ImageButton.ScaleType.CENTER_CROP); 
81:	imageButton.setPadding(7, 8, 7, 8); 
82:	imageButton.setAdjustViewBounds(true); 
-
86:	imageButton.setBackgroundDrawable(d); 
-
93:	imageButton.setImageResource(mThumbIds[position]); 
-
108:	imageButton.setFocusable(false); 
109:	imageButton.setClickable(false); 
Full Snippet Info
5
CodeRank
Related ImageView setAdjustViewBounds Questions & Answers:
Displays an arbitrary image, such as an icon. The ImageView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the image so that it can be used in any layout manager, and pr...
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 Also
  • getDrawable
    Return the view's drawable, or null if no drawable has been assigned.
  • setAlpha
    This method was deprecated in API level 16. use #setImageAlpha(int) instead
  • setImageURI
    Sets the content of this ImageView to the specified Uri.
  • setMaxHeight
    An optional argument to supply a maximum height for this view.
  • setMaxWidth
    An optional argument to supply a maximum width for this view.
  • setScaleType
    Controls how the image should be resized or moved to match the size of this ImageView.