I want fitXY
scaleType for image and fitCenter
for place holder. I am fetching data from api using volley and loading image using glide.
How am I supposed to know that image is null ?
XML and code
<ImageView
android:id="@+id/NewsImage"
android:layout_width="120dp"
android:layout_height="120dp"
android:scaleType="fitCenter" />
Glide.with(context).load(news.getUrlToImage()).placeholder(R.drawable.place_holder).dontAnimate().into(holder.NewsImage);
1.USING LISTENER
Using GLIDE you can add a listener for image loading. Once the image is loaded change the SCALE type of the ImageView.
2.USING GLIDE
You can use one of the GLIDE transformations for the image or create your custom transformation https://github.com/bumptech/glide/wiki/Transformations