From 6e2fc490b0fac6b1817955aec688949481148407 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Thu, 11 Feb 2016 17:39:47 -0800 Subject: Fixes #642: fix First Level Artist interefering with Show Artist/Album --- .../daneren2005/dsub/activity/SubsonicFragmentActivity.java | 3 +++ .../daneren2005/dsub/fragments/SelectArtistFragment.java | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'app/src/main') 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 9e18b47a..3bcd0864 100644 --- a/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java +++ b/app/src/main/java/github/daneren2005/dsub/activity/SubsonicFragmentActivity.java @@ -154,7 +154,10 @@ public class SubsonicFragmentActivity extends SubsonicActivity implements Downlo if(item != null) { item.setChecked(true); } + } else { + lastSelectedPosition = getDrawerItemId(fragmentType); } + currentFragment = getNewFragment(fragmentType); if(getIntent().hasExtra(Constants.INTENT_EXTRA_NAME_ID)) { Bundle currentArguments = currentFragment.getArguments(); diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java index 55351fb4..6890f572 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java @@ -63,12 +63,14 @@ public class SelectArtistFragment extends SelectRecyclerFragment impleme public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) { Bundle args = getArguments(); if(args != null) { - groupId = args.getString(Constants.INTENT_EXTRA_NAME_ID); - groupName = args.getString(Constants.INTENT_EXTRA_NAME_NAME); + if(args.getBoolean(Constants.INTENT_EXTRA_NAME_ARTIST, false)) { + groupId = args.getString(Constants.INTENT_EXTRA_NAME_ID); + groupName = args.getString(Constants.INTENT_EXTRA_NAME_NAME); - if(groupName != null) { - setTitle(groupName); - context.invalidateOptionsMenu(); + if (groupName != null) { + setTitle(groupName); + context.invalidateOptionsMenu(); + } } } @@ -111,6 +113,7 @@ public class SelectArtistFragment extends SelectRecyclerFragment impleme Bundle args = new Bundle(); args.putString(Constants.INTENT_EXTRA_NAME_ID, artist.getId()); args.putString(Constants.INTENT_EXTRA_NAME_NAME, artist.getName()); + args.putBoolean(Constants.INTENT_EXTRA_NAME_ARTIST, true); if(ServerInfo.checkServerVersion(context, "1.13") && !Util.isOffline(context)) { args.putSerializable(Constants.INTENT_EXTRA_NAME_DIRECTORY, new MusicDirectory.Entry(artist)); } -- cgit v1.2.3