diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-04-29 22:18:14 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-04-29 22:18:14 -0700 |
commit | ab686aeb2f61987a817b7c41e45c1ee3dad4d5f6 (patch) | |
tree | 3c9ddc3b005bbdb59d86e600b24649015b3f0ece /subsonic-android/src/github | |
parent | a9ed7c936d0e4c065b116d49c3abaff20f900a19 (diff) | |
download | dsub-ab686aeb2f61987a817b7c41e45c1ee3dad4d5f6.tar.gz dsub-ab686aeb2f61987a817b7c41e45c1ee3dad4d5f6.tar.bz2 dsub-ab686aeb2f61987a817b7c41e45c1ee3dad4d5f6.zip |
Fix some of the menus
Diffstat (limited to 'subsonic-android/src/github')
3 files changed, 9 insertions, 14 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java index b38beab4..5e53e71d 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SearchFragment.java @@ -150,7 +150,7 @@ public class SearchFragment extends SubsonicFragment { AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo();
Object selectedItem = list.getItemAtPosition(info.position);
- if(super.onContextItemSelected(menuItem, selectedItem)) {
+ if(onContextItemSelected(menuItem, selectedItem)) {
return true;
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index c4d28995..a12adff3 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -192,10 +192,14 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap @Override
public boolean onContextItemSelected(MenuItem menuItem) {
+ if(!primaryFragment) {
+ return false;
+ }
+
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuItem.getMenuInfo();
- Object selectedItem = entries.get(info.position);
+ Object selectedItem = entries.get(showHeader ? (info.position - 1) : info.position);
- if(super.onContextItemSelected(menuItem, selectedItem)) {
+ if(onContextItemSelected(menuItem, selectedItem)) {
return true;
}
@@ -353,6 +357,7 @@ public class SelectDirectoryFragment extends SubsonicTabFragment implements Adap entryList.addHeaderView(createHeader(entries), null, false);
}
} else {
+ showHeader = false;
hideButtons = true;
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java index 3045d99b..da065501 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java @@ -26,22 +26,12 @@ public class SubsonicTabFragment extends SubsonicFragment { protected boolean primaryFragment = false;
protected boolean invalidated = false;
- @Override
- public boolean onContextItemSelected(MenuItem menuItem, Object selectedItem) {
- if(!primaryFragment) {
- return true;
- }
-
- return super.onContextItemSelected(menuItem, selectedItem);
- }
-
public void replaceFragment(SubsonicTabFragment fragment, int id) {
- this.setPrimaryFragment(false);
- fragment.setPrimaryFragment(true);
context.getPagerAdapter().replaceCurrent(fragment, id);
}
public void setPrimaryFragment(boolean primary) {
+ Log.i(TAG, this.getClass().getName() + ": " + primary);
primaryFragment = primary;
if(primary) {
if(context != null) {
|