From b10576d7744c1bd7172f8b7b3e769f4007a4dce8 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Mon, 27 Feb 2023 09:51:55 -0700 Subject: [PATCH] Fix a race condition that sometimes causes the current tab to not be the active tab. https://redmine.stoutner.com/issues/963 --- COPYING | 2 +- app/build.gradle | 6 +++--- app/src/main/assets/de/about_changelog.html | 4 ++-- app/src/main/assets/en/about_changelog.html | 4 ++-- app/src/main/assets/es/about_changelog.html | 4 ++-- app/src/main/assets/fr/about_changelog.html | 4 ++-- app/src/main/assets/it/about_changelog.html | 4 ++-- app/src/main/assets/pt-rBR/about_changelog.html | 4 ++-- app/src/main/assets/ru/about_changelog.html | 4 ++-- app/src/main/assets/tr/about_changelog.html | 4 ++-- app/src/main/assets/zh-rCN/about_changelog.html | 4 ++-- .../privacybrowser/activities/MainWebViewActivity.java | 6 +++--- fastlane/metadata/android/zh_CN/full_description.txt | 2 +- fastlane/metadata/android/zh_CN/short_description.txt | 2 +- fastlane/metadata/android/zh_CN/title.txt | 2 +- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/COPYING b/COPYING index f013695e..f302d42b 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Privacy Browser Android copyright © 2015-2022 Soren Stoutner . +Privacy Browser Android copyright 2015-2023 Soren Stoutner . This file is part of Privacy Browser Android . diff --git a/app/build.gradle b/app/build.gradle index 0431a442..a22224b0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,9 +67,9 @@ android { dependencies { // Include the following AndroidX libraries. implementation "androidx.activity:activity-ktx:1.7.0-alpha04" - implementation 'androidx.arch.core:core-common:2.1.0' - implementation 'androidx.arch.core:core-runtime:2.1.0' - implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'androidx.arch.core:core-common:2.2.0' + implementation 'androidx.arch.core:core-runtime:2.2.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0' implementation 'androidx.core:core-ktx:1.9.0' diff --git a/app/src/main/assets/de/about_changelog.html b/app/src/main/assets/de/about_changelog.html index 101ba79b..362db211 100644 --- a/app/src/main/assets/de/about_changelog.html +++ b/app/src/main/assets/de/about_changelog.html @@ -33,8 +33,8 @@ -

3.13.2 (Version Code 66)

-

6. Februar 2023 - Mindest-API 23, Ziel-API 33

+

3.13.2 (Version Code 66)

+

6. Februar 2023 - Mindest-API 23, Ziel-API 33

  • Von Xin zur Verfügung gestellte Vereinfachte Chinesische Übersetzung hinzugefügt.
diff --git a/app/src/main/assets/en/about_changelog.html b/app/src/main/assets/en/about_changelog.html index cb276c09..f9e61f3b 100644 --- a/app/src/main/assets/en/about_changelog.html +++ b/app/src/main/assets/en/about_changelog.html @@ -27,8 +27,8 @@ -

3.13.2 (version code 66)

-

6 February 2023 - minimum API 23, target API 33

+

3.13.2 (version code 66)

+

6 February 2023 - minimum API 23, target API 33

  • Add a Simplified Chinese translation provided by Xin.
diff --git a/app/src/main/assets/es/about_changelog.html b/app/src/main/assets/es/about_changelog.html index 32ac2f6d..523a9df8 100644 --- a/app/src/main/assets/es/about_changelog.html +++ b/app/src/main/assets/es/about_changelog.html @@ -29,8 +29,8 @@ -

3.13.2 (código de versión 66)

-

6 de febrero de 2023 - API mínimo 23, API objetivo 33

+

3.13.2 (código de versión 66)

+

6 de febrero de 2023 - API mínimo 23, API objetivo 33

  • Añadir una traducción al chino simplificado proporcionada por Xin.
diff --git a/app/src/main/assets/fr/about_changelog.html b/app/src/main/assets/fr/about_changelog.html index 0dbdbe59..c1923e59 100644 --- a/app/src/main/assets/fr/about_changelog.html +++ b/app/src/main/assets/fr/about_changelog.html @@ -29,8 +29,8 @@ -

3.13.2 (version du code 66)

-

6 Février 2023 - API minimale : 23, API optimale : 33

+

3.13.2 (version du code 66)

+

6 Février 2023 - API minimale : 23, API optimale : 33

  • Ajout de la traduction en chinois simplifié par Xin.
diff --git a/app/src/main/assets/it/about_changelog.html b/app/src/main/assets/it/about_changelog.html index fbf76120..66fac279 100644 --- a/app/src/main/assets/it/about_changelog.html +++ b/app/src/main/assets/it/about_changelog.html @@ -29,8 +29,8 @@ -

3.13.2 (versione codice 66)

-

6 Febbraio 2023 - minima API 23, target API 33

+

3.13.2 (versione codice 66)

+

6 Febbraio 2023 - minima API 23, target API 33

  • Aggiunta la traduzione in Cinese Semplificato fornita da Xin.
diff --git a/app/src/main/assets/pt-rBR/about_changelog.html b/app/src/main/assets/pt-rBR/about_changelog.html index 4de42c8c..214ec300 100644 --- a/app/src/main/assets/pt-rBR/about_changelog.html +++ b/app/src/main/assets/pt-rBR/about_changelog.html @@ -29,8 +29,8 @@ -

3.13.2 (código de versão 66)

-

6 February 2023 - minimum API 23, target API 33

+

3.13.2 (código de versão 66)

+

6 February 2023 - minimum API 23, target API 33

  • Add a Simplified Chinese translation provided by Xin.
diff --git a/app/src/main/assets/ru/about_changelog.html b/app/src/main/assets/ru/about_changelog.html index 51f40aab..645f4d7a 100644 --- a/app/src/main/assets/ru/about_changelog.html +++ b/app/src/main/assets/ru/about_changelog.html @@ -27,8 +27,8 @@ -

3.13.2 (код версии 66)

-

6 февраля 2023 года - минимальный API 23, целевой API 33

+

3.13.2 (код версии 66)

+

6 февраля 2023 года - минимальный API 23, целевой API 33

  • Добавлен китайский упрощенный перевод, выполненный Синь (Xin).
diff --git a/app/src/main/assets/tr/about_changelog.html b/app/src/main/assets/tr/about_changelog.html index c17edccb..df1ecdd5 100644 --- a/app/src/main/assets/tr/about_changelog.html +++ b/app/src/main/assets/tr/about_changelog.html @@ -27,8 +27,8 @@ -

3.13.2 (version code 66)

-

6 Şubat 2023 - minimum API 23, target API 33

+

3.13.2 (version code 66)

+

6 Şubat 2023 - minimum API 23, target API 33

  • Add a Simplified Chinese translation provided by Xin.
diff --git a/app/src/main/assets/zh-rCN/about_changelog.html b/app/src/main/assets/zh-rCN/about_changelog.html index 06c2eda4..4d6743b3 100644 --- a/app/src/main/assets/zh-rCN/about_changelog.html +++ b/app/src/main/assets/zh-rCN/about_changelog.html @@ -29,8 +29,8 @@ -

3.13.2 (version code 66)

-

6 February 2023 - 最低支持API 23, 最高支持API 33

+

3.13.2 (version code 66)

+

6 February 2023 - 最低支持API 23, 最高支持API 33

  • 新增由xin提供的简体中文翻译。
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index 162a1c8f..c5cb7e99 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2022 Soren Stoutner . + * Copyright 2015-2023 Soren Stoutner . * * Download cookie code contributed 2017 Hendrik Knackstedt. Copyright assigned to Soren Stoutner . * @@ -4382,7 +4382,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook if (savedTabPosition == 0) { // The first tab is selected. // Set the first page as the current WebView. setCurrentWebView(0); - } else { // the first tab is not selected. + } else { // The first tab is not selected. // Move to the selected tab. webViewPager.setCurrentItem(savedTabPosition); } @@ -4841,7 +4841,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Remove any background on the URL relative layout. urlRelativeLayout.setBackground(ResourcesCompat.getDrawable(getResources(), R.color.transparent, null)); } - } else { // The fragment has not been populated. Try again in 100 milliseconds. + } else if (pageNumber == savedTabPosition){ // The app is being restored but the saved tab position fragment has not been populated yet. Try again in 100 milliseconds. // Create a handler to set the current WebView. Handler setCurrentWebViewHandler = new Handler(); diff --git a/fastlane/metadata/android/zh_CN/full_description.txt b/fastlane/metadata/android/zh_CN/full_description.txt index 32173100..6f8e9909 100644 --- a/fastlane/metadata/android/zh_CN/full_description.txt +++ b/fastlane/metadata/android/zh_CN/full_description.txt @@ -9,4 +9,4 @@ Privacy Browser目前使用安卓内置的WebView来呈现网页,因此它在 集成EasyList拦截广告 支持Tor Orbot通道 固定SSL证书 -支持导入/导出设置和书签 +支持导入/导出设置和书签 \ No newline at end of file diff --git a/fastlane/metadata/android/zh_CN/short_description.txt b/fastlane/metadata/android/zh_CN/short_description.txt index 1da2708b..74069286 100644 --- a/fastlane/metadata/android/zh_CN/short_description.txt +++ b/fastlane/metadata/android/zh_CN/short_description.txt @@ -1 +1 @@ -一个尊重你隐私的浏览器。 +一个尊重你隐私的浏览器。 \ No newline at end of file diff --git a/fastlane/metadata/android/zh_CN/title.txt b/fastlane/metadata/android/zh_CN/title.txt index beb60305..ca458fec 100644 --- a/fastlane/metadata/android/zh_CN/title.txt +++ b/fastlane/metadata/android/zh_CN/title.txt @@ -1 +1 @@ -Privacy Browser +Privacy Browser \ No newline at end of file -- 2.43.0