Aspsine/SwipeToLoadLayout

事件拦截!!!急

ftdguowei opened this issue · 3 comments

整体布局是CoordinatorLayout,然后是tab关联的4个viewpager,这个框架如果嵌套在CoordinatorLayout里 ,上拉和刷新会抢recycleview的滑动事件,从而导致不能进行折叠效果,如果我重写了RecycleView,请求父控件不要拦截我的事件,此时tab关联的4个viewpager又不能进行左右滑动事件了,也就是说又拦截了左右滑动的事件!!!求助!!!急!!!

<CoordinatorLayout>

	<ViewPager>
		<!--view pager item 0-->
		<SwipeToLoadLayout>
			<RecyclerView/>
		</SwipeToLoadLayuot>
		<!--view pager item 0 end-->

		<!--view pager item 1-->
		<SwipeToLoadLayout>
			<RecyclerView/>
		</SwipeToLoadLayuot>
		<!--view pager item 1 end-->

		<!--view pager item 2-->
		<SwipeToLoadLayout>
			<RecyclerView/>
		</SwipeToLoadLayuot>
		<!--view pager item 2 end-->
	</ViewPager>

</CoordinatorLayout>

请把SwipeToLoadLayout放在ViewPager的每一个item里.

可是我就是这么做的啊,每个viewpager是一个fragment,fragment布局如下:

	<com.aspsine.swipetoloadlayout.SwipeToLoadLayout
		android:id="@+id/swipeToLoadLayout"
		android:layout_width="match_parent"
		android:layout_height="match_parent">

		<RelativeLayout
			android:id="@id/swipe_target"
			style="@style/relativeLayoutWidth">

			<include layout="@layout/empty_view"/>

			<com.fenxiangyinyue.client.view.MyRecyclerView
				android:id="@+id/recyclerView"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:paddingLeft="@dimen/content_padding2"
				android:paddingRight="@dimen/content_padding2"/>
		</RelativeLayout>
	</com.aspsine.swipetoloadlayout.SwipeToLoadLayout>

如果你的@id/swipe_target对应的view不是ListView或者RecyclerView等可以滑动的view,请参照 #46