mflisar / dragselectrecyclerview Goto Github PK
View Code? Open in Web Editor NEWTouchListener that can be attached to any RecyclerView and handles multi selection for you
License: Apache License 2.0
TouchListener that can be attached to any RecyclerView and handles multi selection for you
License: Apache License 2.0
Since Scroller
used to calculate current position which relate to the peogress of scrolling. But in this lib we calculate the speed ourselves. Scroller
just be used as a flag to indicate whether is scrolling.
So I think we can simply use a boolean var to take the place of the Scroller
. I have already done this and every thing woks well.
I am still not sure if you use it for any other reason.
All I can see in the repo is the library...
Please add the sample
:(
can u please let me know why it's not working in nested scrollview
The library does not support AndroidX Recycler View, this needs to be improved
请问如何滑动就可以被选中和取消选中,而不是长点击之后滑动才能选中和不选中
This can be improved. Sometimes, when redrawing views while scrolling fast, they are creating some not very beautiful "shadow"...
Ideas:
Not sure if this is causing the problems though, but as the corresponding function is called on every MotionEvent.ACTION_MOVE
it may help...
Currently I am using
mDragSelectionProcessor = new DragSelectionProcessor(new DragSelectionProcessor.ISelectionHandler() {
@Override
public HashSet<Integer> getSelection() {
return mAdapter.getSelection();
}
@Override
public boolean isSelected(int index) {
return mAdapter.getSelection().contains(index);
}
@Override
public void updateSelection(int start, int end, boolean isSelected, boolean calledFromOnStart) {
mAdapter.selectRange(start, end, isSelected);
}
}).withMode(mMode);
I also tried
mDragSelectionProcessor = new DragSelectTouchListener.OnAdvancedDragSelectListener()
{
@Override
public void onSelectChange(int start, int end, boolean isSelected) {
// update your selection
// range is inclusive start/end positions
mAdapter.selectRange(start, end, isSelected);
}
@Override
public void onSelectionStarted(int start) {
// drag selection was started at index start
Log.e("michaelflisar",start+" Start");
}
@Override
public void onSelectionFinished(int end) {
Log.e("michaelflisar",end+" End");
// drag selection was finished at index start
}
};
but on using OnAdvancedDragSelectListener() the first cell is not selecting in the sample app you provided
Hi, thanks for the much useful library!
Here's how to recreate a bug I spotted. (See the Current behavior gif below.)
Desired behavior should be being able to deselect at the step 3 right?
I think bug is in the following line:
break;
needs to be changed to return false;
Right now the function onInterceptTouchEvent
will return true in the case MotionEvent.ACTION_DOWN:
and the user does not receive an onClick
event for the ViewHolder
of tile 0 .
How can use drawselectrecylerview with Swipe to refresh layout?
My app uses a collapsing toolbar whith viewpager, but when i start draging when the toolbar is expanded the list not auto scrolls, but when my toolbar is collapsed the list scrolls normally
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.