diff options
4 files changed, 17 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java index f2339165..92ecf930 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -602,6 +602,9 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte } protected void drawerItemSelected(String fragmentType) { + if(currentFragment != null) { + currentFragment.stopActionMode(); + } startFragmentActivity(fragmentType); } diff --git a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java index d0e6d348..778c4982 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -227,6 +227,8 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo @Override public void onPanelExpanded(View panel) { + currentFragment.stopActionMode(); + // Disable custom view before switching getSupportActionBar().setDisplayShowCustomEnabled(false); 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 75f4a053..2dbdf1f1 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java @@ -449,6 +449,11 @@ public abstract class SectionAdapter<T> extends RecyclerView.Adapter<UpdateViewH }); } } + public void stopActionMode() { + if(currentActionMode != null) { + currentActionMode.finish(); + } + } public interface OnItemClickedListener<T> { void onItemClicked(T item); diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java index 8dcac6ff..ddc39235 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -1724,7 +1724,13 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR }.execute(); } - protected SectionAdapter<Entry> getCurrentAdapter() { return null; } + protected SectionAdapter getCurrentAdapter() { return null; } + public void stopActionMode() { + SectionAdapter adapter = getCurrentAdapter(); + if(adapter != null) { + adapter.stopActionMode(); + } + } protected void clearSelected() { if(getCurrentAdapter() != null) { getCurrentAdapter().clearSelected(); |