Comments (8)
If you take a look at DragDropGrid at line 200, this is where the touch up and reordering is handled if something was dragged.
from pageddragdropgrid.
I modified ExamplePagedDragDropGridAdapter and added a method; isOrdered(), to check the list is ordered or not, for a special purpose.
public boolean isOrdered(){
List<Item> items = pages.get(0).getItems();
Long previousIndex = items.get(0).getId();
for (int i = 1; i < items.size(); i++) {
Long currentIndex = items.get(i).getId();
if(currentIndex > previousIndex){
previousIndex = currentIndex;
continue;
}
else{
return false;
}
}
return true;
}
I need to catch somehow the drop event so later I can check if the list is ordered or not.
So from my Activity how can I catch the drop event? (Without modifying core source codes for DragDropGrid class)
from pageddragdropgrid.
Any time there is a drop that causes a reorder, swapItems() will be called.
from pageddragdropgrid.
I understood. But what about a listener? Are there any listener exists on
DragDropGrid or adapter or items that I can listen it to catch drop events
to call my method in adapter?
Thanks
On Fri, Apr 5, 2013 at 5:36 PM, Luke Korth [email protected] wrote:
Any time there is a drop that causes a reorder, swapItems()https://github.com/mrKlar/PagedDragDropGrid/blob/master/example/src/ca/laplanete/mobile/example/ExamplePagedDragDropGridAdapter.java#L209will be called.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-15959144
.
M.Musa Ülker
from pageddragdropgrid.
I don't believe so
from pageddragdropgrid.
Then, whats your advice?
On Fri, Apr 5, 2013 at 6:05 PM, Luke Korth [email protected] wrote:
I don't believe so
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-15960891
.
M.Musa Ülker
from pageddragdropgrid.
Use swapItems()
or modify DragDropGrid
from pageddragdropgrid.
You could create your own listener and use it in the adapter when swapItems is called.
from pageddragdropgrid.
Related Issues (20)
- Dynamic add to gridview
- Question: Is there some limit to the amount of views in a page? HOT 1
- Vertical Scrolling
- Vertical Scrolling Problem HOT 1
- Manage max number of children per page
- Get itemId
- long click on item android 4.4 HOT 13
- VerticalScroll HOT 7
- is there a support for manually deleting an item without dragging it to the delete view zone? HOT 2
- notifayDataSetChange
- Adding items dynamically is broken after merging #47 HOT 1
- Horizontal Scroll View as a base layout for Grid
- get Drag Event
- I am not able to update data of grid view HOT 2
- Scrolling issue
- How to get Item in onClickListener
- LongClick then Drop Issue
- My Implementation to move items instead of swap
- Animation when drag item in gridview
- How to Swap item view between pages?
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 pageddragdropgrid.