From 11a7d67f9772482a770378162ef74c94272e43f9 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 3 Oct 2021 15:49:21 +0200 Subject: [PATCH] Fix FAB overlay sometimes not showing We use the same ID for each overlay layout. The speed dial searches everywhere, even in invisible fragments, so it sometimes shows/hides the wrong overlay layout. --- .../danoeh/antennapod/fragment/CompletedDownloadsFragment.java | 1 + .../java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java | 1 + .../main/java/de/danoeh/antennapod/fragment/QueueFragment.java | 1 + .../java/de/danoeh/antennapod/fragment/SubscriptionFragment.java | 1 + 4 files changed, 4 insertions(+) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java index 4b3988422..6c8baef29 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java @@ -84,6 +84,7 @@ public class CompletedDownloadsFragment extends Fragment implements progressBar = root.findViewById(R.id.progLoading); speedDialView = root.findViewById(R.id.fabSD); + speedDialView.setOverlayLayout(root.findViewById(R.id.fabSDOverlay)); speedDialView.inflate(R.menu.episodes_apply_action_speeddial); speedDialView.removeActionItemById(R.id.download_batch); speedDialView.removeActionItemById(R.id.mark_read_batch); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index fb3b8d136..0ee60866d 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -238,6 +238,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem // Init action UI (via a FAB Speed Dial) speedDialView = root.findViewById(R.id.fabSD); + speedDialView.setOverlayLayout(root.findViewById(R.id.fabSDOverlay)); speedDialView.inflate(R.menu.episodes_apply_action_speeddial); speedDialView.setOnChangeListener(new SpeedDialView.OnChangeListener() { @Override diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index c4bef220e..1b7d236c6 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -465,6 +465,7 @@ public class QueueFragment extends Fragment implements Toolbar.OnMenuItemClickLi progLoading.setVisibility(View.VISIBLE); speedDialView = root.findViewById(R.id.fabSD); + speedDialView.setOverlayLayout(root.findViewById(R.id.fabSDOverlay)); speedDialView.inflate(R.menu.episodes_apply_action_speeddial); speedDialView.removeActionItemById(R.id.mark_read_batch); speedDialView.removeActionItemById(R.id.mark_unread_batch); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java index b720f1167..a82667050 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java @@ -167,6 +167,7 @@ public class SubscriptionFragment extends Fragment }); speedDialView = root.findViewById(R.id.fabSD); + speedDialView.setOverlayLayout(root.findViewById(R.id.fabSDOverlay)); speedDialView.inflate(R.menu.nav_feed_action_speeddial); speedDialView.setOnChangeListener(new SpeedDialView.OnChangeListener() { @Override