diff options
author | ByteHamster <info@bytehamster.com> | 2019-10-02 15:39:10 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-10-02 15:39:10 +0200 |
commit | 6967e9c8902b789079c7dee6a78d835410716d60 (patch) | |
tree | b8a65cae99cc8fbd1aa94b4b50a50d92494b6302 | |
parent | 940e03bcc732b3624475607fc71281cdb772975c (diff) | |
download | AntennaPod-6967e9c8902b789079c7dee6a78d835410716d60.zip |
Added feed title to ActionBar
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java | 4 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index 2a750f0f8..c7ac8286c 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -140,8 +140,8 @@ public class FeedItemlistFragment extends ListFragment { @Override public void onHiddenChanged(boolean hidden) { super.onHiddenChanged(hidden); - if (!hidden) { - ((MainActivity)getActivity()).getSupportActionBar().setTitle(""); + if (!hidden && getActivity() != null) { + ((MainActivity) getActivity()).getSupportActionBar().setTitle(""); } } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java index 4549203f8..f9564336d 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java @@ -60,6 +60,7 @@ public class FeedSettingsFragment extends PreferenceFragmentCompat { .subscribe(result -> { feed = result; feedPreferences = feed.getPreferences(); + ((MainActivity) getActivity()).getSupportActionBar().setSubtitle(feed.getTitle()); setupAutoDownloadPreference(); setupKeepUpdatedPreference(); @@ -77,6 +78,15 @@ public class FeedSettingsFragment extends PreferenceFragmentCompat { public void onResume() { super.onResume(); ((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.feed_settings_label); + if (feed != null) { + ((MainActivity) getActivity()).getSupportActionBar().setSubtitle(feed.getTitle()); + } + } + + @Override + public void onStop() { + super.onStop(); + ((MainActivity) getActivity()).getSupportActionBar().setSubtitle(null); } @Override |