aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
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;
}