RecyclerViewAdapter in the demo now extends from RecyclerSwipeAdapter from the library. This greatly simplifies things for the users. They still must implement their own ViewHolder and extend from the abstract one inside the SwipeAdapter. See the demo for recyclerview for a better understanding of how it works.
Also increased the build and compile versions to 21. Added elevation to the top view for 5.0 devices. See the recyclerview on a device running android 5.0+ to see the difference from the edge.
This can be replicated with a shadow drawable gradient with lower devices. Maybe someone else can add this feature.
Demo now includes the most simple form or using a recycler view in the codebase currently.
Next step would be to create a more simplified approach at a RecyclerViewSwipeAdapter that a user can extend from and only implement smaller methods instead of all the implementations.
When used with ScorllView(or horizontal) inside SwipeLayout, the swipe
gesture may conflict with the scroll action. If use requestDisallowInterceptTouchEvent, the scroll action will be back but the parent ListView's scroll action may be disallowed too.
This patch solved this problem by introducing a "SwipeDenier"
interface whose implementation should return if this swipe event should
be denied. When onInterceptTouchEvent is called, SwipeLayout will call
all SwipeDenier and if one of them returns true, the event will not be
intercepted and passed to child views.
Tested in app: https://github.com/PaperAirplane-Dev-Team/BlackLight
which requires HorizontalScrollView inside SwipeLayout
Signed-off-by: Peter Cai <xqsx43cxy@126.com>
This patch makes SwipeLayout extend FrameLayout, which has a complete
measuring function and allows useage of match_parent and wrap_content.
Tested in app: https://github.com/PaperAirplane-Dev-Team/BlackLight
Works just all right.
Signed-off-by: Peter Cai <xqsx43cxy@126.com>