doffm / android-dragarea Goto Github PK
View Code? Open in Web Editor NEWFramework for performing Drag 'N Drop operations with similar APIto that available in android-11.
Framework for performing Drag 'N Drop operations with similar APIto that available in android-11.
Drag events that end, but do not result in ACTION_DROP (meaning the drag event ended but was not inside the bounds of the particular OnDragListener) end up calling the listener with ACTION_DRAG_ENDED twice.
The first seems to be a result of dragDropped() calling onUpEvent() and returning the ACTION_DRAG_ENDED event code.
The second seems to be a result of dragAborted() being called by the touch intercept in DragArea.
One suggestion to fix this is would be to rewrite dragDropped() as follows:
private void dragDropped()
{
for (Droppable d: mDroppables.values())
{
boolean hit = isHit(d, (int) mX, (int) mY);
int event = d.onUpEvent(hit);
if(event == DragEvent.ACTION_DROP) {
//Only post event if this is a valid drop
DragEvent dragEvent = new DragEvent(mDragBundle, event, (int) mX, (int) mY);
d.listener.onDrag(d.view, dragEvent);
}
}
invalidate();
}
Thanks!
No comment on this page and it looks good
king of kingss
I'm wanting to root my galaxy s3, was going to use tool voodoo unlock SIM card. Hope it works
DragEvent class produces too many errors in DragArea class. IDE says that the 2nd argument is wrong it is seeing the custom DragEvent class but expecting the required android.view.DragEvent class. Any ideas?
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.