askerov / dynamicgrid Goto Github PK
View Code? Open in Web Editor NEWDrag and drop GridView for Android
License: Apache License 2.0
Drag and drop GridView for Android
License: Apache License 2.0
As I see in usage
All grid item animations require api 11 (Honeycomb)
It seems you're using some animations only exists in Honeycomb+.
Do you think about using NineOldAndroids to backport this animation so that DynamicGrid can support Android 2.x?
Do you thenk that it would be a good idea to add col sapn and row span support to grid view?
I want to launch the project in Eclipse. I imported the GridActivity project and the dynamicgrid library, added dynamicgrid to the build path of the GridActivity project. But I get the crash here below. Any help would be appreciated ! Thanks.
04-29 11:27:09.591: E/AndroidRuntime(13629): FATAL EXCEPTION: main
04-29 11:27:09.591: E/AndroidRuntime(13629): Process: org.askerov.dynamicgrid.example, PID: 13629
04-29 11:27:09.591: E/AndroidRuntime(13629): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.askerov.dynamicgrid.example/org.askerov.dynamicgrid.example.GridActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class org.askerov.dynamicgrid.DynamicGridView
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2760)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.ActivityThread.access$900(ActivityThread.java:177)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.os.Handler.dispatchMessage(Handler.java:102)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.os.Looper.loop(Looper.java:145)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.ActivityThread.main(ActivityThread.java:5944)
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.reflect.Method.invoke(Native Method)
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.reflect.Method.invoke(Method.java:372)
04-29 11:27:09.591: E/AndroidRuntime(13629): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1389)
04-29 11:27:09.591: E/AndroidRuntime(13629): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
04-29 11:27:09.591: E/AndroidRuntime(13629): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class org.askerov.dynamicgrid.DynamicGridView
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
04-29 11:27:09.591: E/AndroidRuntime(13629): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:435)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.Activity.setContentView(Activity.java:2267)
04-29 11:27:09.591: E/AndroidRuntime(13629): at org.askerov.dynamicgrid.example.GridActivity.onCreate(GridActivity.java:23)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.Activity.performCreate(Activity.java:6289)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
04-29 11:27:09.591: E/AndroidRuntime(13629): ... 10 more
04-29 11:27:09.591: E/AndroidRuntime(13629): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.askerov.dynamicgrid.DynamicGridView" on path: DexPathList[[zip file "/data/app/org.askerov.dynamicgrid.example-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
04-29 11:27:09.591: E/AndroidRuntime(13629): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.view.LayoutInflater.createView(LayoutInflater.java:578)
04-29 11:27:09.591: E/AndroidRuntime(13629): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)
04-29 11:27:09.591: E/AndroidRuntime(13629): ... 20 more
04-29 11:27:09.591: E/AndroidRuntime(13629): Suppressed: java.lang.ClassNotFoundException: org.askerov.dynamicgrid.DynamicGridView
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.Class.classForName(Native Method)
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
04-29 11:27:09.591: E/AndroidRuntime(13629): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
04-29 11:27:09.591: E/AndroidRuntime(13629): ... 23 more
04-29 11:27:09.591: E/AndroidRuntime(13629): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Hi,
Is there a way to restrict column 1 to not be moved?
I'm trying to make a meal planner chart wherein the user can move meals from a day to another.
The first column is the column for dates, and must not move. Is there any way I can do this with your DynamicGrid? Thanks in advance.
NOTE: This is reproducible reliably on my Lenovo P780. I can't reproduce it on any emulator.
Some items disappear randomly while dragging, leaving gaps.
Later, when dragging different items, items which have disappeared previously may re-appear.
STR: Start dragging third item ('Abertam') to the left. Move it several times back and forth on the same row. At some point some item on that row disappears.
Hi,
I've heavy tested the view by dragging an item all over the screen, and after I've dropped the item it crashed with the following log:
java.lang.NullPointerException
at org.askerov.dynamicgid.DynamicGridView.touchEventsEnded(DynamicGridView.java:454)
at org.askerov.dynamicgid.DynamicGridView.access$23(DynamicGridView.java:438)
at org.askerov.dynamicgid.DynamicGridView$3.isScrollCompleted(DynamicGridView.java:812)
at org.askerov.dynamicgid.DynamicGridView$3.onScrollStateChanged(DynamicGridView.java:796)
at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:4171)
at android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:4335)
at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4433)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:738)
at android.view.Choreographer.doCallbacks(Choreographer.java:564)
at android.view.Choreographer.doFrame(Choreographer.java:530)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:723)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5520)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
at dalvik.system.NativeStart.main(Native Method)
The grid view was scrollable by the way. Let me know if I can help you with any other information.
Hi, I've tried to change your code and make possible to scroll when we do longPress on an item and starts edit mode. I couldn't find it and if you can help me I appreciate your help.
When I start dragging an item to the end of the list it scroll the gridview, at one point it crash with :
E/AndroidRuntime(16580): java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewParent android.view.View.getParent()' on a null object reference
E/AndroidRuntime(16580): at android.widget.AdapterView.getPositionForView(AdapterView.java:598)
E/AndroidRuntime(16580): at org.askerov.dynamicgrid.DynamicGridView.getColumnAndRowForView(DynamicGridView.java:756)
E/AndroidRuntime(16580): at org.askerov.dynamicgrid.DynamicGridView.handleCellSwitch(DynamicGridView.java:651)
E/AndroidRuntime(16580): at org.askerov.dynamicgrid.DynamicGridView.onTouchEvent(DynamicGridView.java:431)
E/AndroidRuntime(16580): at android.view.View.dispatchTouchEvent(View.java:7706)
Sorry to post such a simple problem, but I am unable to run the sample project. I was able to build after adding the dynamicgrid project in the build path of the example project. However, when I run the example project on the device, it crashes with this error:
10-22 23:05:07.275: E/dalvikvm(7303): Could not find class 'org.askerov.dynamicgrid.DynamicGridView', referenced from method org.askerov.dynamicgrid.example.GridActivity.onCreate
I searched for an answer, and found some comments regarding use of "/lib" versus "/libs". However, I am a total novice at Java and I really don't understand how to properly include one project in another project.
I thank you in advance for your time to consider this problem
I'm running the 'official' pre-release version of Android L (LPV79) on my Nexus 5. Both DynamicGridExample and my app have cell visibility issues when reordering. I was able to fix it just by stubbing out two calls to setVisibility() in handleCellSwitch() in DynamicGridView.java. I added the following code to dynamically check for L and only make the calls if on a pre-L OS. I'm not sure this is the best fix, but is working for me at the moment.
/**
* The GridView from Android L requires some different setVisibility() logic
* when switching cells. Unfortunately, both 4.4W and the pre-release L
* report 20 for the SDK_INT, but we want to return true for 4.4W and false
* for Android L. So, we check the release name for "L" if we see SDK 20.
* Hopefully, Android L will actually be SDK 21 or later when it ships.
*
* @return
*/
private boolean isPreL() {
final int KITKAT_WATCH = 20;
return (Build.VERSION.SDK_INT < KITKAT_WATCH) ||
((Build.VERSION.SDK_INT == KITKAT_WATCH) && !"L".equals(Build.VERSION.RELEASE));
}
private void handleCellSwitch() {
...
if (isPreL()) {
mobileView.setVisibility(View.VISIBLE);
}
if (isPostHoneycomb() && isPreL()) {
targetView.setVisibility(View.INVISIBLE);
}
...
}
I want change animation translate in DynamicGrid like LXReorderableCollectionViewFlowLayout in IOS. See this: https://www.youtube.com/watch?v=R2L_16XeChE .So what i suppose to do? Thank you.
Is it possible for me to prevent certain items inside the adapter to not swap with others when they are hovered over? to just stay in their place when startEditMode is on?
The identifier I have for these items that I dont want to move is id
and its always static, I want that all the time, the items that have these two id's should never swap with any other item
Hi askerov,
Thank you for sharing great dynamic gridview lib
But When I run android 2.3.3 emulator and try 13 items, after i move item 13 to Top throws exception like here
10-23 10:02:32.994: E/AndroidRuntime(1464): FATAL EXCEPTION: main
10-23 10:02:32.994: E/AndroidRuntime(1464): java.lang.IndexOutOfBoundsException: Invalid index 13, size is 12
10-23 10:02:32.994: E/AndroidRuntime(1464): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
10-23 10:02:32.994: E/AndroidRuntime(1464): at java.util.ArrayList.add(ArrayList.java:152)
10-23 10:02:32.994: E/AndroidRuntime(1464): at org.askerov.dynamicgid.DynamicGridUtils.reorder(DynamicGridUtils.java:20)
10-23 10:02:32.994: E/AndroidRuntime(1464): at org.askerov.dynamicgid.BaseDynamicGridAdapter.reorderItems(BaseDynamicGridAdapter.java:91)
10-23 10:02:32.994: E/AndroidRuntime(1464): at org.askerov.dynamicgid.DynamicGridView.reorderElements(DynamicGridView.java:282)
10-23 10:02:32.994: E/AndroidRuntime(1464): at org.askerov.dynamicgid.DynamicGridView.handleCellSwitch(DynamicGridView.java:723)
10-23 10:02:32.994: E/AndroidRuntime(1464): at org.askerov.dynamicgid.DynamicGridView.onTouchEvent(DynamicGridView.java:457)
10-23 10:02:32.994: E/AndroidRuntime(1464): at android.view.View.dispatchTouchEvent(View.java:3885)
10-23 10:02:32.994: E/AndroidRuntime(1464): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
10-23 10:02:32.994: E/AndroidRuntime(1464): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-23 10:02:32.994: E/AndroidRuntime(1464): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-23 10:02:32.994: E/AndroidRuntime(1464): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
Hi! Thanks for your library. What about columnNumber=autofit. It's not working correctly. Thanks
I got dynamicgrid working just fine on Android 4.x.
I am having trouble getting it to work on Android 2.3.
I have a breakpoint in the startEditMode, and this point is always reached. However, on Android 2.3 the drag and drop mechanism is broken.
I will see one of two things.
case MotionEvent.ACTION_UP:
touchEventsEnded();
if (mUndoSupportEnabled) {
if (mCurrentModification != null && !mCurrentModification.getTransitions().isEmpty()) {
mModificationStack.push(mCurrentModification);
mCurrentModification = new DynamicGridModification();
}
}
if (mHoverCell != null) {
if (mDropListener != null) {
mDropListener.onActionDrop();
}
}
The hard part is that the behavior is not predictable. Sometimes I see case (1) and the item is dragged visually, but onActionDrop is never called. Other times I donโt see any dragging visually and the grid view never reorders itself, but onActionDrop is called, but with the original list still intact? It never works properly, it is always defect 1 or 2.
I have already spent some time trying to debug this problem on an Android 2.3 phone (not emulator). I would be happy to see if I can help to solve this problem, but I would need some advice or suggestions about what may be wrong.
Reason: In DynamicGridView.handleCellSwitch, put log statement like this:
&& deltaXTotal < view.getRight() - mOverlapIfSwitchStraightLine)) {
Log.i("===", "idList.size(): " + idList.size());
With every new cell re-arranged during constant dragging, idList.size() grows. As a result, performance degradates quickly.
I don't really know what else I can say about this. It seems the library can't find a view at times, and causes random NPE crashes internally when it happens because callers of getViewForId()
always assume the result is not null. This library doesn't seem to be under development anymore either, so posting this in the hopes that someone else has run into this and found a cause/solution.
I believe this is part of a deeper problem, as it seems #46, #8, and #36 are all possibly related.
In L, the rendering artifact issue is very well solved by the 39th commit but when we drag the cells on the screen at a pretty high speed we can still see the Cells disappearing/invisible issue.
In provided example, replace sCheeseString with
public static final String[] sCheeseStrings = {
"Abbaye de Belloc", "Abbaye de Belloc", "Abbaye de Belloc"
};
then try to drag. The items become not draggable and disappear randomly.
Great job on this project, really. Better than mrKlar's implementation. Is there a way that you already provide to delete items from the grid? Thanks.
i don't know what is mean,
float xDiff = Math.abs(DynamicGridUtils.getViewX(view) - DynamicGridUtils.getViewX(mobileView));
float yDiff = Math.abs(DynamicGridUtils.getViewY(view) - DynamicGridUtils.getViewY(mobileView));
beacause they are always 0.0f. All views have the same widht and height.
02-18 13:58:34.114: E/AndroidRuntime(2498): FATAL EXCEPTION: main
02-18 13:58:34.114: E/AndroidRuntime(2498): java.lang.StackOverflowError
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.access$10(DynamicGridView.java:544)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.isScrollCompleted(DynamicGridView.java:1102)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.onScrollStateChanged(DynamicGridView.java:1085)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3693)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:3821)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.smoothScrollBy(AbsListView.java:4409)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:562)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:545)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.access$10(DynamicGridView.java:544)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.isScrollCompleted(DynamicGridView.java:1102)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.onScrollStateChanged(DynamicGridView.java:1085)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3693)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:3821)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.smoothScrollBy(AbsListView.java:4409)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:562)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:545)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.access$10(DynamicGridView.java:544)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.isScrollCompleted(DynamicGridView.java:1102)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.onScrollStateChanged(DynamicGridView.java:1085)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3693)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:3821)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.smoothScrollBy(AbsListView.java:4409)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:562)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:545)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.access$10(DynamicGridView.java:544)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.isScrollCompleted(DynamicGridView.java:1102)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.onScrollStateChanged(DynamicGridView.java:1085)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3693)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:3821)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.smoothScrollBy(AbsListView.java:4409)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:562)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:545)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.access$10(DynamicGridView.java:544)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.isScrollCompleted(DynamicGridView.java:1102)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.onScrollStateChanged(DynamicGridView.java:1085)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.reportScrollStateChange(AbsListView.java:3693)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:3821)
02-18 13:58:34.114: E/AndroidRuntime(2498): at android.widget.AbsListView.smoothScrollBy(AbsListView.java:4409)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:562)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.handleMobileCellScroll(DynamicGridView.java:545)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView.access$10(DynamicGridView.java:544)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.isScrollCompleted(DynamicGridView.java:1102)
02-18 13:58:34.114: E/AndroidRuntime(2498): at org.askerov.dynamicgrid..DynamicGridView$2.onScrollStateChanged(DynamicGridView.java:1085)
Well, your library is now being used in production in a live app! Thanks a lot for the help you've provided so far. I wanted to ask about scrolling when in Edit mode. Right now when you place your finger to scroll, the touch is being stolen by the items on the screen and they instantly start moving.
If I could set the listener on the items for onItemLongClickListener, then it would have to take a long click to make them move, therefore allowing for natural scroll. I was not able to figure it out so far, help would be appreciated again, thanks a lot
Could you give a hint how this can be done with your code, or perhaps there other alternatives. Much appreciated.
I used Dynamic grid library
but onDragPositsionCHanged library not getting called and the positions are not changing the.
I can drag and onDragStarted is also working.
But when i drop item moves to first location and then back to its original position. no changes literally.
MyAdapter Class.
public class DynamicDrawerAdapter extends BaseDynamicGridAdapter {
Context mContext;
Pac[] pacsForAdapter;
String mSource;
public DynamicDrawerAdapter(Context context,Pac[] pacs, int columnCount) {
super(context,columnCount);
pacsForAdapter = pacs;
mContext = context;
mSource = "mini";
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return pacsForAdapter.length;
}
@Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return null;
}
static class ViewHolder{
TextView text;
ImageView icon;
}
@Override
public View getView(int pos, View convertView, ViewGroup arg2) {
// TODO Auto-generated method stub
ViewHolder viewHolder;
LayoutInflater layoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (convertView == null){
convertView = layoutInflater.inflate(R.layout.drawer_item, null);
viewHolder = new ViewHolder();
viewHolder.text = (TextView)convertView.findViewById(R.id.icon_text);
viewHolder.icon = (ImageView)convertView.findViewById(R.id.icon_image);
convertView.setTag(viewHolder);
}else{
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.icon.setImageDrawable(pacsForAdapter[pos].icon);
if (mSource.equals("mini")){
viewHolder.text.setVisibility(View.GONE);
}else {
viewHolder.text.setText(pacsForAdapter[pos].label);
}
return convertView;
}
}
Dragging an element in a direct horizontal line with another is not possible.
The element starts dragging but in the moment the horizontal drag starts it jumps back into position.
Dragging is possible in every direction but a direct horizontal line
On Android 4.0.4 phone (Kyocera), if I long click to start drag mode, and I carefully select the icon to drag, things work ok.
However, If I long click to start drag mode, then tap between the icon selected on long click and the one below it in the grid view, then both icons are dragged when I move my finger. On drop, the table does not redraw properly (there is a missing icon usually).
Hi Can you please include an example of AbstractDynamicGridAdapter... I've already implemented it but I don't know how to swap an item. I hope you can make a simple example Thanks.
I have encounter an more exception here
I run on android 2.3.3 emulator
10-23 10:14:18.403: E/AndroidRuntime(2478): FATAL EXCEPTION: main
10-23 10:14:18.403: E/AndroidRuntime(2478): java.lang.NullPointerException
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.widget.AdapterView.getPositionForView(AdapterView.java:581)
10-23 10:14:18.403: E/AndroidRuntime(2478): at org.askerov.dynamicgid.DynamicGridView.handleCellSwitch(DynamicGridView.java:704)
10-23 10:14:18.403: E/AndroidRuntime(2478): at org.askerov.dynamicgid.DynamicGridView.onTouchEvent(DynamicGridView.java:457)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.View.dispatchTouchEvent(View.java:3885)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)
10-23 10:14:18.403: E/AndroidRuntime(2478): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
10-23 10:14:18.403: E/AndroidRuntime(2478): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
10-23 10:14:18.403: E/AndroidRuntime(2478): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.os.Handler.dispatchMessage(Handler.java:99)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.os.Looper.loop(Looper.java:123)
10-23 10:14:18.403: E/AndroidRuntime(2478): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-23 10:14:18.403: E/AndroidRuntime(2478): at java.lang.reflect.Method.invokeNative(Native Method)
10-23 10:14:18.403: E/AndroidRuntime(2478): at java.lang.reflect.Method.invoke(Method.java:507)
10-23 10:14:18.403: E/AndroidRuntime(2478): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-23 10:14:18.403: E/AndroidRuntime(2478): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-23 10:14:18.403: E/AndroidRuntime(2478): at dalvik.system.NativeStart.main(Native Method)
I am dragging item to bottom of GridView and it crashes
so we can include as normal gradle dependency
Hi
Would be great to have a GitHub release of DynamicGrid https://github.com/askerov/DynamicGrid/releases
Then it would be a bit easier to install it as a Gradle dependency:
https://jitpack.io/#askerov/DynamicGrid/e3072b7c26
Right now using the commit id as the version e3072b7
Hi there!
im trying to make this project to run but i get errors that i dont know how to solve.
in line 474, inside the method "animateBounds":
----------TypeEvaluator sBoundEvaluator = new TypeEvaluator()
i get this error:
----------TypeEvaluator is not generic; it cannot be parameterized with arguments
I have checked the Build Path and the Java Compiler. Compiler is 1.6, using API 11 as suggested, but in "Configure Build Path" -> "Order and Export", i have this
------dynamicgrid/src
------dynamicgrid/gen
------Android 3.0
------Android Private Libraries
------Android Dependencies
both Android Private Libraries & Dependencies are checked. both dynamicgrid/src and dynamicgrid/gen cannot be checked nor unchecked...
i'm a little bit lost, could anyone help please?
Also I have tried changing the troubling line of code with this:
----------TypeEvaluator sBoundEvaluator = new TypeEvaluator()
but i get this error
----------Unable to execute dex: java.nio.BufferOverflowException.
thanks in advance!
If in example apk I drag element to last position sometimes it disappears.
First of all, thanks for the hard effort. It is a nice lib to use. And I want to provide some potential performance improvement.
I tested this lib on galaxy tab3 10.0. It is a bit laggy when cell swapping. I checked and found out that DynamicGridView calls handleCellSwitch and it calls reorderItem() when cells swap. Look deeper, I found reorderItem()->notifyDataSetChanged() in BaseDynamicGridAdapter is the reason. The notifyDataSetChanged() will make the gridview lag. So I suggest to move the notifyDataSetChanged() in onDrop Listener.
I fail to find any differences betweenstartEditMode()
and startEditMode(int)
.
STR: in the example comment out gridView.setOnDragListener call in GridActivity. Now when long clicking on an item the dragging doesn't start immediately. Add gridView.setOnDragListener back (even with empty onDragStarted and onDragPositionsChanged) - and the dragging will start immediately after long click.
On Android 4.04 phone (Kyocera), hooked up long click listener to enter edit mode with the tapped position. All icons wobble except for tapped one. I can then drag icon to new location. The drag started and drag pos changed events get fired, followed by the onActionDrop when I place the icon in new location. This works ok.
On Android 4.42 tablet (Samsung), same code does not work. The onlongclick starts edit mode, but as soon as you remove your finger from icon that you long tapped on, the onActionDrop function gets called. When this happens, stop wobble does not stop the wobble animation (although this may be a bug in my code that implements it?)
Can not drag item to wanted position....
How to save the order once drag and drop changes are made and then stopeditmode is called
I have created a LinearLayout with a Google AdView and the DynamicGridView component ; when I drag'n drop the items to reorder them, there are graphical glitches on the cells of the component.
My Layout is :
<TextView
android:id="@+id/bookmarks_section_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title_bookmarks"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="5dp"
/>
<com.google.android.gms.ads.AdView
android:id="@+id/bookmarks_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
ads:adUnitId="ca-app-pub-6751412219279178/6522926048"
ads:adSize="BANNER"/>
<org.askerov.dynamicgrid.DynamicGridView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:id="@+id/bookmarks_gridview"
android:numColumns="2"
/>
Hi,
I would like to know how to change icon animation (rotation speed / angle) in EditMode. I would like also to have a more fluid animation.
How to do that ?
Thanks.
Please see the Crash Trash. I believe, when adapter.notfydatasetchanged is called and that time when we try to Drag and Down, It causes Crash. As i would like to refresh my views by a asynchronous Task and also allow Dragging and Dropping of items.
03-02 11:48:23.404: E/AndroidRuntime(21485): java.lang.NullPointerException
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.widget.AdapterView.getPositionForView(AdapterView.java:665)
03-02 11:48:23.404: E/AndroidRuntime(21485): at org.askerov.dynamicgrid.DynamicGridView.getColumnAndRowForView(LibraryGridView.java:935)
03-02 11:48:23.404: E/AndroidRuntime(21485): at org.askerov.dynamicgrid.DynamicGridView.handleCellSwitch(LibraryGridView.java:721)
03-02 11:48:23.404: E/AndroidRuntime(21485): at org.askerov.dynamicgrid.DynamicGridView.onTouchEvent(LibraryGridView.java:478)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.View.dispatchTouchEvent(View.java:8135)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2141)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2423)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2156)
03-02 11:48:23.404: E/AndroidRuntime(21485): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2295)
03-02 11:48:23.404: E/AndroidRuntime(21485): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1622)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.app.Activity.dispatchTouchEvent(Activity.java:2565)
03-02 11:48:23.404: E/AndroidRuntime(21485): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2243)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.View.dispatchPointerEvent(View.java:8343)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4743)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4609)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4167)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4221)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4190)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4301)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4198)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4358)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4167)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4221)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4190)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4198)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4167)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6517)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6434)
03-02 11:48:23.404: E/AndroidRuntime(21485): at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6405
First of all, great and awesome library. Many many THANKS for it. I have implemented your library and it works fine,but when I use it with custom Objects , it won't work as desired i.e. views are overlapped . The reason of it seems to be due to stableId
. I have checked this issue https://github.com/askerov/DynamicGrid/issues/25
which seems similar to mine.But, could you just hint me on how to make your awesome library work smoothly for complex object. I have an ArrayList
of ImageInfo
Object. The library works as desired when I remove extends BaseNode
one.
public class ImageInfo extends BaseNode implements Serializable {
public String imageUri;
public int rotation;
}
public class BaseNode implements Parcelable {
public static final String _ID = "_id";
public static final String ID = "mId";
@DatabaseField(generatedId = true)
int _id;
@DatabaseField(columnName = "mId")
@SerializedName("id")
String mId;
public BaseNode() {
}
public String getId() {
return mId;
}
public void setId(String mId) {
this.mId = mId;
}
public int getDatabaseId() {
return _id;
}
public void setDatabaseId(int _id) {
this._id = _id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || ((Object) this).getClass() != o.getClass()) return false;
BaseNode baseNode = (BaseNode) o;
if (mId != null ? !mId.equals(baseNode.mId) : baseNode.mId != null) return false;
return true;
}
@Override
public int hashCode() {
return mId != null ? mId.hashCode() : 0;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mId);
dest.writeInt(_id);
}
protected BaseNode(Parcel in) {
mId = in.readString();
_id = in.readInt();
}
}
P.S. Though this is not an issue, I am trying to implement alpha
method while making drag and drop like
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void startWobbleAnimation() {
for (int i = 0; i < getChildCount(); i++) {
View v = getChildAt(i);
if (v != null && Boolean.TRUE != v.getTag(R.id.dgv_wobble_tag)) {
if (i % 2 == 0)
animateWobble(v);
else
animateWobbleInverse(v);
v.setTag(R.id.dgv_wobble_tag, true);
v.setAlpha(0.65f);
}
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void stopWobble(boolean resetRotation) {
for (Animator wobbleAnimator : mWobbleAnimators) {
wobbleAnimator.cancel();
}
mWobbleAnimators.clear();
for (int i = 0; i < getChildCount(); i++) {
View v = getChildAt(i);
if (v != null) {
if (resetRotation) v.setRotation(0);
v.setTag(R.id.dgv_wobble_tag, false);
v.setAlpha(1);
}
}
}
It works but when I begin to drag and scroll the view some items get alpha
effect whereas some doesn't . Is there anything I am missing.
Lastly, thanks a million for this awesome library ;)
In Latest commit example project at Android L device, only first item reordering cause sporadic item disappearance.
And in our project, long click on first item doesn't make selectedView(first item) invisible at startDragAtPosition(int position) method.
I think these two incidents related.
But I can't debug it.
Any idea?
Hi,
I love DynamicGridView, It works like charm. But there is one issue, It doesn't work if we implement it in ViewPager. Is there a way I could use this code in ViewPager? Waiting for your fruitful response.
Thank you
Hi,
Can you provide the functionality of zooming in the grid item by say 125% or any percent which the developer can set to the item which is getting dragged. As normally the items which are getting dragged normally gets resized when they are dragged.
Thanks...
I had a strange issue.
My custom adapter not working but the CheeseDynamicAdapter in sample.
I found the difference is items array.
My custom adapter is not working with ArrayList of custom objects, and works with the sample array of Cheeses.
I only changed the second param - items in the following function.
gridView.setAdapter(new UserPhotosAdapter(getActivity(), items, 3));
Hi,
I don't know why but whenever i try calling notifydatasetchanged() method, it causes the gridview to crash.. Following is crash report::
java.lang.NullPointerException
at org.askerov.dynamicgrid.AbstractDynamicGridAdapter.getItemId(AbstractDynamicGridAdapter.java:68)
at android.widget.AbsListView.obtainView(AbsListView.java:2752)
at android.widget.GridView.onMeasure(GridView.java:1065)
at android.view.View.measure(View.java:17478)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
at android.view.View.measure(View.java:17478)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:17478)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:17478)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1052)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:590)
at android.view.View.measure(View.java:17478)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:719)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:455)
at android.view.View.measure(View.java:17478)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at android.view.View.measure(View.java:17478)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:412)
at android.view.View.measure(View.java:17478)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5363)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2548)
at android.view.View.measure(View.java:17478)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2285)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1396)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1595)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6630)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
at android.view.Choreographer.doCallbacks(Choreographer.java:603)
at android.view.Choreographer.doFrame(Choreographer.java:573)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5479)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
But if instead of mGridAdapter.notifyDatasetChanged(), if i call mGridAdapter.set(ArrayList items), it work great.. But to my mind, notifyDatasetChanged() should also work.. It should not make the system to crash.. Correct?
I call notifydatasetChanged() whenever there is any change in any item.
Am i doing anything wrong or missing anything?
Thank you,
Mahavir
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.