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

PanelsChildGestureRegionObserver not working properly #23

Open
im244 opened this issue Mar 29, 2021 · 2 comments
Open

PanelsChildGestureRegionObserver not working properly #23

im244 opened this issue Mar 29, 2021 · 2 comments

Comments

@im244
Copy link

im244 commented Mar 29, 2021

Hey guys, first let me thank you for making this library opened sourced.

The problem I am facing is the following: one of my fargments is basically a full page recyclerview that every row of that recyclerview host another horizontal recyclerview, so my fragment is filled with horizontal scrollable recyclerviews.
As the suggestion and following the example app, I added view.addOnLayoutChangeListener(PanelsChildGestureRegionObserver.Provider.get()) to the entire fragment view.

The issues is that sometimes it works and sometimes it does not work, when it works everything is perfect, when it doesn't the horizontal recyclerview is un scrollable and the panels won't open.
The weird thing is that when it's not working, either locking the phones and opening it again will fix it (without closing the app), or even pressing the Home button and then going back to the app will fix it.

Any suggestiongs?

@codeaskush
Copy link

Hey guys, first let me thank you for making this library opened sourced.

The problem I am facing is the following: one of my fargments is basically a full page recyclerview that every row of that recyclerview host another horizontal recyclerview, so my fragment is filled with horizontal scrollable recyclerviews.
As the suggestion and following the example app, I added view.addOnLayoutChangeListener(PanelsChildGestureRegionObserver.Provider.get()) to the entire fragment view.

The issues is that sometimes it works and sometimes it does not work, when it works everything is perfect, when it doesn't the horizontal recyclerview is un scrollable and the panels won't open.
The weird thing is that when it's not working, either locking the phones and opening it again will fix it (without closing the app), or even pressing the Home button and then going back to the app will fix it.

Any suggestiongs?

Hi @ , I was thinking about the implementation, can you share the code where you setChildGestureRegions for the view. Would help me a lot.

@sdex
Copy link

sdex commented Jun 21, 2021

I've figured out that isTouchingChildGestureRegion() returns the wrong value when using the library with fragments.
To work around the issue I clear childGestureRegions list in each fragment onStop method:

    override fun onStop() {
        super.onStop()
        PanelsChildGestureRegionObserver.Provider.get()
            .removeGestureRegionsUpdateListener(this)
        onGestureRegionsUpdate(emptyList()) // this calls overlappingPanels.setChildGestureRegions(gestureRegions)
    }

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

No branches or pull requests

3 participants