mrKlar / PagedDragDropGrid

An Android ViewGroup that implements a paged grid with drag'n'drop moveable items
406 stars 185 forks source link

long click on item android 4.4 #41

Open emredurmuss opened 10 years ago

emredurmuss commented 10 years ago

When i long click on item after updating my phone to kitkat, the clicked item is going to the end of the list. What should I do to fix that?

ghost commented 10 years ago

Also happening to me. Does anyone know how to solve this? It would be nice to know if someone already fixed it before trying myself.

X3Daniel commented 10 years ago

it also happening to me. when i debug it. i found the method getDraggedView in DragDropGrid Useing ChildView at (getChildCount-2) not dragged position. but if i use getChildAt(dragged).it make some othen errors and crashed.
private View getDraggedView() { return getChildAt(getChildCount()-2); // return getChildAt(dragged); }

emredurmuss commented 10 years ago

Could anybody solve the issue?

ghost commented 10 years ago

The problem is the change in View.bringToFront() in KitKat ( http://developer.android.com/reference/android/view/View.html#bringToFront%28%29 ). With this change it is not necessary to call invalidate() to change view children order anymore. Since this library was relying in children order, with this change it breaks.

I have a working version were I keep the order in a List, but I still need to test it a bit more, fix a couple of bugs, and make the code way prettier.

mrKlar commented 10 years ago

If you fix it, issue a pull request and i will merge it.

thanks

venator85 commented 10 years ago

Hi anlosar, can you share your fix please? Thanks ;)

ghost commented 10 years ago

Sorry, but I discovered my version crashes when removing views and didn't have time to solve it (I was a couple of evenings dealing with it but no success). I'll try to fix this asap, but, you know, time is never enough :)

venator85 commented 10 years ago

Hi, I am currently not using view removal, so could you please share it anyway? If you want, you can send it privately at venator85@gmail.com. Thanks ;)

ghost commented 10 years ago

I sent you an email with the code. If you fix that issue, please tell us and upload it. Thanks

kysu0906 commented 10 years ago

Hi anlosar. Please share your working version to me. I want to solution. If you can, please send at kysu0906@gmail.com.

ghost commented 10 years ago

Sent.

komaxx commented 10 years ago

Hi anlosar,

one more, please ;) github@poroba.com

Thank you!

fatemeh2sh commented 10 years ago

hi @anlosar when long click item in kit kat wrong please your fix mail for me z.sharif.sh@gmail.com thank you