diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-07-30 19:03:30 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-07-30 19:03:30 -0700 |
commit | 64a01118e3cdbd92af846f413e926559f7d13da4 (patch) | |
tree | 3b73c81486a7c4422469c6981ba5b1ab4d5ef29d /app | |
parent | d1f51a6b805590081990ab54089ae1a116c166b2 (diff) | |
download | dsub-64a01118e3cdbd92af846f413e926559f7d13da4.tar.gz dsub-64a01118e3cdbd92af846f413e926559f7d13da4.tar.bz2 dsub-64a01118e3cdbd92af846f413e926559f7d13da4.zip |
Stop active action mode when switching tabs
Diffstat (limited to 'app')
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(); |