diff --git a/dependencies.gradle b/dependencies.gradle index 2df84bd..d498af9 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,5 +1,5 @@ ext { - buildTools = '25.0.3' + buildTools = '26.0.2' supportLibrary = '26.0.1' butterKnife = '8.8.1' diff --git a/example/src/main/java/com/thesurix/example/gesturerecycler/fragment/LinearRecyclerFragment.java b/example/src/main/java/com/thesurix/example/gesturerecycler/fragment/LinearRecyclerFragment.java index a14b355..6793642 100644 --- a/example/src/main/java/com/thesurix/example/gesturerecycler/fragment/LinearRecyclerFragment.java +++ b/example/src/main/java/com/thesurix/example/gesturerecycler/fragment/LinearRecyclerFragment.java @@ -53,7 +53,8 @@ public boolean onDoubleTap(final MonthItem item, final int position) { mGestureManager = new GestureManager.Builder(mRecyclerView) .setSwipeEnabled(true) .setLongPressDragEnabled(true) - .setGestureFlags(ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT, ItemTouchHelper.UP | ItemTouchHelper.DOWN) + .setSwipeFlags(ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) + .setDragFlags(ItemTouchHelper.UP | ItemTouchHelper.DOWN) .build(); adapter.setDataChangeListener(new GestureAdapter.OnDataChangeListener() { diff --git a/library/src/main/java/com/thesurix/gesturerecycler/GestureManager.java b/library/src/main/java/com/thesurix/gesturerecycler/GestureManager.java index f51c8d5..193c120 100644 --- a/library/src/main/java/com/thesurix/gesturerecycler/GestureManager.java +++ b/library/src/main/java/com/thesurix/gesturerecycler/GestureManager.java @@ -138,16 +138,41 @@ public Builder setManualDragEnabled(final boolean enabled) { /** * Sets flags for swipe and drag gesture. Do not set this flags if you want predefined flags for RecyclerView layout manager. * See {@link ItemTouchHelper} flags. + * + * This method is deprecated, use {@link #setDragFlags(int)} or {@link #setSwipeFlags(int)}. * @param swipeFlags flags for swipe gesture * @param dragFlags flags for drag gesture * @return returns builder instance */ + @Deprecated public Builder setGestureFlags(final int swipeFlags, final int dragFlags) { this.swipeFlags = swipeFlags; this.dragFlags = dragFlags; return this; } + /** + * Sets flags for swipe gesture. Do not set this flags if you want predefined flags for RecyclerView layout manager. + * See {@link ItemTouchHelper} flags. + * @param flags flags for swipe gesture + * @return returns builder instance + */ + public Builder setSwipeFlags(final int flags) { + swipeFlags = flags; + return this; + } + + /** + * Sets flags for drag gesture. Do not set this flags if you want predefined flags for RecyclerView layout manager. + * See {@link ItemTouchHelper} flags. + * @param flags flags for drag gesture + * @return returns builder instance + */ + public Builder setDragFlags(final int flags) { + dragFlags = flags; + return this; + } + /** * Builds {@link GestureManager} instance. * @return returns GestureManager instance