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

Fix hot reload breaking the PdfView #269

Merged
merged 4 commits into from
Aug 14, 2019

Conversation

irgendeinich
Copy link
Contributor

@irgendeinich irgendeinich commented Aug 13, 2019

Details

The issue was that when reloading the code PdfFragment attached by the PdfView were not removed. Later when creating a new PdfView with the same fragmentTag it would pick up the previous fragment causing the broken UI to appear.

Acceptance Criteria

@@ -239,8 +248,18 @@ public void setMenuItemGroupingRule(@NonNull MenuItemGroupingRule groupingRule)
private void setupFragment() {
if (fragmentTag != null && configuration != null && document != null) {
PdfFragment pdfFragment = (PdfFragment) fragmentManager.findFragmentByTag(fragmentTag);
if (pdfFragment != null && pdfFragment.getArguments().getInt(ARG_ROOT_ID) != internalId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better add also a safety check against null for the bundle (i.e. pdfFragment.getArguments() != null)

@irgendeinich irgendeinich merged commit 7610b84 into master Aug 14, 2019
@irgendeinich irgendeinich deleted the reinhard/fragment-hot-reload branch August 14, 2019 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants