I have set <ImageView /> height to wrap_content. I am adding this layout in recycler adapter
There will be around 10 images all images are set to wrap_content.
Is there any way to get the height of image rendered by Glide.
I am using this, but its returning the screen dimensions and not image dimensions.
Glide.with(context).load(imgpth).placeholder(R.drawable.bg_loading)
.error(R.drawable.bg_loading).into(imageProdctBanner).getSize(new SizeReadyCallback() {
@Override
public void onSizeReady(int width, int height) {
Log.e("width","wdthheight "+width+" : "+height);
}
});
I need this to set height of recyclerView.
int totalItems= cardsRecyclerAdapter.getItemCount();
ViewGroup.LayoutParams params=rvCards.getLayoutParams();
params.height= heightOfImageView *totalItems;
rvCards.setLayoutParams(params);