Skip to content

Commit 64aeedf

Browse files
committed
feat: add app shortcut for 7.1+
1 parent ddfa04d commit 64aeedf

10 files changed

Lines changed: 33 additions & 1 deletion

File tree

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<category android:name="android.intent.category.LAUNCHER" />
2020
</intent-filter>
2121

22+
<meta-data android:name="android.app.shortcuts"
23+
android:resource="@xml/shortcuts" />
24+
2225
</activity>
2326
<activity android:name=".features.addeditdebt.AddEditDebtActivity">
2427
<meta-data
160 Bytes
Loading
105 Bytes
Loading
139 Bytes
Loading
185 Bytes
Loading
246 Bytes
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item>
5+
<shape android:shape="oval">
6+
<solid android:color="@color/grey_soft" />
7+
</shape>
8+
</item>
9+
10+
<item android:drawable="@drawable/ic_add_pri_dark"
11+
android:bottom="10dp"
12+
android:left="10dp"
13+
android:right="10dp"
14+
android:top="10dp"/>
15+
</layer-list>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@
3838
<string name="msg_decrease_debt_amount">Decrease debt amount</string>
3939
<string name="msg_success_message_payment_deleted">Payment deleted successfully</string>
4040
<string name="title_edit_payment">Edit Payment</string>
41+
<string name="add_debt_short_label">Add debt</string>
4142
</resources>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
2+
<shortcut
3+
android:shortcutId="add_debt"
4+
android:enabled="true"
5+
android:shortcutShortLabel="@string/add_debt_short_label"
6+
android:icon="@drawable/app_shortcut_icon_add_debt">
7+
<intent
8+
android:action="android.intent.action.VIEW"
9+
android:targetPackage="com.chikeandroid.debtmanager"
10+
android:targetClass="com.chikeandroid.debtmanager.features.addeditdebt.AddEditDebtActivity" />
11+
</shortcut>
12+
<!-- Specify more shortcuts here. -->
13+
</shortcuts>

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.2'
8+
classpath 'com.android.tools.build:gradle:2.3.3'
99
}
1010
}
1111

0 commit comments

Comments
 (0)