Merge pull request #6055 from ByteHamster/swipe-home

Add swipe actions to home screen
This commit is contained in:
ByteHamster 2022-09-13 21:50:16 +02:00 committed by GitHub
commit 6f67d6905a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -20,7 +20,9 @@ import de.danoeh.antennapod.event.FeedItemEvent;
import de.danoeh.antennapod.event.PlayerStatusEvent;
import de.danoeh.antennapod.event.playback.PlaybackPositionEvent;
import de.danoeh.antennapod.fragment.CompletedDownloadsFragment;
import de.danoeh.antennapod.fragment.swipeactions.SwipeActions;
import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.model.feed.FeedItemFilter;
import de.danoeh.antennapod.ui.home.HomeSection;
import de.danoeh.antennapod.view.viewholder.EpisodeItemViewHolder;
import io.reactivex.Observable;
@ -57,6 +59,11 @@ public class DownloadsSection extends HomeSection {
};
adapter.setDummyViews(NUM_EPISODES);
viewBinding.recyclerView.setAdapter(adapter);
SwipeActions swipeActions = new SwipeActions(this, CompletedDownloadsFragment.TAG);
swipeActions.attachTo(viewBinding.recyclerView);
swipeActions.setFilter(new FeedItemFilter(FeedItemFilter.DOWNLOADED));
loadItems();
return view;
}

View File

@ -22,7 +22,9 @@ import de.danoeh.antennapod.core.util.FeedItemUtil;
import de.danoeh.antennapod.event.FeedItemEvent;
import de.danoeh.antennapod.event.UnreadItemsUpdateEvent;
import de.danoeh.antennapod.fragment.InboxFragment;
import de.danoeh.antennapod.fragment.swipeactions.SwipeActions;
import de.danoeh.antennapod.model.feed.FeedItem;
import de.danoeh.antennapod.model.feed.FeedItemFilter;
import de.danoeh.antennapod.storage.database.PodDBAdapter;
import de.danoeh.antennapod.ui.home.HomeSection;
import io.reactivex.Observable;
@ -59,6 +61,11 @@ public class InboxSection extends HomeSection {
};
adapter.setDummyViews(NUM_EPISODES);
viewBinding.recyclerView.setAdapter(adapter);
SwipeActions swipeActions = new SwipeActions(this, InboxFragment.TAG);
swipeActions.attachTo(viewBinding.recyclerView);
swipeActions.setFilter(new FeedItemFilter(FeedItemFilter.NEW));
loadItems();
return view;
}