-
Notifications
You must be signed in to change notification settings - Fork 384
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
Return to default rotation after rotation #13
Comments
There is no out of the box support for such feature, but I will consider adding it into the library. For now you may try next code:
Note, that |
Reflection didn't work before v2.1.0. Now works. Thanks 😃 State end = new State();
end.set(state.getX(), state.getY(), state.getZoom(), rotation);
StateController stateController = holder.image.getController().getStateController();
try {
Method method = StateController.class.getMethod("restrictStateBounds", State.class);
method.invoke(stateController, end);
} catch (Exception e) {
e.printStackTrace();
} |
Hm, strange, this method was there almost from the beginning. |
My bad. I didn't see logs, NoSuchMethodException were throwing. Yeah, it works now because you updated |
In new version 2.1.1 I added |
Yes, thanks a lot! btw, when are you planning to make "Allow scroll up/down gestures to close full image mode.", from TODO? |
I'm not sure, I think it may take several months. It is an interesting feature, but it's hard to find a nice solution and I don't have enough time right now. |
@alexvasilkov https://github.com/DrKLO/Telegram/blob/master/TMessagesProj/src/main/java/org/telegram/ui/PhotoViewer.java telegram-s photoviewer is awesome. maybe you will find some solution from it. His code hard to understand, but it works. |
Yeah, I looked it a bit, but it is a complete mess. Anyway I have different implementation which requires different logic. |
How can i return view to default rotation state with animation, after rotating with fingers? Now when i rotate view with fingers it stays in rotated state.
Like in the video:
https://youtu.be/Jh-OJjtHJmQ
The text was updated successfully, but these errors were encountered: