Support for custom ScaleTypes
Android by default comes with the following scaleTypes
- FIT_CENTER
- FIT_XY
- FIT_START
- FIT_END
- CENTER
- CENTER_CROP
- CENTER_INSIDE
It would be great if the following scaleType are also supported or the ability to define a custom scale type in fresco.
- CENTER_TOP (Scales the image such that it fits inside the view and the image starts from the top edge of the view and is horizontally centred. This doesn't change the aspect ratio)
I doubt we will have time to do this properly anytime soon. However, if you wish to make a pull request and add it yourself, then I don't think it would be too difficult. You would just need to add CENTER_TOP to the ScaleType enum in ScalingUtils, and then add an extra case in getTransform - the new case will be very similar to CENTER_INSIDE, except that dy will be 0 (at least, I think that's what you want from the description you've given).
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
Great news! We're going to release this very soon.
@balazsbalazs Awesome. Looking forward to try this feature
This has been added a while ago, see http://frescolib.org/docs/scaling.html for more details!