Enable Center Inside + example transition generator #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For the current app I'm working on, by far the main request was that we stop cropping when doing the Ken Burns because it could look really bad when the picture was a portrait and it was being displayed on a landscaped tablet or phone. Instead they wanted it to start from a fully zoomed out center inside image that would then slowly zoom/pan.
I got that working locally, and wanted to offer this code back to show how it works and some of the changes I had to made to the KenBurnsView along the way to enable the change. I also included an example transition generator. It may not be plug and play for others unless they are doing a slideshow that transitions every X seconds like we were, but if that's the case they can probably pull from the existing RandomTransitionGenerator and this new one to create a generator that meets their needs.
There might be a better way to implement the centering to make it work other than the postTranslate approach I used, but it seemed to work so I didn't look too much beyond that.
One warning with this PR is that it does add a new requirement to the TransitionGenerator interface and so other people that have created their own generators will need to implement the method. For that reason, I created 2 PRs (this one and a much simpler one) in case you would prefer not to pull this one in.