When I load the image into the ImageView
with Glide
, it shrinks the image. When I rotate or reopen the same activity it has the right size. I already tried possible duplicate. I am already passing fix size to the ImageView
inside the xml and I tried to override the size as well. centerCrop()
and fitCenter()
has no effect on the shrink.
I also tried to debug the image size. When it is shrinked or not it returns same width and height.
View:
<ImageView
android:id="@+id/thumbnail"
android:layout_width="@dimen/episode_detail_img_width"
android:layout_height="@dimen/episode_detail_img_height"
android:layout_marginTop="@dimen/episode_detail_img_margin_top" />
Glide
Glide.with(getActivity())
.load(url)
.placeholder(R.drawable.thumb_placeholder)
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(thumbnail);