-1

I have a horizontal recyclerview inside the AppBarLayout, which is inside the CoordinatorLayout, which is inside the SwipeRefreshLayout. I want that when I move horizontally in recyclerview it can't if the user accidentally pulls down to do a refresh. I tried nestedScrollingEnabled = false, but it doesn't help

Michael
  • 73
  • 7

1 Answers1

0

Take the horizontal recyclerview out of the appbar layout. then set this code for swipe refresh layout:

appbarDetails.addOnOffsetChangedListener(AppBarLayout.OnOffsetChangedListener { appBarLayout, verticalOffset ->
            swipeRefresh.isEnabled = verticalOffset == 0
        })

swipe refresh it is only active when the screen is on top