Skip to content

Commit b589f89

Browse files
author
paolorotolo
committed
Target API 25. Add App Shortcuts.
1 parent 95de91a commit b589f89

File tree

4 files changed

+58
-4
lines changed

4 files changed

+58
-4
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ apply plugin: 'com.neenbedankt.android-apt'
2424
apply plugin: 'jacoco'
2525

2626
android {
27-
compileSdkVersion 24
27+
compileSdkVersion 25
2828
buildToolsVersion buildToolsVer
2929

3030
lintOptions {

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@
253253

254254
<category android:name="android.intent.category.LAUNCHER" />
255255
</intent-filter>
256+
<meta-data
257+
android:name="android.app.shortcuts"
258+
android:resource="@xml/shortcuts" />
256259
</activity>
257260
<activity android:name=".activity.RemindersActivity"></activity>
258261
</application>

app/src/main/res/xml/shortcuts.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
3+
<shortcut
4+
android:enabled="true"
5+
android:icon="@drawable/add_circle_glucose"
6+
android:shortcutDisabledMessage="@string/title_activity_add_glucose"
7+
android:shortcutId="glucose"
8+
android:shortcutLongLabel="@string/title_activity_add_glucose"
9+
android:shortcutShortLabel="@string/title_activity_add_glucose">
10+
<intent
11+
android:action="android.intent.action.VIEW"
12+
android:targetClass="org.glucosio.android.activity.AddGlucoseActivity"
13+
android:targetPackage="org.glucosio.android" />
14+
</shortcut>
15+
<shortcut
16+
android:enabled="true"
17+
android:icon="@drawable/add_circle_weight"
18+
android:shortcutDisabledMessage="@string/title_activity_add_weight"
19+
android:shortcutId="weight"
20+
android:shortcutLongLabel="@string/title_activity_add_weight"
21+
android:shortcutShortLabel="@string/title_activity_add_weight">
22+
<intent
23+
android:action="android.intent.action.VIEW"
24+
android:targetClass="org.glucosio.android.activity.AddWeightActivity"
25+
android:targetPackage="org.glucosio.android" />
26+
</shortcut>
27+
<shortcut
28+
android:enabled="true"
29+
android:icon="@drawable/add_circle_a1c"
30+
android:shortcutDisabledMessage="@string/title_activity_add_hb1ac"
31+
android:shortcutId="hb1ac"
32+
android:shortcutLongLabel="@string/title_activity_add_hb1ac"
33+
android:shortcutShortLabel="@string/title_activity_add_hb1ac">
34+
<intent
35+
android:action="android.intent.action.VIEW"
36+
android:targetClass="org.glucosio.android.activity.AddA1CActivity"
37+
android:targetPackage="org.glucosio.android" />
38+
</shortcut>
39+
<shortcut
40+
android:enabled="true"
41+
android:icon="@drawable/add_circle_pressure"
42+
android:shortcutDisabledMessage="@string/title_activity_add_pressure"
43+
android:shortcutId="pressure"
44+
android:shortcutLongLabel="@string/title_activity_add_pressure"
45+
android:shortcutShortLabel="@string/title_activity_add_pressure">
46+
<intent
47+
android:action="android.intent.action.VIEW"
48+
android:targetClass="org.glucosio.android.activity.AddPressureActivity"
49+
android:targetPackage="org.glucosio.android" />
50+
</shortcut>
51+
</shortcuts>

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ buildscript {
2727
dependencies {
2828
// TODO: Please revert to a stable gradle version before releasing on prod
2929
// Alpha is required in devel to use Instant Run and speed up development process
30-
classpath 'com.android.tools.build:gradle:2.2.1'
30+
classpath 'com.android.tools.build:gradle:2.2.2'
3131
classpath 'com.google.gms:google-services:3.0.0'
3232
classpath 'io.realm:realm-gradle-plugin:1.1.1'
3333
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
@@ -43,9 +43,9 @@ allprojects {
4343
jcenter()
4444
}
4545

46-
ext.buildToolsVer = '24.0.0'
46+
ext.buildToolsVer = '25.0.0'
4747

48-
ext.androidSupportVer = '24.2.1'
48+
ext.androidSupportVer = '25.0.0'
4949
ext.googlePlayServicesVer = '9.4.0'
5050

5151
ext.butterKnifeVer = '8.0.1'

0 commit comments

Comments
 (0)