Skip to content

Commit

Permalink
Add icons to Study, Add, and Card Browser shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush kumar sadangi authored and lukstbit committed Jul 19, 2023
1 parent 1ae5403 commit 6abc0fe
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ abstract class NavigationDrawerActivity :
val reviewCardsShortcut = ShortcutInfo.Builder(context, "reviewCardsShortcutId")
.setShortLabel(context.getString(R.string.studyoptions_start))
.setLongLabel(context.getString(R.string.studyoptions_start))
.setIcon(Icon.createWithResource(context, R.drawable.ankidroid_logo))
.setIcon(Icon.createWithResource(context, R.drawable.review_shortcut))
.setIntent(intentReviewCards)
.build()

Expand All @@ -453,7 +453,7 @@ abstract class NavigationDrawerActivity :
val NoteEditorShortcut = ShortcutInfo.Builder(context, "noteEditorShortcutId")
.setShortLabel(context.getString(R.string.menu_add))
.setLongLabel(context.getString(R.string.menu_add))
.setIcon(Icon.createWithResource(context, R.drawable.ankidroid_logo))
.setIcon(Icon.createWithResource(context, R.drawable.add_shortcut))
.setIntent(intentAddNote)
.build()

Expand All @@ -464,7 +464,7 @@ abstract class NavigationDrawerActivity :
val cardBrowserShortcut = ShortcutInfo.Builder(context, "cardBrowserShortcutId")
.setShortLabel(context.getString(R.string.card_browser))
.setLongLabel(context.getString(R.string.card_browser))
.setIcon(Icon.createWithResource(context, R.drawable.ankidroid_logo))
.setIcon(Icon.createWithResource(context, R.drawable.browse_shortcut))
.setIntent(intentCardBrowser)
.build()
shortcutManager.addDynamicShortcuts(
Expand Down
26 changes: 26 additions & 0 deletions AnkiDroid/src/main/res/drawable/add_shortcut.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
~ Copyright 2xxx, Google Material Design Icons
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="@android:color/holo_blue_dark">
<path
android:fillColor="#FFFFFF"
android:pathData="M445.93,764.07L445.93,514.07L195.93,514.07L195.93,445.93L445.93,445.93L445.93,195.93L514.07,195.93L514.07,445.93L764.07,445.93L764.07,514.07L514.07,514.07L514.07,764.07L445.93,764.07Z"/>
</vector>

25 changes: 25 additions & 0 deletions AnkiDroid/src/main/res/drawable/browse_shortcut.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
~ Copyright 2xxx, Google Material Design Icons
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@android:color/holo_blue_dark"
android:width="24dp"
android:height="24dp">
<path
android:pathData="M19 14V6C19 4.9 18.1 4 17 4H3C1.9 4 1 4.9 1 6v8c0 1.1 0.9 2 2 2h14c1.1 0 2 -0.9 2 -2zm-2 0H3V6H17ZM23 8.9846154V18c0 1.1 -0.9 2 -2 2H5.9846154A1.9846154 1.9846154 45 0 1 4 18.015385V18H21V7h0.01538A1.9846154 1.9846154 45 0 1 23 8.9846154Z"
android:fillColor="#FFFFFF" />
</vector>
17 changes: 17 additions & 0 deletions AnkiDroid/src/main/res/drawable/review_shortcut.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="120"
android:viewportHeight="124"
android:tint="@android:color/holo_blue_dark">
<group android:scaleX="0.89032257"
android:scaleY="0.92"
android:translateX="6.580645"
android:translateY="4.96">
<path
android:name="path_1"
android:pathData="M 48 0 C 47 0 45.9 0.1 44.9 0.4 C 40.7 1.8 38.6 5.8 37.6 9.5 C 36.6 13.2 36.4 17.3 36.3 21.4 C 36.2 25.5 36.1 29.7 35.8 33.1 C 35.5 36.5 34.6 39 34.1 39.7 C 33.6 40.4 31.4 42 28.3 43.3 C 25.2 44.7 21.3 46 17.4 47.4 C 13.5 48.8 9.7 50.3 6.4 52.3 C 3.2 54.3 0 57.5 0 62 C 0 66.5 3.1 69.6 6.4 71.7 C 9.7 73.8 13.4 75.2 17.3 76.7 C 21.2 78.1 25.1 79.4 28.2 80.8 C 31.3 82.2 33.5 83.7 34 84.4 C 34.5 85.1 35.3 87.7 35.6 91.1 C 35.9 94.5 36 98.6 36.1 102.8 C 36.2 106.9 36.5 111 37.4 114.7 C 38.3 118.4 40.4 122.4 44.6 123.8 C 48.8 125.2 52.8 123.2 55.8 120.7 C 58.8 118.2 61.4 115.1 63.9 111.9 C 66.4 108.7 68.9 105.3 71.2 102.8 C 73.5 100.3 75.6 98.6 76.5 98.4 C 77.3 98.1 80 98.2 83.3 98.9 C 86.6 99.6 90.6 100.9 94.5 102 C 98.5 103.1 102.4 104.2 106.2 104.4 C 110 104.6 114.4 103.9 117.1 100.3 C 119.7 96.7 119.1 92.3 117.7 88.7 C 116.3 85.1 114.1 81.7 111.8 78.3 C 109.5 74.9 107.1 71.5 105.4 68.6 C 103.7 65.7 102.8 63.1 102.8 62.2 C 102.8 61.2 103.9 58.2 106.1 54.8 C 108.2 51.4 111.1 47.5 113.6 43.7 C 115.6 40.7 117.3 37.6 118.4 34.5 C 119.4 31.3 119.7 27.4 117.4 24.2 C 114.8 20.6 110.4 19.9 106.5 20.1 C 102.7 20.3 98.7 21.4 94.7 22.5 C 90.7 23.6 86.8 24.9 83.5 25.6 C 80.2 26.3 77.5 26.3 76.7 26.1 C 75.9 25.9 73.7 24.2 71.4 21.7 C 69.1 19.1 66.7 15.8 64.2 12.5 C 61.7 9.2 59.1 6.1 56.1 3.6 C 53.8 1.7 51 0.1 48 0 Z"
android:fillColor="#FFFFFF"
android:strokeWidth="1"/>
</group>
</vector>

0 comments on commit 6abc0fe

Please sign in to comment.