therealshabi / AutoImageFlipper

Auto Scrolling Image Pager with Pager Indicator and Text
Apache License 2.0
106 stars 25 forks source link

setRoundedCorners #37

Open Jejid opened 4 years ago

Jejid commented 4 years ago

¿Can we set rounded corners to images shown in Flipper?

like Glide: .apply(new RequestOptions().bitmapTransform(new RoundedCorners(18)))

or something like .setRoundedCorners(roundingRadius:18)

therealshabi commented 4 years ago

You can do anything with your image before setting it up in the view in whatever you want you can use Glide's apply method as well. For example:

view.setImageUrl("https://source.unsplash.com/random") { imageView, image ->
// Here image is a String url since we've passed a url in setImageUrl method
   Glide.with(context).load(image as String)
              .apply(RequestOptions().bitmapTransform(RoundedCorners(18)))
              .into(imageView);
}

For more info, please go through the README of the project

Jejid commented 4 years ago

ohh of course, many thanks

Jejid commented 4 years ago

Sorry again me. I am retaking this code after 8 months maybe

your answer is in Kotlin

view.setImageUrl("https://source.unsplash.com/random") { imageView, image -> // Here image is a String url since we've passed a url in setImageUrl method Glide.with(context).load(image as String) .apply(RequestOptions().bitmapTransform(RoundedCorners(18))) .into(imageView); }

can i make it in java? many thanks for help