aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-10-29 17:17:04 -0700
committerScott Jackson <daneren2005@gmail.com>2015-10-29 17:17:04 -0700
commit60176f016fc8814ea2f57f6bacc14c8e1cc31c76 (patch)
tree6e01e3f1e18dbfc4bc19a18dfd8d18136fc7108e /app/src/main/java
parent58525b52f982c1d6ec597cf39ecd0fcdcabfe023 (diff)
downloaddsub-60176f016fc8814ea2f57f6bacc14c8e1cc31c76.tar.gz
dsub-60176f016fc8814ea2f57f6bacc14c8e1cc31c76.tar.bz2
dsub-60176f016fc8814ea2f57f6bacc14c8e1cc31c76.zip
Make recent podcasts multi-selectable
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java18
-rw-r--r--app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java10
2 files changed, 24 insertions, 4 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java
index 6d995d56..875a4800 100644
--- a/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java
+++ b/app/src/main/java/github/daneren2005/dsub/adapter/PodcastChannelAdapter.java
@@ -15,12 +15,17 @@
package github.daneren2005.dsub.adapter;
import android.content.Context;
+import android.view.Menu;
+import android.view.MenuInflater;
import android.view.ViewGroup;
+import github.daneren2005.dsub.R;
import github.daneren2005.dsub.domain.MusicDirectory;
import github.daneren2005.dsub.domain.PodcastChannel;
import github.daneren2005.dsub.domain.PodcastEpisode;
import github.daneren2005.dsub.util.ImageLoader;
+import github.daneren2005.dsub.util.Util;
+import github.daneren2005.dsub.view.BasicHeaderView;
import github.daneren2005.dsub.view.FastScroller;
import github.daneren2005.dsub.view.PodcastChannelView;
import github.daneren2005.dsub.view.SongView;
@@ -49,6 +54,7 @@ public class PodcastChannelAdapter extends SectionAdapter<Serializable> implemen
this.imageLoader = imageLoader;
this.onItemClickedListener = listener;
this.largeCell = largeCell;
+ checkable = true;
}
@Override
@@ -100,4 +106,16 @@ public class PodcastChannelAdapter extends SectionAdapter<Serializable> implemen
return null;
}
}
+
+ @Override
+ public void onCreateActionModeMenu(Menu menu, MenuInflater menuInflater) {
+ if(Util.isOffline(context)) {
+ menuInflater.inflate(R.menu.multiselect_media_offline, menu);
+ } else {
+ menuInflater.inflate(R.menu.multiselect_media, menu);
+ }
+
+ menu.removeItem(R.id.menu_remove_playlist);
+ menu.removeItem(R.id.menu_unstar);
+ }
}
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java
index c2f3c804..95bef065 100644
--- a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java
+++ b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java
@@ -159,10 +159,12 @@ public abstract class SectionAdapter<T> extends RecyclerView.Adapter<UpdateViewH
updateView.getChildAt(0).setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
- if(currentActionMode == null) {
- startActionMode(holder);
- } else {
- updateView.getChildAt(0).performClick();
+ if(updateView.isCheckable()) {
+ if (currentActionMode == null) {
+ startActionMode(holder);
+ } else {
+ updateView.getChildAt(0).performClick();
+ }
}
return true;
}