From b05d877954e8f0c4eaa7e102b0cb20de7511aa8e Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Tue, 9 Mar 2021 17:55:57 +0100 Subject: [PATCH] Fixed animation when hiding drawer items --- .../java/de/danoeh/antennapod/adapter/NavListAdapter.java | 4 +++- .../java/de/danoeh/antennapod/core/storage/NavDrawerData.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index de3242b1a..86bba0d50 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -159,8 +159,10 @@ public class NavListAdapter extends RecyclerView.Adapter 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; } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java b/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java index 0a56330a9..e4d1996ad 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java @@ -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; }