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

Save frame refactor part 6 (8) - fix glitch on static background frames #256

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Jan 29, 2020

This builds on #255.

This PR fixes a problem when the currently selected frame is a static background frame, and pressing SAVE (Next) would make the added Views disappear and not appear again until the user switches to another frame and then switches back again to that frame.

Internally, the saveFrame() algorithm removes and adds the user-added Views to each ghost offscreen PhotoEditorView, and finally removes the addedViews so these can be added back to the actual PhotoEditorView being shown on the screen. But, the FrameSaveManager is never passed the actual screen's PhotoEditorView, so we can't really re-add the views for the selected frame once things are finished (as a matter of fact the FrameSaveManager doesn't even know which frame is selected, as that's responsibility of the StoryViewModel).

So, this PR introduces a small workaround to refresh the selected frame and re-add the views by calling storyViewModel.setSelectedFrameByUser() on the current index once the saveStory() method has returned.

To test:

  1. add a few static image based frames
  2. add a text / emoji to each
  3. select any one
  4. tap NEXT to save the story
  5. observe once the story is finished saving, the added views for the selected frame are still there (as opposed to having disappeared)

mzorz added 3 commits January 28, 2020 14:05
…o feature/stories-creation-save-frame-refactor-part5-fixes
…o feature/stories-creation-save-frame-refactor-part5-fixes
@peril-automattic
Copy link

You can test the changes on this Pull Request by downloading the APK here.

@aforcier aforcier self-assigned this Jan 30, 2020
@aforcier aforcier added this to the Demo 2: Single Loop Creation milestone Jan 30, 2020
@aforcier
Copy link
Collaborator

Change makes sense and works well 👍

:shipit:, will merge after #255.

@aforcier aforcier changed the base branch from feature/stories-creation-save-frame-refactor-part5 to feature/stories-creation-save-frame-refactor-base January 31, 2020 02:17
@aforcier aforcier merged commit 8915ff8 into feature/stories-creation-save-frame-refactor-base Jan 31, 2020
@aforcier aforcier deleted the feature/stories-creation-save-frame-refactor-part5-fixes branch January 31, 2020 02:17
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