Comments (3)
Hi @lucky919,
You have to allow swipe direction DOWN,
override getAllowedSwipeDirectionsMovementFlags
in SwipeableTouchHelperCallback
public int getAllowedSwipeDirectionsMovementFlags() {
return ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT | ItemTouchHelper.UP | ItemTouchHelper.DOWN;
}```
from swipeablecards.
Hi, I've overridden that method, the problem is 'mSelected' field is null, which inturn throws NPE with 'getMovementFlags' method.
from swipeablecards.
@lucky919 I know it's a little late to respond, all you have to do is call the item swipeTouchHelper after overwriting getAllowedSwipeDirectionsMovementFlags
, just like that.
itemTouchHelper.swipe(rvInGame.findViewHolderForAdapterPosition(position), ItemTouchHelper.DOWN);
In this case rvInGame is my RecyclerView and position is the current position of the RecyclerView adapter, I get the position from a method I call in a listener of my adapter, as in any RecyclerView with an OnItemClickListener.
from swipeablecards.
Related Issues (18)
- Swipe item without deleting from db HOT 1
- setTransYGap is not working HOT 1
- Callback incompatible HOT 1
- how to add stack HOT 1
- how can we get the scroll percentage HOT 3
- Recyclerview shrinks when fragment is resumed. returns to normal height when clicked again. HOT 2
- [ ViewPager inside ] ViewPager inside Card does not receive clic event
- How to Left Swipe and right Swipe on Button Click HOT 2
- How to disable swipe temporarity? HOT 1
- Crashes on v1.0.19
- doest work in kotlin HOT 1
- Flickering on Card swipe
- Add onClick feature
- Add onItemSwipedUp and Down HOT 1
- How to restrict Upwards and downwards swiping. HOT 1
- How to programatically swipe left or right? HOT 6
- Undo functionality HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swipeablecards.