Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit cf9a009

Browse files
committed
App shortcut fixes (#1213)
(cherry picked from commit 544631d) Signed-off-by: Harsh Shandilya <[email protected]>
1 parent dcee285 commit cf9a009

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,15 @@ class PasswordStore : BaseGitActivity() {
453453
// Needs an action to be a shortcut intent
454454
authDecryptIntent.action = LaunchActivity.ACTION_DECRYPT_PASS
455455

456+
startActivity(decryptIntent)
457+
456458
// Adds shortcut
457459
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
458460
val shortcutManager: ShortcutManager = getSystemService() ?: return
459461
val shortcut = Builder(this, item.fullPathToParent)
460462
.setShortLabel(item.toString())
461463
.setLongLabel(item.fullPathToParent + item.toString())
462-
.setIcon(Icon.createWithResource(this, R.mipmap.ic_launcher))
464+
.setIcon(Icon.createWithResource(this, R.drawable.ic_lock_open_24px))
463465
.setIntent(authDecryptIntent)
464466
.build()
465467
val shortcuts = shortcutManager.dynamicShortcuts
@@ -471,7 +473,6 @@ class PasswordStore : BaseGitActivity() {
471473
shortcutManager.addDynamicShortcuts(listOf(shortcut))
472474
}
473475
}
474-
startActivity(decryptIntent)
475476
}
476477

477478
private fun validateState(): Boolean {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!--
2+
~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved.
3+
~ SPDX-License-Identifier: GPL-3.0-only
4+
-->
5+
6+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
7+
android:width="24dp"
8+
android:height="24dp"
9+
android:viewportWidth="24"
10+
android:viewportHeight="24">
11+
<path
12+
android:fillColor="#FF000000"
13+
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" />
14+
</vector>

0 commit comments

Comments
 (0)