Closed arshadalisoomro closed 7 years ago
Hello, @arshadalisoomro.
You can use Glide
in such a way.
Set scaleType
of ImageViews
in layout\layout_slide_card.xml
and layout-v21\layout_slide_card.xml
like this:
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:layout_gravity="center"/>
Then change setContent
and clearContent
methods of SliderCard
class, like this:
void setContent(@DrawableRes final int resId) {
Glide.with(imageView.getContext()).load(imgUrl).into(imageView);
}
void clearContent() {
Glide.clear(imageView);
}
That should do the trick.
Hello Team Ramotion!
I found this as repository of choice, it was very cleverly engineered. I've to load image from URL using Glide but result is
As you can see the height & width of image is not being perfect as the drawable are, i have made some changes in code as you can see
now SliderCard is
Question is how can I get Image cover the SliderCard perfectly as Drawables were?
Regards, Arshad Ali