Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Center Inside + example transition generator #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EricSiegNW
Copy link
Contributor

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.

@alextebenev
Copy link

good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants