-
Notifications
You must be signed in to change notification settings - Fork 554
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
Duplicate item #96
Comments
I want to make a Item class for all, Then I will put a layout and a bindView to update for each item type as this library |
Wait, you are not adopting his method right? the RV is exactly a view recycler, it means the ViewHolder is not scrapped but it is re-used so there's no findViewById that the app is making again. |
Sorry, I only borrow idea from that library that make a wrapper for Item and only change once when init Adapter. I found that because I fix issue #79 by clear all mItems in animateTo function then readd, call I use the new fix of you for #79 but issue with sticker not occur but endless not work. |
I use:
getExpansionLevel() return 0. |
@mdtuyen, new items are not expanded automatically, not yet, I'm now testing if this feature can be added. Then, what is not working in the endless? |
@mdtuyen, I added the new feature to expand item automatically when are added on load more, but I'm not sure to keep it, since it's something very specific. |
Hi, I apply new feature to my code. And:
|
@mdtuyen, duplicated issue I have now also in my demo App, but please write me the code here. Also don't just write "there is an issue doing this", describe how I can reproduce it, your use case, which function you are calling, eventually enable logs, etc... |
Hi, This is my code: new Builder(mAdapter)
.setAnimationOnScrolling(false)
.setAnimationOnReverseScrolling(false)
.setAutoScrollOnExpand(true)
.setRemoveOrphanHeaders(true)
//.setUnlinkAllItemsOnRemoveHeaders(true)
.setExpandItemsAtStartUp()
.setDisplayHeadersAtStartUp(true)
.setActionModeHelper(SelectableAdapter.MODE_IDLE, null)
.setStickyHeaders(true)
.setSwipeEnabled(true)
.setFastScroller(null)
.setOnDataChangedListender(new OnDataChangedListender() {
@Override
public void onRefresh() {
mAdapter.updateDataSet(DatabaseService.getInstance().getDatabaseList());
}
@Override
public void onLoadMore() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
final List<AbstractFlexibleItem> newItems = new ArrayList<>(2);
//Simulating success/failure
int id = mAdapter.getItemCountOfTypes(R.layout.recycler_expandable_header_item) + 1;
int count = new Random().nextInt(3);
for (int i = 0; i < count; i++) {
HeaderItem expandableHeader = DatabaseService.newExpandableSectionItem(id);
newItems.add(expandableHeader);
id++;
}
//int count = new Random().nextInt(7);
//int totalItemsOfType = mAdapter.getItemCountOfTypes(R.layout.recycler_expandable_item);
//for (int i = 1; i <= count; i++) {
// newItems.add(DatabaseService.newSimpleItem(totalItemsOfType + i, null));
//}
//Callback the Adapter to notify the change
//Items will be added to the end of the list
mAdapter.onLoadMoreComplete(newItems);
String message = (newItems.size() > 0 ?
"Simulated: " + newItems.size() + " new items arrived :-)" :
"Simulated: No more items to load :-(");
Toast.makeText(getContext(), message, Toast.LENGTH_SHORT).show();
}
}, 3000);
}
})
.initData(DatabaseService.getInstance().createExpandableSectionsDatabase()); Builder class only a wrapper I use to enable each option for the adapter. |
I make a example with Expandable only have two class i tem is ExpandableHeaderItem ad ExpanableItem:
However ExpandableItem have been duplicate.
And I have a question:
I make endless for Expandable item, how to make item expand when it added to recyclerview.
The text was updated successfully, but these errors were encountered: