From 7f3aceaf11ce69a121ea0d9bd62e38953184e40c Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 14 Jul 2020 11:31:37 +0530 Subject: [PATCH] Fix navigation bar theming and reformat (#930) --- .github/ci-gradle.properties | 5 +++++ .../com/zeapo/pwdstore/StrictDomainRegexTest.kt | 3 ++- .../pwdstore/git/GitServerConfigActivityTest.kt | 2 +- .../com/zeapo/pwdstore/utils/UriTotpFinderTest.kt | 3 ++- .../com/zeapo/pwdstore/PasswordExportService.kt | 5 +++++ .../pwdstore/autofill/oreo/ChromeCompatFix.kt | 1 + .../com/zeapo/pwdstore/utils/PreferenceKeys.kt | 5 +++++ app/src/main/res/color/outlined_box_selector.xml | 6 +++++- .../res/drawable-v24/ic_launcher_background.xml | 5 +++++ app/src/main/res/drawable/ic_autofill_sms.xml | 5 +++++ app/src/main/res/drawable/ic_qr_code_scanner.xml | 5 +++++ .../main/res/drawable/ic_round_import_export.xml | 15 ++++++++++----- .../main/res/mipmap-anydpi-v26/ic_launcher.xml | 6 +++++- .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 6 +++++- app/src/main/res/values-night/bools.xml | 6 +++++- app/src/main/res/values-v23/colors.xml | 8 ++++++++ app/src/main/res/values-v26/bools.xml | 6 +++++- app/src/main/res/values-v27/colors.xml | 8 ++++++++ app/src/main/res/values-v27/styles.xml | 11 +++++++++++ app/src/main/res/values-v28/bools.xml | 6 +++++- app/src/main/res/values/bools.xml | 6 +++++- app/src/main/res/values/styles.xml | 4 +++- .../com/zeapo/pwdstore/model/PasswordEntryTest.kt | 4 +++- .../test/java/com/zeapo/pwdstore/utils/OtpTest.kt | 7 ++++++- gradle.properties | 5 +++++ gradle/wrapper/gradle-wrapper.properties | 5 +++++ 26 files changed, 130 insertions(+), 18 deletions(-) create mode 100644 app/src/main/res/values-v23/colors.xml create mode 100644 app/src/main/res/values-v27/colors.xml create mode 100644 app/src/main/res/values-v27/styles.xml diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties index 053002826..03c213b29 100644 --- a/.github/ci-gradle.properties +++ b/.github/ci-gradle.properties @@ -1,3 +1,8 @@ +# +# Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. +# SPDX-License-Identifier: GPL-3.0-only +# + org.gradle.daemon=true org.gradle.configureondemand=true android.enableBuildCache=true diff --git a/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt b/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt index 1e2d4a6c5..2631cb41d 100644 --- a/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt +++ b/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt @@ -4,15 +4,16 @@ */ package com.zeapo.pwdstore -import org.junit.Test import kotlin.test.assertFalse import kotlin.test.assertNull import kotlin.test.assertTrue +import org.junit.Test private infix fun String.matchedForDomain(domain: String) = SearchableRepositoryViewModel.generateStrictDomainRegex(domain)?.containsMatchIn(this) == true class StrictDomainRegexTest { + @Test fun acceptsLiteralDomain() { assertTrue("work/example.org/john.doe@example.org.gpg" matchedForDomain "example.org") assertTrue("example.org/john.doe@example.org.gpg" matchedForDomain "example.org") diff --git a/app/src/androidTest/java/com/zeapo/pwdstore/git/GitServerConfigActivityTest.kt b/app/src/androidTest/java/com/zeapo/pwdstore/git/GitServerConfigActivityTest.kt index 143cfe1b1..2c2691b19 100644 --- a/app/src/androidTest/java/com/zeapo/pwdstore/git/GitServerConfigActivityTest.kt +++ b/app/src/androidTest/java/com/zeapo/pwdstore/git/GitServerConfigActivityTest.kt @@ -17,11 +17,11 @@ import androidx.test.rule.ActivityTestRule import com.google.android.material.button.MaterialButtonToggleGroup import com.zeapo.pwdstore.R import com.zeapo.pwdstore.git.BaseGitActivity.GitUpdateUrlResult +import kotlin.test.assertEquals import org.hamcrest.Matcher import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith -import kotlin.test.assertEquals @RunWith(AndroidJUnit4::class) class GitServerConfigActivityTest { diff --git a/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt b/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt index 3397ed0d2..8a836f892 100644 --- a/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt +++ b/app/src/androidTest/java/com/zeapo/pwdstore/utils/UriTotpFinderTest.kt @@ -5,8 +5,8 @@ package com.zeapo.pwdstore.utils -import org.junit.Test import kotlin.test.assertEquals +import org.junit.Test class UriTotpFinderTest { @@ -34,6 +34,7 @@ class UriTotpFinderTest { } companion object { + const val TOTP_URI = "otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA256&digits=12&period=25" } } diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordExportService.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordExportService.kt index e877a77a5..c1845f2f9 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordExportService.kt +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordExportService.kt @@ -1,3 +1,8 @@ +/* + * Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. + * SPDX-License-Identifier: GPL-3.0-only + */ + package com.zeapo.pwdstore import android.app.NotificationChannel diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ChromeCompatFix.kt b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ChromeCompatFix.kt index 75d9539aa..d1f81c0ca 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ChromeCompatFix.kt +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/oreo/ChromeCompatFix.kt @@ -24,6 +24,7 @@ import com.zeapo.pwdstore.utils.autofillManager class ChromeCompatFix : AccessibilityService() { companion object { + fun setStatusInPreferences(context: Context, enabled: Boolean) { PreferenceManager.getDefaultSharedPreferences(context).edit { putBoolean(PreferenceKeys.OREO_AUTOFILL_CHROME_COMPAT_FIX, enabled) diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PreferenceKeys.kt b/app/src/main/java/com/zeapo/pwdstore/utils/PreferenceKeys.kt index 7d0195084..3fb05724e 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PreferenceKeys.kt +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PreferenceKeys.kt @@ -1,3 +1,8 @@ +/* + * Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. + * SPDX-License-Identifier: GPL-3.0-only + */ + package com.zeapo.pwdstore.utils object PreferenceKeys { diff --git a/app/src/main/res/color/outlined_box_selector.xml b/app/src/main/res/color/outlined_box_selector.xml index f66b86696..4ee69718d 100644 --- a/app/src/main/res/color/outlined_box_selector.xml +++ b/app/src/main/res/color/outlined_box_selector.xml @@ -1,4 +1,8 @@ - + + diff --git a/app/src/main/res/drawable-v24/ic_launcher_background.xml b/app/src/main/res/drawable-v24/ic_launcher_background.xml index 8c1c87315..ec9305377 100644 --- a/app/src/main/res/drawable-v24/ic_launcher_background.xml +++ b/app/src/main/res/drawable-v24/ic_launcher_background.xml @@ -1,3 +1,8 @@ + + + + + - + android:viewportHeight="24"> + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 3ba4e35c0..3486e4a59 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,4 +1,8 @@ - + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index 3ba4e35c0..3486e4a59 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -1,4 +1,8 @@ - + + diff --git a/app/src/main/res/values-night/bools.xml b/app/src/main/res/values-night/bools.xml index d3e609b64..a8de30b78 100644 --- a/app/src/main/res/values-night/bools.xml +++ b/app/src/main/res/values-night/bools.xml @@ -1,4 +1,8 @@ - + + false diff --git a/app/src/main/res/values-v23/colors.xml b/app/src/main/res/values-v23/colors.xml new file mode 100644 index 000000000..7c3be280f --- /dev/null +++ b/app/src/main/res/values-v23/colors.xml @@ -0,0 +1,8 @@ + + + + #000000 + diff --git a/app/src/main/res/values-v26/bools.xml b/app/src/main/res/values-v26/bools.xml index 86ab6c8ea..e2c7af910 100644 --- a/app/src/main/res/values-v26/bools.xml +++ b/app/src/main/res/values-v26/bools.xml @@ -1,4 +1,8 @@ - + + false diff --git a/app/src/main/res/values-v27/colors.xml b/app/src/main/res/values-v27/colors.xml new file mode 100644 index 000000000..fc765bbfb --- /dev/null +++ b/app/src/main/res/values-v27/colors.xml @@ -0,0 +1,8 @@ + + + + @color/primary_color + diff --git a/app/src/main/res/values-v27/styles.xml b/app/src/main/res/values-v27/styles.xml new file mode 100644 index 000000000..eeb928769 --- /dev/null +++ b/app/src/main/res/values-v27/styles.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/app/src/main/res/values-v28/bools.xml b/app/src/main/res/values-v28/bools.xml index 0ce64e0bb..3dc8bf792 100644 --- a/app/src/main/res/values-v28/bools.xml +++ b/app/src/main/res/values-v28/bools.xml @@ -1,4 +1,8 @@ - + + true diff --git a/app/src/main/res/values/bools.xml b/app/src/main/res/values/bools.xml index fbcc1c735..b19e7848b 100644 --- a/app/src/main/res/values/bools.xml +++ b/app/src/main/res/values/bools.xml @@ -1,4 +1,8 @@ - + + true true diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 3e30f0a53..d84143cec 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -6,7 +6,7 @@ - +