Open abhishekBansal opened 6 years ago
Hey, I am also using swipe reveal layout in viewpager fragment recycler view and it's working properly. Try some googling..
I tried, do you have swipe enabled in your view pager?
Yes i had swipe enabled in view pager but the viewpager's fragment had nested scroll view due to my need and in nested scroll view i used recycler view and as a item of that recycler view i am using swipe reveal layout.
And its working perfectly! 👍 😃
i had this same issue. if last viewpager has recycleView then it doesn't support Swiping .
Create custom view with extend of ViewPager
class SwipeLayoutViewPager(context: Context, attrs: AttributeSet) : ViewPager(context, attrs) {
override fun canScroll(v: View, checkV: Boolean, dx: Int, x: Int, y: Int): Boolean {
if (v is SwipeLayout) {
return v.openStatus != SwipeLayout.Status.Close
}
return super.canScroll(v, checkV, dx, x, y)
}
}
Use custom view pager in xml instead of support view pager
<com.example.example.SwipeLayoutViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Profit :)
I have two fragments inside a view pager. Last fragment has a recycler view where I am trying to implement Swipe to Dismiss with SwipeLayout. However, SwipeLayout isn't working when that fragment is in viewpager and works when that fragment is not inside a view pager. By not working i mean that swipewont reveal background and event is consumed by ViewPager itself.