Skip to content

Commit 584fa2c

Browse files
Fixes commons-app#814 Added App Shortcuts (commons-app#3381)
* Fixes commons-app#814 Added App Shortcuts * removed Review app shortcut * Added Adaptive icons
1 parent fffff62 commit 584fa2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+157
-0
lines changed

app/src/main/AndroidManifest.xml

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747

4848
<action android:name="android.intent.action.MAIN" />
4949
</intent-filter>
50+
51+
<meta-data android:name="android.app.shortcuts"
52+
android:resource="@xml/shortcuts" />
53+
5054
</activity>
5155
<activity android:name=".WelcomeActivity" />
5256

app/src/main/ic_explore-web.png

27.1 KB

app/src/main/ic_filled_star-web.png

14.2 KB
16 KB
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="40.909092"
5+
android:viewportHeight="40.909092">
6+
<group android:translateX="8.454545"
7+
android:translateY="8.454545">
8+
<path
9+
android:pathData="M8.91,2.49a10,10 0,1 0,12.6 6.42A10,10 0,0 0,8.91 2.49ZM14.47,19.61A8,8 0,1 1,19.61 9.53,8 8,0 0,1 14.47,19.61Z"
10+
android:fillColor="#000000"/>
11+
<path
12+
android:pathData="M3.35,7.45s2.5,1.82 7.26,0.27 5.71,-4.49 5.71,-4.49l1.11,1.22s-1.61,3.15 -6.36,4.7 -7.91,-0.06 -7.91,-0.06Z"
13+
android:fillColor="#000000"/>
14+
<path
15+
android:pathData="M7.52,20.29s1,-2.94 5.71,-4.49 7.26,0.27 7.26,0.27l0.18,-1.64s-3.15,-1.61 -7.91,-0.06 -6.36,4.7 -6.36,4.7Z"
16+
android:fillColor="#000000"/>
17+
<path
18+
android:pathData="M3.97,13.82l15.6,-5.07l0.46,1.43l-6.81,2.21l-8.79,2.86l-0.46,-1.43z"
19+
android:fillColor="#000000"/>
20+
<path
21+
android:pathData="M15.8,10.76A9.77,9.77 0,0 0,9.48 4.26l1.25,-1a11.16,11.16 0,0 1,6.49 7,11.16 11.16,0 0,1 -1.12,9.51l-1.6,-0.07A9.77,9.77 0,0 0,15.8 10.76Z"
22+
android:fillColor="#000000"/>
23+
<path
24+
android:pathData="M8.2,13.24a9.77,9.77 0,0 1,1.29 -9l-1.6,-0.07A11.16,11.16 0,0 0,6.77 13.7a11.16,11.16 0,0 0,6.49 7l1.25,-1A9.77,9.77 0,0 1,8.2 13.24Z"
25+
android:fillColor="#000000"/>
26+
<path
27+
android:pathData="M8.754,4.438l1.427,-0.464l5.068,15.597l-1.427,0.464z"
28+
android:fillColor="#000000"/>
29+
</group>
30+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
6+
<path
7+
android:fillColor="#FF000000"
8+
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
9+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="40.909092"
5+
android:viewportHeight="40.909092">
6+
<group android:translateX="8.454545"
7+
android:translateY="9.212121">
8+
<path
9+
android:fillColor="#FF000000"
10+
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z"/>
11+
</group>
12+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="40.909092"
5+
android:viewportHeight="40.909092">
6+
<group android:translateX="8.454545"
7+
android:translateY="8.454545">
8+
<path
9+
android:fillColor="#FF000000"
10+
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"/>
11+
</group>
12+
</vector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_explore_background"/>
4+
<foreground android:drawable="@drawable/ic_explore_foreground"/>
5+
</adaptive-icon>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_explore_background"/>
4+
<foreground android:drawable="@drawable/ic_explore_foreground"/>
5+
</adaptive-icon>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_filled_star_background"/>
4+
<foreground android:drawable="@drawable/ic_filled_star_foreground"/>
5+
</adaptive-icon>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_filled_star_background"/>
4+
<foreground android:drawable="@drawable/ic_filled_star_foreground"/>
5+
</adaptive-icon>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_settings_black_background"/>
4+
<foreground android:drawable="@drawable/ic_settings_black_foreground"/>
5+
</adaptive-icon>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_settings_black_background"/>
4+
<foreground android:drawable="@drawable/ic_settings_black_foreground"/>
5+
</adaptive-icon>
2.7 KB
1.41 KB
1.79 KB
1005 Bytes
919 Bytes
3.69 KB
1.93 KB
5.71 KB
7.86 KB
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_explore_background">#FFFFFF</color>
4+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_filled_star_background">#FFFFFF</color>
4+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_settings_black_background">#FFFFFF</color>
4+
</resources>

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

+3
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,9 @@ Upload your first media by tapping on the add button.</string>
591591

592592
<string name="upload_nearby_place_found_title">Nearby Place Found</string>
593593
<string name="upload_nearby_place_found_description">Is this a photo of Place %1$s?</string>
594+
<string name="title_app_shortcut_explore">Explore</string>
595+
<string name="title_app_shortcut_bookmark">Bookmarks</string>
596+
<string name="title_app_shortcut_setting">Settings</string>
594597
<string name="remove_bookmark">Removed from bookmarks</string>
595598
<string name="add_bookmark">Added to bookmarks</string>
596599
<string name="wallpaper_set_unsuccessfully">Something went wrong. Could not set the wallpaper</string>

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

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
<shortcut
5+
android:enabled="true"
6+
android:icon="@mipmap/ic_explore"
7+
android:shortcutId="Explore"
8+
android:shortcutLongLabel="@string/title_app_shortcut_explore"
9+
android:shortcutShortLabel="@string/title_app_shortcut_explore"
10+
tools:targetApi="n_mr1">
11+
<intent
12+
android:action="android.intent.action.VIEW"
13+
android:targetClass="fr.free.nrw.commons.explore.categories.ExploreActivity"
14+
android:targetPackage="fr.free.nrw.commons.beta" />
15+
</shortcut>
16+
17+
<shortcut
18+
android:enabled="true"
19+
android:icon="@mipmap/ic_filled_star"
20+
android:shortcutId="Bookmark"
21+
android:shortcutLongLabel="@string/title_app_shortcut_bookmark"
22+
android:shortcutShortLabel="@string/title_app_shortcut_bookmark"
23+
tools:targetApi="n_mr1">
24+
<intent
25+
android:action="android.intent.action.VIEW"
26+
android:targetClass="fr.free.nrw.commons.bookmarks.BookmarksActivity"
27+
android:targetPackage="fr.free.nrw.commons.beta" />
28+
</shortcut>
29+
30+
<shortcut
31+
android:enabled="true"
32+
android:icon="@mipmap/ic_settings_black"
33+
android:shortcutId="Setting"
34+
android:shortcutLongLabel="@string/title_app_shortcut_setting"
35+
android:shortcutShortLabel="@string/title_app_shortcut_setting"
36+
tools:targetApi="n_mr1">
37+
<intent
38+
android:action="android.intent.action.VIEW"
39+
android:targetClass="fr.free.nrw.commons.settings.SettingsActivity"
40+
android:targetPackage="fr.free.nrw.commons.beta" />
41+
</shortcut>
42+
43+
44+
</shortcuts>
45+

0 commit comments

Comments
 (0)