I use
Glide.with(root.context)
.load(url)
.placeholder(R.drawable.product)
.error(R.drawable.product)
.centerCrop()
.into(bindingUsersMedia.imageViewMedia)
and imageView code
<ImageView
android:id="@+id/imageViewMedia"
android:layout_width="68dp"
android:layout_height="68dp"
android:scaleType="centerCrop"
tools:srcCompat="@drawable/product_placeholder" />
My image still look like rectangle, but i need that i need squaery(68x68) What am I doing wrong? *glide version - 4.11.0
A few questions for you:
tools:srcCompat="@drawable/product_placeholder"? It might have some unnecessary spaces that can distort the appearance..load(url). Does it loads an appropriate image you want? Isn't it transparent like ".png" one? Pay attention to cache, as you can have the same URL address but it can pull the outdated version with the same URL..error(R.drawable.product). What image exists behind this resource address?android:scaleType="centerCrop"attribute of your ImageView would lead Glide to also usecenterCropas a scale type, so you don't need it in your Java/Kotlin code or vice versa: you can remove it from XML and leave in your code.