summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2021-03-10 13:16:53 +0100
committerGitHub <noreply@github.com>2021-03-10 13:16:53 +0100
commit57e5784e6f17f591641f43659148cfeb627ccbc5 (patch)
tree9e13351e950e0b75feb2c628a5dd28cb7a167f0a
parent0d1241be66725f80e594ed21fd45d40e37ee3afe (diff)
parentb05d877954e8f0c4eaa7e102b0cb20de7511aa8e (diff)
downloadAntennaPod-57e5784e6f17f591641f43659148cfeb627ccbc5.zip
Merge pull request #5013 from ByteHamster/sidebar-hide-animation-fix
Fixed animation when hiding drawer items
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java4
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/NavDrawerData.java3
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;
}