Added feed title to ActionBar

This commit is contained in:
ByteHamster 2019-10-02 15:39:10 +02:00
parent 940e03bcc7
commit 6967e9c890
2 changed files with 12 additions and 2 deletions

View File

@ -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("");
}
}

View File

@ -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