use of de.danoeh.antennapod.dialog.SwipeActionsDialog in project AntennaPod by AntennaPod.
the class SwipePreferencesFragment method onCreatePreferences.
// private static final String PREF_SWIPE_INBOX = "prefSwipeInbox";
// private static final String PREF_SWIPE_EPISODES = "prefSwipeEpisodes";
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
addPreferencesFromResource(R.xml.preferences_swipe);
findPreference(PREF_SWIPE_FEED).setOnPreferenceClickListener(preference -> {
new SwipeActionsDialog(requireContext(), FeedItemlistFragment.TAG).show(() -> {
});
return true;
});
findPreference(PREF_SWIPE_QUEUE).setOnPreferenceClickListener(preference -> {
new SwipeActionsDialog(requireContext(), QueueFragment.TAG).show(() -> {
});
return true;
});
}
use of de.danoeh.antennapod.dialog.SwipeActionsDialog in project AntennaPod by AntennaPod.
the class SwipeActions method onSwiped.
@Override
public void onSwiped(@NonNull RecyclerView.ViewHolder viewHolder, int swipeDir) {
if (!actions.hasActions()) {
// open settings dialog if no prefs are set
new SwipeActionsDialog(fragment.requireContext(), tag).show(this::reloadPreference);
return;
}
FeedItem item = ((EpisodeItemViewHolder) viewHolder).getFeedItem();
(swipeDir == ItemTouchHelper.RIGHT ? actions.right : actions.left).performAction(item, fragment, filter);
}
Aggregations