diff options
author | orionlee <orionlee@yahoo.com> | 2019-10-17 11:44:00 -0700 |
---|---|---|
committer | orionlee <orionlee@yahoo.com> | 2019-10-20 15:21:46 -0700 |
commit | 1620d2954982195d2033444e227214dbcd90a245 (patch) | |
tree | c1762708e3a3e518afb17c52e6092ecdba995f92 /app/src/main/java/de/danoeh/antennapod/menuhandler | |
parent | f1f91478b6057dbaaaa5255d14dfe254bdc10f1d (diff) | |
download | AntennaPod-1620d2954982195d2033444e227214dbcd90a245.zip |
Sort in Podcast screen - UI
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/menuhandler')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java index f7aae8cde..5e0d65d0c 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java @@ -7,6 +7,8 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; +import androidx.annotation.NonNull; + import org.apache.commons.lang3.StringUtils; import java.util.Set; @@ -14,12 +16,14 @@ import java.util.Set; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.dialog.ConfirmationDialog; import de.danoeh.antennapod.core.feed.Feed; +import de.danoeh.antennapod.core.feed.IntraFeedSortOrder; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DownloadRequestException; import de.danoeh.antennapod.core.util.IntentUtils; import de.danoeh.antennapod.core.util.ShareUtils; import de.danoeh.antennapod.dialog.FilterDialog; +import de.danoeh.antennapod.dialog.IntraFeedSortDialog; /** * Handles interactions with the FeedItemMenu. @@ -65,6 +69,9 @@ public class FeedMenuHandler { case R.id.refresh_complete_item: DBTasks.forceRefreshCompleteFeed(context, selectedFeed); break; + case R.id.sort_items: + showSortDialog(context, selectedFeed); + break; case R.id.filter_items: showFilterDialog(context, selectedFeed); break; @@ -108,4 +115,17 @@ public class FeedMenuHandler { filterDialog.openDialog(); } + + + private static void showSortDialog(Context context, Feed selectedFeed) { + IntraFeedSortDialog sortDialog = new IntraFeedSortDialog(context, selectedFeed.getSortOrder()) { + @Override + protected void updateSort(@NonNull IntraFeedSortOrder sortOrder) { + selectedFeed.setSortOrder(sortOrder); + // TODO-2524: update in db + } + }; + sortDialog.openDialog(); + } + } |