Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "add podcast" FAB still visible under SpeedDial main FAB #6950

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ public class SubscriptionFragment extends Fragment
private Disposable disposable;
private SharedPreferences prefs;

private FloatingActionButton subscriptionAddButton;

private SpeedDialView speedDialView;

private List<NavDrawerData.DrawerItem> listItems;
Expand Down Expand Up @@ -155,7 +157,7 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMen
progressBar = root.findViewById(R.id.progressBar);
progressBar.setVisibility(View.VISIBLE);

FloatingActionButton subscriptionAddButton = root.findViewById(R.id.subscriptions_add);
subscriptionAddButton = root.findViewById(R.id.subscriptions_add);
subscriptionAddButton.setOnClickListener(view -> {
if (getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).loadChildFragment(new AddFeedFragment());
Expand All @@ -173,16 +175,6 @@ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMen
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
public boolean onMainActionSelected() {
return false;
}

@Override
public void onToggleChanged(boolean isOpen) {
}
});
speedDialView.setOnActionSelectedListener(actionItem -> {
new FeedMultiSelectActionHandler((MainActivity) getActivity(), subscriptionAdapter.getSelectedItems())
.handleAction(actionItem.getId());
Expand Down Expand Up @@ -336,7 +328,6 @@ public boolean onContextItemSelected(MenuItem item) {

Feed feed = ((NavDrawerData.FeedDrawerItem) drawerItem).feed;
if (itemId == R.id.multi_select) {
speedDialView.setVisibility(View.VISIBLE);
return subscriptionAdapter.onContextItemSelected(item);
}
return FeedMenuHandler.onMenuItemClicked(this, item.getItemId(), feed, this::loadSubscriptions);
Expand All @@ -356,6 +347,7 @@ public void onUnreadItemsChanged(UnreadItemsUpdateEvent event) {
public void onEndSelectMode() {
speedDialView.close();
speedDialView.setVisibility(View.GONE);
subscriptionAddButton.setVisibility(View.VISIBLE);
subscriptionAdapter.setItems(listItems);
}

Expand All @@ -368,5 +360,7 @@ public void onStartSelectMode() {
}
}
subscriptionAdapter.setItems(feedsOnly);
speedDialView.setVisibility(View.VISIBLE);
subscriptionAddButton.setVisibility(View.GONE);
}
}