From 17032aa3bf7d84942436b254cf5ebffc2b41ce46 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Fri, 27 Sep 2024 15:22:47 -0700 Subject: [PATCH] Colorize the status bar on proxy change. https://redmine.stoutner.com/issues/1169 --- .../activities/MainWebViewActivity.kt | 15 ++++++++++----- app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt index 45731697..2f9b09e4 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.kt @@ -3592,13 +3592,15 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook // Get the color background int from the typed value. val colorBackgroundInt = colorBackgroundTypedValue.data - // Set the default app bar layout background. + // Set the default app bar and status bar backgrounds. appBarLayout.setBackgroundColor(colorBackgroundInt) + window.statusBarColor = colorBackgroundInt } ProxyHelper.TOR -> { - // Set the app bar background to indicate proxying is enabled. + // Set the app bar and status bar backgrounds to indicate proxying is enabled. appBarLayout.setBackgroundResource(R.color.blue_background) + window.statusBarColor = getColor(R.color.blue_background) // Check to see if Orbot is installed. try { @@ -3647,8 +3649,9 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook } ProxyHelper.I2P -> { - // Set the app bar background to indicate proxying is enabled. + // Set the app bar and status bar backgrounds to indicate proxying is enabled. appBarLayout.setBackgroundResource(R.color.blue_background) + window.statusBarColor = getColor(R.color.blue_background) // Check to see if I2P is installed. try { @@ -3677,9 +3680,11 @@ class MainWebViewActivity : AppCompatActivity(), CreateBookmarkDialog.CreateBook } } - ProxyHelper.CUSTOM -> - // Set the app bar background to indicate proxying is enabled. + ProxyHelper.CUSTOM -> { + // Set the app bar and status bar backgrounds to indicate proxying is enabled. appBarLayout.setBackgroundResource(R.color.blue_background) + window.statusBarColor = getColor(R.color.blue_background) + } } // Reload the WebViews if requested and not waiting for the proxy. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9ea9f5a1..d9940aa6 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -179,6 +179,7 @@ Abrir imagen en nueva pestaña Compartir imagen Copiar URL + Copiar Texto Correo electrónico Copiar correo electrónico Escribir correo electrónico diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a26b4301..12bc57e2 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -179,6 +179,7 @@ Ouvrir l\'image dans un nouvel onglet Partager l\'image Copier l\'URL + Copier le texte Addresse e-mail Copier l\'adresse e-mail Ecrire un e-mail diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3d509991..b573c6bf 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -179,6 +179,7 @@ Apri l\'immagine in una nuova scheda Condividi Immagine Copia URL + Copia Testo Indirizzo Email Copia Indirizzo Email Scrivi Email diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 59ef4304..ab040d02 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -176,6 +176,7 @@ Открыть изображение в новой вкладке Поделиться изображением Копировать URL + Скопировать текст Адрес email Копировать адрес email Написать email -- 2.45.2