aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-11-21 00:20:11 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-12-21 20:26:27 +0530
commitcf9a00990f62fe72d619ec2f1d269f43211f6607 (patch)
tree3ff3424fdd9de6015a5da2a8d8672f945f854cab /app
parentdcee2856136309f52756da7e8f85d5e0907d61b0 (diff)
App shortcut fixes (#1213)
(cherry picked from commit 544631da04c38ef734f34ceed31071a551876929) Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt5
-rw-r--r--app/src/main/res/drawable/ic_lock_open_24px.xml14
2 files changed, 17 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
index 66778e73..b0f8602c 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt
@@ -453,13 +453,15 @@ class PasswordStore : BaseGitActivity() {
// Needs an action to be a shortcut intent
authDecryptIntent.action = LaunchActivity.ACTION_DECRYPT_PASS
+ startActivity(decryptIntent)
+
// Adds shortcut
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
val shortcutManager: ShortcutManager = getSystemService() ?: return
val shortcut = Builder(this, item.fullPathToParent)
.setShortLabel(item.toString())
.setLongLabel(item.fullPathToParent + item.toString())
- .setIcon(Icon.createWithResource(this, R.mipmap.ic_launcher))
+ .setIcon(Icon.createWithResource(this, R.drawable.ic_lock_open_24px))
.setIntent(authDecryptIntent)
.build()
val shortcuts = shortcutManager.dynamicShortcuts
@@ -471,7 +473,6 @@ class PasswordStore : BaseGitActivity() {
shortcutManager.addDynamicShortcuts(listOf(shortcut))
}
}
- startActivity(decryptIntent)
}
private fun validateState(): Boolean {
diff --git a/app/src/main/res/drawable/ic_lock_open_24px.xml b/app/src/main/res/drawable/ic_lock_open_24px.xml
new file mode 100644
index 00000000..441bf88b
--- /dev/null
+++ b/app/src/main/res/drawable/ic_lock_open_24px.xml
@@ -0,0 +1,14 @@
+<!--
+ ~ 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"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z" />
+</vector>