Fix navigation bar theming and reformat (#930)
This commit is contained in:
parent
5d60f1304f
commit
7f3aceaf11
26 changed files with 130 additions and 18 deletions
5
.github/ci-gradle.properties
vendored
5
.github/ci-gradle.properties
vendored
|
@ -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.daemon=true
|
||||||
org.gradle.configureondemand=true
|
org.gradle.configureondemand=true
|
||||||
android.enableBuildCache=true
|
android.enableBuildCache=true
|
||||||
|
|
|
@ -4,15 +4,16 @@
|
||||||
*/
|
*/
|
||||||
package com.zeapo.pwdstore
|
package com.zeapo.pwdstore
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
import kotlin.test.assertFalse
|
import kotlin.test.assertFalse
|
||||||
import kotlin.test.assertNull
|
import kotlin.test.assertNull
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
private infix fun String.matchedForDomain(domain: String) =
|
private infix fun String.matchedForDomain(domain: String) =
|
||||||
SearchableRepositoryViewModel.generateStrictDomainRegex(domain)?.containsMatchIn(this) == true
|
SearchableRepositoryViewModel.generateStrictDomainRegex(domain)?.containsMatchIn(this) == true
|
||||||
|
|
||||||
class StrictDomainRegexTest {
|
class StrictDomainRegexTest {
|
||||||
|
|
||||||
@Test fun acceptsLiteralDomain() {
|
@Test fun acceptsLiteralDomain() {
|
||||||
assertTrue("work/example.org/john.doe@example.org.gpg" matchedForDomain "example.org")
|
assertTrue("work/example.org/john.doe@example.org.gpg" matchedForDomain "example.org")
|
||||||
assertTrue("example.org/john.doe@example.org.gpg" matchedForDomain "example.org")
|
assertTrue("example.org/john.doe@example.org.gpg" matchedForDomain "example.org")
|
||||||
|
|
|
@ -17,11 +17,11 @@ import androidx.test.rule.ActivityTestRule
|
||||||
import com.google.android.material.button.MaterialButtonToggleGroup
|
import com.google.android.material.button.MaterialButtonToggleGroup
|
||||||
import com.zeapo.pwdstore.R
|
import com.zeapo.pwdstore.R
|
||||||
import com.zeapo.pwdstore.git.BaseGitActivity.GitUpdateUrlResult
|
import com.zeapo.pwdstore.git.BaseGitActivity.GitUpdateUrlResult
|
||||||
|
import kotlin.test.assertEquals
|
||||||
import org.hamcrest.Matcher
|
import org.hamcrest.Matcher
|
||||||
import org.junit.Rule
|
import org.junit.Rule
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.junit.runner.RunWith
|
import org.junit.runner.RunWith
|
||||||
import kotlin.test.assertEquals
|
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4::class)
|
@RunWith(AndroidJUnit4::class)
|
||||||
class GitServerConfigActivityTest {
|
class GitServerConfigActivityTest {
|
||||||
|
|
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
package com.zeapo.pwdstore.utils
|
package com.zeapo.pwdstore.utils
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
class UriTotpFinderTest {
|
class UriTotpFinderTest {
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class UriTotpFinderTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
const val TOTP_URI = "otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA256&digits=12&period=25"
|
const val TOTP_URI = "otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA256&digits=12&period=25"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
package com.zeapo.pwdstore
|
||||||
|
|
||||||
import android.app.NotificationChannel
|
import android.app.NotificationChannel
|
||||||
|
|
|
@ -24,6 +24,7 @@ import com.zeapo.pwdstore.utils.autofillManager
|
||||||
class ChromeCompatFix : AccessibilityService() {
|
class ChromeCompatFix : AccessibilityService() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
fun setStatusInPreferences(context: Context, enabled: Boolean) {
|
fun setStatusInPreferences(context: Context, enabled: Boolean) {
|
||||||
PreferenceManager.getDefaultSharedPreferences(context).edit {
|
PreferenceManager.getDefaultSharedPreferences(context).edit {
|
||||||
putBoolean(PreferenceKeys.OREO_AUTOFILL_CHROME_COMPAT_FIX, enabled)
|
putBoolean(PreferenceKeys.OREO_AUTOFILL_CHROME_COMPAT_FIX, enabled)
|
||||||
|
|
|
@ -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
|
package com.zeapo.pwdstore.utils
|
||||||
|
|
||||||
object PreferenceKeys {
|
object PreferenceKeys {
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:color="@color/secondary_color" android:state_focused="true" />
|
<item android:color="@color/secondary_color" android:state_focused="true" />
|
||||||
<item android:color="@color/secondary_color" android:state_hovered="true" />
|
<item android:color="@color/secondary_color" android:state_hovered="true" />
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:aapt="http://schemas.android.com/aapt"
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
android:width="108dp"
|
android:width="108dp"
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
|
<!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
|
android:tint="?attr/colorControlNormal"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24"
|
android:viewportHeight="24">
|
||||||
android:tint="?attr/colorControlNormal">
|
<path
|
||||||
<path
|
android:fillColor="@android:color/white"
|
||||||
android:fillColor="@android:color/white"
|
android:pathData="M8.65,3.35L5.86,6.14c-0.32,0.31 -0.1,0.85 0.35,0.85H8V13c0,0.55 0.45,1 1,1s1,-0.45 1,-1V6.99h1.79c0.45,0 0.67,-0.54 0.35,-0.85L9.35,3.35c-0.19,-0.19 -0.51,-0.19 -0.7,0zM16,17.01V11c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v6.01h-1.79c-0.45,0 -0.67,0.54 -0.35,0.85l2.79,2.78c0.2,0.19 0.51,0.19 0.71,0l2.79,-2.78c0.32,-0.31 0.09,-0.85 -0.35,-0.85H16z" />
|
||||||
android:pathData="M8.65,3.35L5.86,6.14c-0.32,0.31 -0.1,0.85 0.35,0.85H8V13c0,0.55 0.45,1 1,1s1,-0.45 1,-1V6.99h1.79c0.45,0 0.67,-0.54 0.35,-0.85L9.35,3.35c-0.19,-0.19 -0.51,-0.19 -0.7,0zM16,17.01V11c0,-0.55 -0.45,-1 -1,-1s-1,0.45 -1,1v6.01h-1.79c-0.45,0 -0.67,0.54 -0.35,0.85l2.79,2.78c0.2,0.19 0.51,0.19 0.71,0l2.79,-2.78c0.32,-0.31 0.09,-0.85 -0.35,-0.85H16z"/>
|
|
||||||
</vector>
|
</vector>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<background android:drawable="@drawable/ic_launcher_background" />
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<bool name="light_status_bar">false</bool>
|
<bool name="light_status_bar">false</bool>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
8
app/src/main/res/values-v23/colors.xml
Normal file
8
app/src/main/res/values-v23/colors.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<color name="navigation_bar_color">#000000</color>
|
||||||
|
</resources>
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<bool name="enable_accessibility_autofill">false</bool>
|
<bool name="enable_accessibility_autofill">false</bool>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
8
app/src/main/res/values-v27/colors.xml
Normal file
8
app/src/main/res/values-v27/colors.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<color name="navigation_bar_color">@color/primary_color</color>
|
||||||
|
</resources>
|
11
app/src/main/res/values-v27/styles.xml
Normal file
11
app/src/main/res/values-v27/styles.xml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="AppTheme" parent="APSTheme">
|
||||||
|
<item name="android:windowLightNavigationBar">@bool/light_status_bar</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<bool name="enable_chrome_compat_fix">true</bool>
|
<bool name="enable_chrome_compat_fix">true</bool>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?><!--
|
||||||
|
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
~ SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<bool name="leak_canary_allow_in_non_debuggable_build">true</bool>
|
<bool name="leak_canary_allow_in_non_debuggable_build">true</bool>
|
||||||
<bool name="enable_accessibility_autofill">true</bool>
|
<bool name="enable_accessibility_autofill">true</bool>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
|
<style name="APSTheme" parent="Theme.MaterialComponents.DayNight">
|
||||||
<item name="colorPrimary">@color/primary_color</item>
|
<item name="colorPrimary">@color/primary_color</item>
|
||||||
<item name="colorOnPrimary">@color/color_control_normal</item>
|
<item name="colorOnPrimary">@color/color_control_normal</item>
|
||||||
<item name="colorPrimaryDark">@color/primary_color</item>
|
<item name="colorPrimaryDark">@color/primary_color</item>
|
||||||
|
@ -30,6 +30,8 @@
|
||||||
<item name="textInputStyle">@style/AppTheme.TextInputLayout</item>
|
<item name="textInputStyle">@style/AppTheme.TextInputLayout</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="AppTheme" parent="APSTheme" />
|
||||||
|
|
||||||
<style name="AppTheme.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense">
|
<style name="AppTheme.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense">
|
||||||
<item name="boxStrokeColor">@color/outlined_box_selector</item>
|
<item name="boxStrokeColor">@color/outlined_box_selector</item>
|
||||||
<item name="hintTextColor">?attr/colorSecondary</item>
|
<item name="hintTextColor">?attr/colorSecondary</item>
|
||||||
|
|
|
@ -6,15 +6,16 @@ package com.zeapo.pwdstore.model
|
||||||
|
|
||||||
import com.zeapo.pwdstore.utils.Otp
|
import com.zeapo.pwdstore.utils.Otp
|
||||||
import com.zeapo.pwdstore.utils.TotpFinder
|
import com.zeapo.pwdstore.utils.TotpFinder
|
||||||
import org.junit.Test
|
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertFalse
|
import kotlin.test.assertFalse
|
||||||
import kotlin.test.assertNotNull
|
import kotlin.test.assertNotNull
|
||||||
import kotlin.test.assertNull
|
import kotlin.test.assertNull
|
||||||
import kotlin.test.assertTrue
|
import kotlin.test.assertTrue
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
class PasswordEntryTest {
|
class PasswordEntryTest {
|
||||||
|
|
||||||
private fun makeEntry(content: String) = PasswordEntry(content, testFinder)
|
private fun makeEntry(content: String) = PasswordEntry(content, testFinder)
|
||||||
|
|
||||||
@Test fun testGetPassword() {
|
@Test fun testGetPassword() {
|
||||||
|
@ -83,6 +84,7 @@ class PasswordEntryTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
||||||
const val TOTP_URI = "otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30"
|
const val TOTP_URI = "otpauth://totp/ACME%20Co:john@example.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30"
|
||||||
|
|
||||||
// This implementation is hardcoded for the URI above.
|
// This implementation is hardcoded for the URI above.
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
|
/*
|
||||||
|
* Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
package com.zeapo.pwdstore.utils
|
package com.zeapo.pwdstore.utils
|
||||||
|
|
||||||
import org.junit.Test
|
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
import kotlin.test.assertNotNull
|
import kotlin.test.assertNotNull
|
||||||
import kotlin.test.assertNull
|
import kotlin.test.assertNull
|
||||||
|
import org.junit.Test
|
||||||
|
|
||||||
class OtpTest {
|
class OtpTest {
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
#
|
||||||
|
# Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
#
|
||||||
|
|
||||||
# AndroidX
|
# AndroidX
|
||||||
android.enableJetifier=false
|
android.enableJetifier=false
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
|
5
gradle/wrapper/gradle-wrapper.properties
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,3 +1,8 @@
|
||||||
|
#
|
||||||
|
# Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
#
|
||||||
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=143a28f54f1ae93ef4f72d862dbc3c438050d81bb45b4601eb7076e998362920
|
distributionSha256Sum=143a28f54f1ae93ef4f72d862dbc3c438050d81bb45b4601eb7076e998362920
|
||||||
|
|
Loading…
Reference in a new issue