swipe is notworking inside viewpager
hoangtuan051 opened this issue · 1 comments
hoangtuan051 commented
when viewpager contains recyclerview inside fragment, it is only viewpager active and swipelayout not woking
ZaydelEduard commented
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 :)