-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The item list is not properly invalidated when an item is added after the drawer has been built #1041
Comments
@waninkoko hi Sorry I can't reproduce this issue. When i add an item it is added without any issues. In general such issues appear when you change items inside an |
I can confirm that the item is being added from the UI thread. And something I forgot to say before. The drawer I'm using is just a normal drawer with a custom drawer header view. |
@waninkoko what I tried to reproduce this.
It properly animates and adds the item without touching the view. I tried this on my Nexus 6P and on a Emulator |
@mikepenz I've been trying since yesterday to fix this issue with no luck. Right now I have a very simple drawer implemented and the issue still happens. This is my current code: DrawerBuilder builder = new DrawerBuilder();
builder.withActivity(this);
builder.withSavedInstance(savedInstanceState);
builder.withToolbar(getToolbar());
builder.withOnDrawerItemClickListener(this);
builder.addDrawerItems(...); // here I add a simple PrimaryDrawerItem
return builder.build(); And this is the code that adds the new item (runs on the UI thread, with a delay of 5 seconds to see how it gets added): private Handler mHandler = new Handler();
mHandler.postDelayed(new Runnable() {
mDrawer.addItem(...); // another simple PrimaryDrawerItem
}), 5000; |
Hi,
I'm having an issue (that is not happening in 4.6.4) when adding a new item, using
addItem()
, after the drawer has been built. The item list is not properly invalidated and the views are not updated until I start clicking on the items.Calling
drawer.getAdapter().notifyDataSetChanged()
after adding the item fixes the problem but, obviously, it is not a proper fix.drawer.getItemAdapter().notifyDataSetChanged()
does NOT fix the problem.The text was updated successfully, but these errors were encountered: