From f049df0792058692c6fb73ce3a55e54938542375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lenclud?= Date: Sun, 1 Oct 2023 15:26:45 +0200 Subject: [PATCH] Add session to header info options --- app/src/main/java/acr/browser/lightning/ThemedActivity.kt | 2 +- .../acr/browser/lightning/browser/activity/BrowserActivity.kt | 3 ++- .../acr/browser/lightning/extensions/ActivityExtensions.kt | 2 +- app/src/main/java/fulguris/enums/HeaderInfo.kt | 3 ++- app/src/main/res/values/arrays.xml | 1 + app/src/main/res/values/strings.xml | 2 ++ 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/acr/browser/lightning/ThemedActivity.kt b/app/src/main/java/acr/browser/lightning/ThemedActivity.kt index 64197b30d..fd9fcf217 100644 --- a/app/src/main/java/acr/browser/lightning/ThemedActivity.kt +++ b/app/src/main/java/acr/browser/lightning/ThemedActivity.kt @@ -75,7 +75,7 @@ abstract class ThemedActivity : LocaleAwareActivity() { super.onCreate(savedInstanceState) resetPreferences() } - + /** * */ diff --git a/app/src/main/java/acr/browser/lightning/browser/activity/BrowserActivity.kt b/app/src/main/java/acr/browser/lightning/browser/activity/BrowserActivity.kt index f6e0600ad..4d2109ca5 100644 --- a/app/src/main/java/acr/browser/lightning/browser/activity/BrowserActivity.kt +++ b/app/src/main/java/acr/browser/lightning/browser/activity/BrowserActivity.kt @@ -3364,7 +3364,7 @@ abstract class BrowserActivity : ThemedBrowserActivity(), BrowserView, UIControl } /** - * + * Provide the text corresponding to the given [aInfo]. */ private fun getHeaderInfoText(aInfo: HeaderInfo) : String { @@ -3374,6 +3374,7 @@ abstract class BrowserActivity : ThemedBrowserActivity(), BrowserView, UIControl HeaderInfo.ShortUrl -> Utils.trimmedProtocolFromURL(tab.url) HeaderInfo.Domain -> Utils.getDisplayDomainName(tab.url) HeaderInfo.Title -> tab.title + HeaderInfo.Session -> tabsManager.iCurrentSessionName HeaderInfo.AppName -> getString(R.string.app_name) } } diff --git a/app/src/main/java/acr/browser/lightning/extensions/ActivityExtensions.kt b/app/src/main/java/acr/browser/lightning/extensions/ActivityExtensions.kt index 14347479c..0599f9b8c 100644 --- a/app/src/main/java/acr/browser/lightning/extensions/ActivityExtensions.kt +++ b/app/src/main/java/acr/browser/lightning/extensions/ActivityExtensions.kt @@ -98,7 +98,7 @@ fun Window.setStatusBarIconsColor(dark: Boolean) /** - * + * Change the text displayed in task switcher or window title on WSA */ fun Activity.setTaskLabel(aLabel: String?) { Timber.v("setTaskLabel: $aLabel") diff --git a/app/src/main/java/fulguris/enums/HeaderInfo.kt b/app/src/main/java/fulguris/enums/HeaderInfo.kt index 8f7dce039..4c312a546 100644 --- a/app/src/main/java/fulguris/enums/HeaderInfo.kt +++ b/app/src/main/java/fulguris/enums/HeaderInfo.kt @@ -36,7 +36,8 @@ enum class HeaderInfo(override val value: Int) : IntEnum { ShortUrl(1), Domain(2), Title(3), - AppName(4) + Session(4), + AppName(5) } diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index e213dd9f6..a976f8110 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -64,6 +64,7 @@ @string/label_short_url @string/label_domain @string/label_title + @string/label_session @string/label_app_name diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5f65dbcde..d39266d22 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -709,10 +709,12 @@ See: https://stackoverflow.com/a/42884713/3969362 Error Assert + URL Short URL Domain Title + Session App name