, , , , ImageView. , , :
, ImageView:
<ImageView
android:id="@+id/my_image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"/>
Glide :
Glide.with(myImageView.getContext())
.load(imageUrl)
.placeholder(R.drawable.placeholder)
.override(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
.into(myImageView);
The key points here are the adjustViewBounds attribute in ImageView set to true, and most importantly .override (Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) - this will force Glide to use the original image size.
You can also specify the size in pixels in .override () , but remember to specify the correct ScaleType for your ImageView, otherwise it will also stretch the image.
source
share