Open ivandamyanov opened 8 years ago
Hi. Have you took a look at my examples code? The "Swipeable (basic)" example shows how to implement Google's Inbox app like behavior. Thanks.
Implement onSetSwipeBackground()
method
:point_right: SwipeableExampleAdapter.java#L171
Use SwipeDismissItemAnimator
(optional, but required to improve dismiss animation)
:point_right: SwipeableExampleFragment.java#L97
Add isPinned
state to each item data, and also its getter and setter
:point_right: ExampleDataProvider.java#L150
Update onBindItemView()
method
holder.setSwipeItemHorizontalSlideAmount(
item.isPinned() ? Swipeable.OUTSIDE_OF_THE_WINDOW_LEFT : 0);
:point_right: SwipeableExampleAdapter.java#L156
Implement your Swipe**ResultAction
class which extends SwipeResultActionMoveToSwipedDirection
Set isPinned = true
inside of the onPerformAction()
method.
:point_right: SwipeableExampleAdapter.java#L224
Return an instance of the Swipe**ResultAction
class inside of the onSwipeItem()
:point_right: SwipeableExampleAdapter.java#L204
A. If item is not pinned.
Click event will be fired on the view which is returned from SwipeableItemViewHolder.getSwipeableContainerView()
.
:point_right: SwipeableExampleAdapter.java#L133
B. If item is pinned.
Click event will be fired on the ViewHolder.itemView
.
:point_right: SwipeableExampleAdapter.java#L131
I think one of the most attractive things about this library is the swipeable feature with icons below the RecyclerView item allowing to take action, as we've seen them on Google apps. I have never seen a tutorial online on this library and it is really hard to implement its features.
Does anyone know of a tutorial on the Swipeable features? I tried following the guide that the author wrote but it lead me nowhere. I really need this feature and the library seems to be doing great in the demo video, but obviously no one implements it and helps other do it too. I'd really like it if someone could make an example how to implement that with at least it's basic working functionality. Thank you