Fixed animation when hiding drawer items

This commit is contained in:
ByteHamster 2021-03-09 17:55:57 +01:00
parent 0d1241be66
commit b05d877954
2 changed files with 5 additions and 2 deletions

View File

@ -159,8 +159,10 @@ public class NavListAdapter extends RecyclerView.Adapter<NavListAdapter.Holder>
int viewType = getItemViewType(position);
if (viewType == VIEW_TYPE_SUBSCRIPTION) {
return itemAccess.getItem(position - getSubscriptionOffset()).id;
} else if (viewType == VIEW_TYPE_NAV) {
return -Math.abs(fragmentTags.get(position).hashCode()) - 1; // Folder IDs are >0
} else {
return -position - 1; // IDs are >0
return 0;
}
}

View File

@ -61,7 +61,8 @@ public class NavDrawerData {
public boolean isOpen;
public FolderDrawerItem(String name) {
super(DrawerItem.Type.FOLDER, (long) name.hashCode() << 20); // Keep IDs >0 but make room for many feeds
// Keep IDs >0 but make room for many feeds
super(DrawerItem.Type.FOLDER, (long) Math.abs(name.hashCode()) << 20);
this.name = name;
}