question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems after migration to version 2.0+

See original GitHub issue

Hello, thanks again for the great library.

We have faced several issues after migration to beagle drawer-layout. I see that now the base implementation uses a fragment under the hood. It introduced a few problems:

  1. We use Accessibility an application and now OverlayFragment request focus all the time due to he is a root 🙂
  2. Due to we have a legacy code we sometimes replace fragment in android.R.id.content and in this case we lose Beagle on this screen)

Thanks a lot.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pandulapetercommented, Sep 29, 2020

One more update: I’ve played around a bit with the back stack listener in this commit and there is a slight chance that these changes will fix your second issue. Theoretically now the OverlayFragment should be re-added to the top of the stack every time the stack changes.

If you haven’t given up on the library yet, could you give it a try? These changes are part of the new v2.0.3 release.

1reaction
pandulapetercommented, Sep 28, 2020

Hi,

Sorry to hear about these problems. Both of your issues make perfect sense and come down to some core design decisions on my side. Unfortunately, I don’t yet have a good solution, but let me give you some explanations, maybe together we will figure something out:

  1. OverlayFragment is indeed added on top of every Activity: in case of the drawer it is responsible for Beagle’s UI (the old versions’ hacky way of removing the root View of every Activity and “injecting” a DrawerLayout instead was glitchy, hacky and probably introduced more problems - this solution feels a lot cleaner). Furthermore it also handles persmissions / Activity results (for the screenshot / screen capture features) and hosts the OverlayView which provides a way for drawing over the UI (for example the KeylineOverlaySwitchModule relies on it). Obviously OverlayFragment should not affect the functionality of the underlying app in any way apart from these. I didn’t work with accessibility that much, do you maybe know a simple fix for not stealing the focus? How can we forward these events without knowing what’s below?

  2. Three ideas: a) If your legacy code happens to rely on the FragNav library, this workaround might help. b) I could add an optional lambda to the Beagle configuration’s Behavior object: it would receive an Activity type parameter and would expect an ID resource in response that can be used as OverlayFragment’s container. Unfortunately this also would need some refactoring of your legacy codebase to add empty FrameLayouts over the Activities. Anyway, would this help? c) What do you think, in the addOverlayFragment() function of this class, if we used add() instead of replace() - could that fix your issue? Probably not, since in your case your own implementation seems to be calling replace() after Beagle, so the debug menu wouldn’t be added to the top (and we could also introduce some unwanted stack handling issues).

All in all: I’ll let you know if I have any other ideas but right now the best that I can say is that in release builds your app will work as expected (the noop library surely won’t break focus handling). Do you maybe have any ideas that we could try? If you have the time and feel like experimenting, maybe consider cloning this repository (here is a guide that will help with the module structure).

Thanks for the bug report!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting migration to the latest versions
Troubleshooting migration to the latest versions · Deprecated or removed objects · Configuration conflict: Commitment policy and algorithm suite · Configuration ...
Read more >
My flutter 2.0 migration story : Still better story than twilight
Upgrade flutter and dart version to 2.0 and migrate the existing project to the new updated development environment. Disclaimer: Always make a complete ......
Read more >
Problems with migration from JSF 1.2 to 2.0
The first step was to fix the the web. xml and move to Servlet API 2.5. After this I replaced the dependencies and...
Read more >
3.0 upgrade, keeping migration versions data · Issue #967 · ...
I had no problems with keeping migrations data. I did have to run doctrine:migrations:sync-metadata-storage to upgrade to the new storage format ...
Read more >
Error while Add-Migration "Initialize" in .NET 6 Entity ...
The framework 'Microsoft.NETCore.App', version '2.0.0' (x64) was not found. You can resolve the problem by installing the specified framework ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found