Merge pull request #6055 from ByteHamster/swipe-home
Add swipe actions to home screen
This commit is contained in:
commit
6f67d6905a
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue