Skip to content

Commit

Permalink
app shortcut created
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvidadu committed Mar 15, 2018
1 parent 4a3c33e commit f69f702
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>

<activity android:name=".WelcomeActivity" />
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/app_shortcut_circle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#f5f5f5" />
</shape>
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/app_shortcut_nearby.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="2dp"
android:drawable="@drawable/app_shortcut_circle"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
<item
android:bottom="8dp"
android:drawable="@drawable/ic_location_blue_24dp"
android:left="8dp"
android:right="8dp"
android:top="8dp" />
</layer-list>
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/app_shortcut_notifications.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="2dp"
android:drawable="@drawable/app_shortcut_circle"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
<item
android:bottom="8dp"
android:drawable="@drawable/ic_notifications_blue_24dp"
android:left="8dp"
android:right="8dp"
android:top="8dp" />
</layer-list>
15 changes: 15 additions & 0 deletions app/src/main/res/drawable/app_shortcut_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:bottom="2dp"
android:drawable="@drawable/app_shortcut_circle"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
<item
android:bottom="8dp"
android:drawable="@drawable/ic_settings_blue_24dp"
android:left="8dp"
android:right="8dp"
android:top="8dp" />
</layer-list>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_location_blue_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#0c609c"
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_notifications_blue_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#0c609c"
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_settings_blue_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#0c609c"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>
49 changes: 49 additions & 0 deletions app/src/main/res/xml/shortcuts.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<shortcut
android:enabled="true"
android:icon="@drawable/app_shortcut_nearby"
android:shortcutDisabledMessage="@string/menu_nearby"
android:shortcutId="Nearby"
android:shortcutLongLabel="@string/menu_nearby"
android:shortcutShortLabel="@string/menu_nearby"
tools:ignore="UnusedAttribute">
<intent
android:action="android.intent.action.VIEW"
android:targetClass="fr.free.nrw.nearby.NearbyActivity"
android:targetPackage="fr.free.nrw.commons" />
<categories android:name="android.shortcut.conversation" />
</shortcut>
<shortcut
android:enabled="true"
android:icon="@drawable/app_shortcut_settings"
android:shortcutDisabledMessage="@string/menu_settings"
android:shortcutId="Settings"
android:shortcutLongLabel="@string/menu_settings"
android:shortcutShortLabel="@string/menu_settings"
tools:ignore="UnusedAttribute">
<intent
android:action="android.intent.action.VIEW"
android:targetClass="fr.free.nrw.commons.settings.SettingsActivity"
android:targetPackage="fr.free.nrw.commons" />
<categories android:name="android.shortcut.conversation" />
</shortcut>
<shortcut
android:enabled="true"
android:icon="@drawable/app_shortcut_notifications"
android:shortcutDisabledMessage="@string/navigation_item_notification"
android:shortcutId="Notifications"
android:shortcutLongLabel="@string/navigation_item_notification"
android:shortcutShortLabel="@string/navigation_item_notification"
tools:ignore="UnusedAttribute">
<intent
android:action="androidr.intent.action.VIEW"
android:targetClass="fr.free.nrw.commons.notification.NotificationActivity"
android:targetPackage="fr.free.nrw.commons" />
<categories android:name="android.shortcut.conversation" />
</shortcut>
</shortcuts>



0 comments on commit f69f702

Please sign in to comment.