use of de.danoeh.antennapod.dialog.RenameItemDialog in project AntennaPod by AntennaPod.
the class SubscriptionFragment method onContextItemSelected.
@Override
public boolean onContextItemSelected(MenuItem item) {
NavDrawerData.DrawerItem drawerItem = subscriptionAdapter.getSelectedItem();
if (drawerItem == null) {
return false;
}
int itemId = item.getItemId();
if (drawerItem.type == NavDrawerData.DrawerItem.Type.TAG && itemId == R.id.rename_folder_item) {
new RenameItemDialog(getActivity(), drawerItem).show();
return true;
}
Feed feed = ((NavDrawerData.FeedDrawerItem) drawerItem).feed;
if (itemId == R.id.remove_all_new_flags_item) {
displayConfirmationDialog(R.string.remove_all_new_flags_label, R.string.remove_all_new_flags_confirmation_msg, () -> DBWriter.removeFeedNewFlag(feed.getId()));
return true;
} else if (itemId == R.id.edit_tags) {
TagSettingsDialog.newInstance(Collections.singletonList(feed.getPreferences())).show(getChildFragmentManager(), TagSettingsDialog.TAG);
return true;
} else if (itemId == R.id.rename_item) {
new RenameItemDialog(getActivity(), feed).show();
return true;
} else if (itemId == R.id.remove_feed) {
RemoveFeedDialog.show(getContext(), feed);
return true;
} else if (itemId == R.id.multi_select) {
speedDialView.setVisibility(View.VISIBLE);
return subscriptionAdapter.onContextItemSelected(item);
}
return super.onContextItemSelected(item);
}
use of de.danoeh.antennapod.dialog.RenameItemDialog in project AntennaPod by AntennaPod.
the class FeedItemlistFragment method onMenuItemClick.
@Override
public boolean onMenuItemClick(MenuItem item) {
if (feed == null) {
((MainActivity) getActivity()).showSnackbarAbovePlayer(R.string.please_wait_for_data, Toast.LENGTH_LONG);
return true;
}
boolean feedMenuHandled = FeedMenuHandler.onOptionsItemClicked(getActivity(), item, feed);
if (feedMenuHandled) {
return true;
}
final int itemId = item.getItemId();
if (itemId == R.id.rename_item) {
new RenameItemDialog(getActivity(), feed).show();
return true;
} else if (itemId == R.id.remove_feed) {
((MainActivity) getActivity()).loadFragment(EpisodesFragment.TAG, null);
RemoveFeedDialog.show(getContext(), feed);
return true;
} else if (itemId == R.id.action_search) {
((MainActivity) getActivity()).loadChildFragment(SearchFragment.newInstance(feed.getId(), feed.getTitle()));
return true;
}
return false;
}
use of de.danoeh.antennapod.dialog.RenameItemDialog in project AntennaPod by AntennaPod.
the class NavDrawerFragment method onFeedContextMenuClicked.
private boolean onFeedContextMenuClicked(Feed feed, MenuItem item) {
final int itemId = item.getItemId();
if (itemId == R.id.remove_all_new_flags_item) {
ConfirmationDialog removeAllNewFlagsConfirmationDialog = new ConfirmationDialog(getContext(), R.string.remove_all_new_flags_label, R.string.remove_all_new_flags_confirmation_msg) {
@Override
public void onConfirmButtonPressed(DialogInterface dialog) {
dialog.dismiss();
DBWriter.removeFeedNewFlag(feed.getId());
}
};
removeAllNewFlagsConfirmationDialog.createNewDialog().show();
return true;
} else if (itemId == R.id.edit_tags) {
TagSettingsDialog.newInstance(Collections.singletonList(feed.getPreferences())).show(getChildFragmentManager(), TagSettingsDialog.TAG);
return true;
} else if (itemId == R.id.rename_item) {
new RenameItemDialog(getActivity(), feed).show();
return true;
} else if (itemId == R.id.remove_feed) {
((MainActivity) getActivity()).loadFragment(EpisodesFragment.TAG, null);
RemoveFeedDialog.show(getContext(), feed);
return true;
}
return super.onContextItemSelected(item);
}
Aggregations