Changed main page titles

This commit is contained in:
M66B
2019-08-18 10:03:14 +02:00
parent b68532cdfe
commit 2569d090d4
5 changed files with 29 additions and 10 deletions

View File

@@ -40,9 +40,19 @@ import java.util.HashMap;
import java.util.Map;
public class FragmentBase extends Fragment {
private String title = null;
private String subtitle = " ";
private boolean finish = false;
protected void setTitle(int resid) {
setTitle(getString(resid));
}
protected void setTitle(String title) {
this.title = title;
updateSubtitle();
}
protected void setSubtitle(int resid) {
setSubtitle(getString(resid));
}
@@ -182,8 +192,10 @@ public class FragmentBase extends Fragment {
AppCompatActivity activity = (AppCompatActivity) getActivity();
if (activity != null && !isPane()) {
ActionBar actionbar = activity.getSupportActionBar();
if (actionbar != null)
if (actionbar != null) {
actionbar.setTitle(title == null ? getString(R.string.app_name) : title);
actionbar.setSubtitle(subtitle);
}
}
}