vinc3m1 / RoundedImageView

A fast ImageView that supports rounded corners, ovals, and circles.
Other
6.44k stars 1.25k forks source link

Allow overriding the RoundedDrawable & customizing the draw shape #234

Closed Kurounin closed 5 years ago

Kurounin commented 5 years ago

Modified RoundedImageView and RoundedDrawable to allow using a custom Drawable in which drawing can be modified

vinc3m1 commented 5 years ago

This is exposing a ton of internal APIs with no clear indication of how to use them. At this point you might as well just fork the library and do your own implementation.

Kurounin commented 5 years ago

True, there isn't a simple method exposed because, depending on each ones needs, someone might want to override more of the base code. The idea is that whomever desires to draw something else besides a circle and a rounded corners square (maybe a star, or triangle or whatever shape) can do this by creating a new CustomDrawable that extends the RoundedDrawable class and implement the required changes (or maybe simply do a completely different MyDrawable).

While this means that whomever wants to do this will need to check the source code it's also targeted towards those users.

vinc3m1 commented 5 years ago

Right, my point is that RoundedImageView is built very specifically for RoundedDrawable only. So exposing all of these fields and methods makes it an entire undocumented API surface to support. If I change how something is named or how a previously private method behaves, now there's a chance that it would break someone's integration and I would have to make major version bumps for internal field renames and nothing is safe anymore.

RIV itself is not a complex class, if you find yourself subclassing it, you should just copy it and create your own custom view and custom drawable.