-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
[BUG] - Image disappears in CropImageActivity
after configuration change
#296
Comments
Hey, sorry for the lack of answers here. I'm on vacation and traveling until 18/01. Just after this I will have the attention of this repository. Do not need to wait for me, just letting people know as I'm the main maintenance |
Indeed, an issue. Happy to someone drop a PR fixing it ^^ |
Hi, guys :) . This issue is indeed unfitting of this great image-cropper library. For now, if you want to make the issue less noticable (THIS IS NOT A FIX):
|
@yoijoe4 thanks for searching this! @samiuelson this work for you? Please any of you feel free to drop a PR fixing it ^^ |
This is not a solution. Configuration change happens not only during screen rotation but also on theme switch, locale change, etc. Events like those also break the behavior. My preferred solution would be to implement ViewModel for CropImageActivity which would survive configuration changes. The ViewModel would intercept user/UI events from CropImageActivity and compute and expose the current UI state. The activity would collect the state from view model and render it. |
@samiuelson You are totally right. I forgot to mention that and I have changed my comment accordingly. |
Describe the bug
The cropped image disappears in
CropImageActivity
on any configuration change (e.g. screen rotation, device theme switch).To Reproduce
Steps to reproduce the behavior in the sample app:
Expected behavior
The state (image uri, crop, rotation, etc) should be preserved across configuration changes.
Media
rotation_issue.mp4
Smartphone (please complete the following information):
Additional context
Happens both in the sample app, and in my own app using
CropImageActivity
launched in the following way:The text was updated successfully, but these errors were encountered: