diff options
author | ByteHamster <info@bytehamster.com> | 2021-03-09 17:55:57 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2021-03-09 17:55:57 +0100 |
commit | b05d877954e8f0c4eaa7e102b0cb20de7511aa8e (patch) | |
tree | 9e13351e950e0b75feb2c628a5dd28cb7a167f0a | |
parent | 0d1241be66725f80e594ed21fd45d40e37ee3afe (diff) | |
download | AntennaPod-b05d877954e8f0c4eaa7e102b0cb20de7511aa8e.zip |
Fixed animation when hiding drawer items
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java | 4 | ||||
-rw-r--r-- | core/src/main/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<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; } } 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; } |