diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-05-30 20:09:41 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-05-30 20:09:41 -0700 |
commit | dccaf6946a6e3bae15a612dcd6186bc19599f720 (patch) | |
tree | 0c31e5dc13c008893eeb10e135cb9bdf5dd2cbea /subsonic-android/src/github/daneren2005 | |
parent | 80e12bf86e2367f2c8a5ac766694dbcbc2531f42 (diff) | |
download | dsub-dccaf6946a6e3bae15a612dcd6186bc19599f720.tar.gz dsub-dccaf6946a6e3bae15a612dcd6186bc19599f720.tar.bz2 dsub-dccaf6946a6e3bae15a612dcd6186bc19599f720.zip |
Made it so that a different tab can be preselected
Diffstat (limited to 'subsonic-android/src/github/daneren2005')
3 files changed, 19 insertions, 9 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 0c8d130a..80f4ffc0 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -416,7 +416,7 @@ public class SubsonicActivity extends SherlockFragmentActivity implements OnItem } else {
frags.set(i, fragStack);
}
- if(currentFragment == null) {
+ if(currentFragment == null || currentPosition == i) {
currentFragment = frag;
currentFragment.setPrimaryFragment(true);
}
@@ -465,13 +465,15 @@ public class SubsonicActivity extends SherlockFragmentActivity implements OnItem if(currentFragment != null) {
currentFragment.setPrimaryFragment(false);
}
- List<SubsonicFragment> fragStack = frags.get(position);
- currentFragment = fragStack.get(fragStack.size() - 1);
- if(currentFragment != null) {
- currentFragment.setPrimaryFragment(true);
+ if(position <= frags.size()) {
+ List<SubsonicFragment> fragStack = frags.get(position);
+ currentFragment = fragStack.get(fragStack.size() - 1);
+ if(currentFragment != null) {
+ currentFragment.setPrimaryFragment(true);
+ }
+ activity.invalidateOptionsMenu();
+ recreateSpinner();
}
- activity.invalidateOptionsMenu();
- recreateSpinner();
}
public void addTab(CharSequence title, Class fragmentClass, Bundle args) {
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java index 8485f342..0a35233e 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java @@ -58,7 +58,11 @@ public class SelectArtistFragment extends SubsonicFragment implements AdapterVie folderButton = folderButtonParent.findViewById(R.id.select_artist_folder);
registerForContextMenu(artistList);
- invalidated = true;
+ if(!primaryFragment) {
+ invalidated = true;
+ } else {
+ refresh(false);
+ }
return rootView;
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java index 1369eef0..aa0ffcf8 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java @@ -51,7 +51,11 @@ public class SelectPlaylistFragment extends SubsonicFragment implements AdapterV emptyTextView = rootView.findViewById(R.id.select_playlist_empty);
list.setOnItemClickListener(this);
registerForContextMenu(list);
- invalidated = true;
+ if(!primaryFragment) {
+ invalidated = true;
+ } else {
+ refresh(false);
+ }
return rootView;
}
|