From c4209a33ff1f6faf91aed16183fac064fdba0cde Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 11 May 2013 17:17:36 -0700 Subject: Added subtitle support from fragment --- .../src/github/daneren2005/dsub/activity/SubsonicActivity.java | 3 +++ .../src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'subsonic-android/src/github') diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java index 6fd92eec..319b95a3 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SubsonicActivity.java @@ -177,6 +177,9 @@ public class SubsonicActivity extends SherlockFragmentActivity implements OnItem recreateSpinner(); } } + public void setSubtitle(CharSequence title) { + getSupportActionBar().setSubtitle(title); + } @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 3d938dc9..3e6a1b39 100644 --- a/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/subsonic-android/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -73,6 +73,7 @@ public class SubsonicFragment extends SherlockFragment { private static final String TAG = SubsonicFragment.class.getSimpleName(); protected SubsonicActivity context; protected CharSequence title = "DSub"; + protected CharSequence subtitle = null; protected View rootView; protected boolean primaryFragment = false; protected boolean invalidated = false; @@ -269,6 +270,7 @@ public class SubsonicFragment extends SherlockFragment { if(primary) { if(context != null) { context.setTitle(title); + context.setSubtitle(subtitle); } if(invalidated) { invalidated = false; @@ -337,6 +339,10 @@ public class SubsonicFragment extends SherlockFragment { this.title = context.getResources().getString(title); context.setTitle(this.title); } + public void setSubtitle(CharSequence title) { + this.subtitle = title; + context.setSubtitle(title); + } public CharSequence getTitle() { return this.title; } -- cgit v1.2.3