From 332e37b2eb941fe884345262d8a213835b5c71fe Mon Sep 17 00:00:00 2001 From: Pfaffenrodt Date: Sat, 29 Oct 2022 14:09:30 +0200 Subject: [PATCH] Extract page title to about content --- app/src/main/java/protect/card_locker/AboutActivity.java | 4 ++-- app/src/main/java/protect/card_locker/AboutContent.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/protect/card_locker/AboutActivity.java b/app/src/main/java/protect/card_locker/AboutActivity.java index 5b3e8b45b..775c10ddf 100644 --- a/app/src/main/java/protect/card_locker/AboutActivity.java +++ b/app/src/main/java/protect/card_locker/AboutActivity.java @@ -21,12 +21,12 @@ public class AboutActivity extends CatimaAppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = AboutActivityBinding.inflate(getLayoutInflater()); - setTitle(String.format(getString(R.string.about_title_fmt), getString(R.string.app_name))); + content = new AboutContent(this); + setTitle(content.getPageTitle()); setContentView(binding.getRoot()); setSupportActionBar(binding.toolbar); enableToolbarBackButton(); - content = new AboutContent(this); TextView copyright = binding.creditsSub; copyright.setText(content.getCopyright()); diff --git a/app/src/main/java/protect/card_locker/AboutContent.java b/app/src/main/java/protect/card_locker/AboutContent.java index 45375a482..a05ab333c 100644 --- a/app/src/main/java/protect/card_locker/AboutContent.java +++ b/app/src/main/java/protect/card_locker/AboutContent.java @@ -26,6 +26,10 @@ public class AboutContent { this.context = null; } + public String getPageTitle() { + return String.format(context.getString(R.string.about_title_fmt), context.getString(R.string.app_name)); + } + public String getAppVersion() { String version = "?"; try {