Is there the possibility of making rounded corners on carousel in Android Studio?
I used a background but it doesn't work
<com.synnapps.carouselview.CarouselView
android:background="@drawable/radius_fond"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:id="@+id/carouselView"
android:layout_width="match_parent"
android:layout_height="200dp"
app:fillColor="@color/neutre30"
app:pageColor="@color/neutre"
app:radius="6dp"
android:layout_marginTop="30dp"
app:slideInterval="4000"
app:strokeColor="#FF777777"
app:strokeWidth="1dp"/>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/fond">
</solid>
<corners android:radius="12dp"></corners>
</shape>
I then used some code to make the corner radius. It works but for a moment the square photo appears and then the corners become round
var imageListener: ImageListener = object : ImageListener {
override fun setImageForPosition(position: Int, imageView: ImageView) {
// You can use Glide or Picasso here
val transformation: Transformation = RoundedTransformationBuilder()
.cornerRadiusDp(12f)
.oval(false)
.build()
Picasso.get().load(sampleImages[position])
.fit()
.transform(transformation)
.into(imageView)
}
}
do you have any other solution?
Thanks

