diff options
author | Scott Jackson <daneren2005@gmail.com> | 2013-04-10 19:14:56 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2013-04-10 19:14:56 -0700 |
commit | e6fa8b0d0c201c8c788f9f0c9d8ecea71948bafd (patch) | |
tree | fd3539f33ebedd09526deb3c2ffa76ab9a0fd455 | |
parent | 076dd2ca25d8d7a5f7a741a57ad66230937f0de2 (diff) | |
download | dsub-e6fa8b0d0c201c8c788f9f0c9d8ecea71948bafd.tar.gz dsub-e6fa8b0d0c201c8c788f9f0c9d8ecea71948bafd.tar.bz2 dsub-e6fa8b0d0c201c8c788f9f0c9d8ecea71948bafd.zip |
Smoother menu transition
5 files changed, 19 insertions, 6 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/MainFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/MainFragment.java index 3ebc09aa..e9134257 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/MainFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/MainFragment.java @@ -65,7 +65,7 @@ public class MainFragment extends LibraryFunctionsFragment { }
@Override
- public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
+ public void onSupportCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
menuInflater.inflate(R.menu.main, menu);
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java index 5cb5c454..cf53862b 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java @@ -63,7 +63,7 @@ public class SelectArtistFragment extends LibraryFunctionsFragment implements Ad }
@Override
- public void onCreateOptionsMenu(Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
+ public void onSupportCreateOptionsMenu(Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
menuInflater.inflate(R.menu.select_artist, menu);
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index c4e9c625..ea730db7 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -108,7 +108,7 @@ public class SelectDirectoryFragment extends LibraryFunctionsFragment implements }
@Override
- public void onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
+ public void onSupportCreateOptionsMenu(com.actionbarsherlock.view.Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
if(licenseValid == null) {
menuInflater.inflate(R.menu.empty, menu);
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java index 49bff0fe..67e26b9a 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java @@ -57,7 +57,7 @@ public class SelectPlaylistFragment extends LibraryFunctionsFragment implements }
@Override
- public void onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
+ public void onSupportCreateOptionsMenu(com.actionbarsherlock.view.Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
menuInflater.inflate(R.menu.select_playlist, menu);
}
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java index 88696d00..f3e283e0 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicTabFragment.java @@ -26,6 +26,7 @@ import android.util.Log; import android.view.View;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockFragment;
+import com.actionbarsherlock.view.Menu;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.activity.SubsonicActivity;
import github.daneren2005.dsub.activity.SubsonicTabActivity;
@@ -38,10 +39,12 @@ public class SubsonicTabFragment extends SherlockFragment { protected SubsonicActivity context;
protected CharSequence title = "DSub";
protected View rootView;
+ private boolean primaryFragment = false;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
+ setHasOptionsMenu(true);
}
@Override
@@ -59,6 +62,16 @@ public class SubsonicTabFragment extends SherlockFragment { super.onAttach(activity);
context = (SubsonicActivity)activity;
}
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
+ if(primaryFragment) {
+ onSupportCreateOptionsMenu(menu, menuInflater);
+ }
+ }
+ public void onSupportCreateOptionsMenu(Menu menu, com.actionbarsherlock.view.MenuInflater menuInflater) {
+
+ }
public DownloadService getDownloadService() {
return context != null ? context.getDownloadService() : null;
@@ -96,12 +109,12 @@ public class SubsonicTabFragment extends SherlockFragment { public void setPrimaryFragment(boolean primary) {
if(primary) {
- setHasOptionsMenu(true);
+ primaryFragment = true;
if(context != null) {
context.setTitle(title);
}
} else {
- setHasOptionsMenu(false);
+ primaryFragment = false;
}
}
|