diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-10-04 18:12:54 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-10-04 18:12:54 -0700 |
commit | 51ffbb23b82287932089881c920203257022eedc (patch) | |
tree | 93e2cb2672e4cf21ba31ea49d5aedc6ecc016e2c | |
parent | af22d2a61630e8c87eee4fe198ded7e2e97f578e (diff) | |
download | dsub-51ffbb23b82287932089881c920203257022eedc.tar.gz dsub-51ffbb23b82287932089881c920203257022eedc.tar.bz2 dsub-51ffbb23b82287932089881c920203257022eedc.zip |
Fix Show All by moving into a separate fragment
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 16 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/util/Constants.java | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 440bbd8a..dce7d004 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -133,6 +133,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter artist = args.getBoolean(Constants.INTENT_EXTRA_NAME_ARTIST, false);
lookupEntry = args.getString(Constants.INTENT_EXTRA_SEARCH_SONG);
topTracks = args.getBoolean(Constants.INTENT_EXTRA_TOP_TRACKS);
+ showAll = args.getBoolean(Constants.INTENT_EXTRA_SHOW_ALL);
String childId = args.getString(Constants.INTENT_EXTRA_NAME_CHILD_ID);
if(childId != null) {
@@ -289,8 +290,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter downloadAllPodcastEpisodes();
return true;
case R.id.menu_show_all:
- showAll = true;
- refresh(true);
+ setShowAll();
return true;
case R.id.menu_unstar:
unstarSelected();
@@ -1178,6 +1178,15 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter replaceFragment(fragment, true);
}
+ private void setShowAll() {
+ SubsonicFragment fragment = new SelectDirectoryFragment();
+ Bundle args = new Bundle(getArguments());
+ args.putBoolean(Constants.INTENT_EXTRA_SHOW_ALL, true);
+ fragment.setArguments(args);
+
+ replaceFragment(fragment, true);
+ }
+
private View createHeader(List<Entry> entries) {
View header = entryList.findViewById(R.id.select_album_header);
boolean add = false;
@@ -1274,6 +1283,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter } else if(topTracks) {
artistView.setText(R.string.menu_top_tracks);
artistView.setVisibility(View.VISIBLE);
+ } else if(showAll) {
+ artistView.setText(R.string.menu_show_all);
+ artistView.setVisibility(View.VISIBLE);
} else if (artists.size() == 1) {
String artistText = artists.iterator().next();
if(years.size() == 1) {
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java index c01df5c1..815c4bb9 100644 --- a/src/github/daneren2005/dsub/util/Constants.java +++ b/src/github/daneren2005/dsub/util/Constants.java @@ -64,6 +64,7 @@ public final class Constants { public static final String INTENT_EXTRA_REFRESH_LISTINGS = "refreshListings"; public static final String INTENT_EXTRA_SEARCH_SONG = "searchSong"; public static final String INTENT_EXTRA_TOP_TRACKS = "topTracks"; + public static final String INTENT_EXTRA_SHOW_ALL = "showAll"; // Preferences keys. public static final String PREFERENCES_KEY_SERVER_KEY = "server"; |