SwipeRefreshLayout in each fragment of ViewPager changes fragment on refresh - android

I have 3 fragments in ViewPager. Each fragment have SwipeRefreshLayout. But when I swipe down to refresh, view pager horizontal scroll is too sensitive. And view pager scrolls to right side fragment. I want to set limit to when vertical swipe starts, then stop horizontal scroll between fragments. In other words, I want to cancel horizontal fragment scroll when finger is moving vertically.
I swipe down to refresh fragment1. But view pager scrolled to right side fragment which is fragment2.

Related

android - how to pass touch move event ViewPager that has ListView in Drawer?

There is ViewPager that has some fragments.
That fragments have the listView.
And the ViewPager is in the Drawer.
so, I want to move ViewPager left fragment or right fragment, but the drawer is moved.
listView in fragment is preventing the touch event.
How can I move ViewPager without moving Drawer?

Viewpager which is inside scrollview scrolls to the top when redirecting the page

I have a scrollview which has some view along with the view pager in its bottom ,which has grid view inside it. when moved to the next activity and resumed to the activity the viewpager which is in the bottom scrolls to the top.
I have no idea to redirect the scrollview page with viewpager without changing its scroll position.Any suggestion??

Horizontal Recyclerview inside Viewpager android

I am facing a problem with Recyclerview inside Viewpager fragments.
I have two fragments and both loaded in ViewpagerAdapter. In the second fragment, I have a simple Horizontal Recyclerview. Initially, 1st fragment is loaded in ViewPager and when I swipe right to left on screen it will redirect me to the second fragment.
In the second fragment Recyclerview already loaded. But when I tried to scroll Recyclerview horizontally for more items it is not scrolling it redirects me to the 1st fragment from swipe left to right.
How to allow the user to view more items?
Help me with this problem.
Thanks in advance.
Try to enable Nested Scrolling for recyclerview
after initialising your recyclerview, add this line of code
your_recyclerview.setNestedScrollingEnabled(true);

How to stop view pager from swiping ,when I'm just swiping the list view in a fragment of a tablayout

I want to disable tab layout swipe between the fragments when I'm just swiping the individual list in a list view to show the delete button in one of my fragments.
when i swipe the list i only want the list to show the slide motion but not the whole view pager

Scroll to top of ViewPager tab

I have a ViewPager with 4 tabs. One of the tabs has a RecyclerView and I want to be able to scroll to the top of the fragment/RecylerView when I press on the the current fragments tab.
How can I accomplish this?

Categories

Resources