Skip to content

Commit 84ae949

Browse files
committed
Added collections shortcut
1 parent fa6fffe commit 84ae949

File tree

16 files changed

+103
-5
lines changed

16 files changed

+103
-5
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,21 @@
8181
</intent-filter>
8282
</activity>
8383

84+
<activity
85+
android:name=".shortcuts.CollectionsShortcut"
86+
android:excludeFromRecents="true"
87+
android:exported="true"
88+
android:icon="@mipmap/ic_launcher_collections"
89+
android:label="@string/collections"
90+
android:launchMode="singleTop"
91+
android:noHistory="true"
92+
android:theme="@style/AppTheme.Transparent">
93+
<intent-filter>
94+
<action android:name="android.intent.action.MAIN" />
95+
<category android:name="android.intent.category.LAUNCHER" />
96+
</intent-filter>
97+
</activity>
98+
8499
<activity
85100
android:name=".shortcuts.FilesShortcut"
86101
android:excludeFromRecents="true"

app/src/main/java/com/wstxda/gsl/fragments/ManagerFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ class ManagerFragment : PreferenceFragmentCompat() {
4242

4343
private val shortcuts = mapOf(
4444
"assistant_shortcut" to AssistantShortcut::class.java,
45+
"collections_shortcut" to CollectionsShortcut::class.java,
4546
"files_shortcut" to FilesShortcut::class.java,
4647
"games_shortcut" to GamesShortcut::class.java,
48+
"incognito_shortcut" to IncognitoShortcut::class.java,
4749
"lens_shortcut" to LensShortcut::class.java,
4850
"music_search_shortcut" to MusicSearchShortcut::class.java,
4951
"password_manager_shortcut" to PasswordManagerShortcut::class.java,
50-
"incognito_shortcut" to IncognitoShortcut::class.java,
5152
"quick_share_shortcut" to QuickShareShortcut::class.java,
5253
"search_shortcut" to SearchShortcut::class.java,
5354
"weather_shortcut" to WeatherShortcut::class.java,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.wstxda.gsl.shortcuts
2+
3+
import android.content.ComponentName
4+
import android.content.Intent
5+
import com.wstxda.gsl.R
6+
import com.wstxda.gsl.activity.ShortcutsActivity
7+
import com.wstxda.gsl.logic.launchShortcuts
8+
9+
class CollectionsShortcut : ShortcutsActivity() {
10+
override fun onCreateInternal() {
11+
launchShortcuts(listOf(createCollectionsIntent()), R.string.play_store_not_found)
12+
}
13+
14+
private fun createCollectionsIntent() = Intent().apply {
15+
component = ComponentName(
16+
"com.android.vending", "com.google.android.finsky.rubiks.cubes.activity.CubesActivity"
17+
)
18+
}
19+
}

app/src/main/java/com/wstxda/gsl/utils/DigitalAssistantShortcuts.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import com.wstxda.gsl.shortcuts.*
1010

1111
object DigitalAssistantShortcuts {
1212
private val shortcutMap = mapOf(
13+
"collections_shortcut" to CollectionsShortcut::class.java,
1314
"files_shortcut" to FilesShortcut::class.java,
1415
"games_shortcut" to GamesShortcut::class.java,
16+
"incognito_shortcut" to IncognitoShortcut::class.java,
1517
"lens_shortcut" to LensShortcut::class.java,
1618
"music_search_shortcut" to MusicSearchShortcut::class.java,
1719
"password_manager_shortcut" to PasswordManagerShortcut::class.java,
18-
"incognito_shortcut" to IncognitoShortcut::class.java,
1920
"quick_share_shortcut" to QuickShareShortcut::class.java,
2021
"search_shortcut" to SearchShortcut::class.java,
2122
"weather_shortcut" to WeatherShortcut::class.java
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="108"
5+
android:viewportHeight="108">
6+
<path
7+
android:fillColor="#FF34A853"
8+
android:fillType="evenOdd"
9+
android:pathData="M37.33 33c-1.15 0-2.25 0.46-3.06 1.27S33 36.18 33 37.33v10c0 2.4 1.94 4.34 4.33 4.34h10c1.15 0 2.26-0.46 3.07-1.27s1.27-1.92 1.27-3.07v-10c0-1.15-0.46-2.25-1.27-3.06S48.48 33 47.33 33h-10Z" />
10+
<path
11+
android:fillColor="#FFF9BF05"
12+
android:fillType="evenOdd"
13+
android:pathData="M60.67 33c-1.15 0-2.26 0.46-3.07 1.27s-1.27 1.91-1.27 3.06v10c0 2.4 1.94 4.34 4.34 4.34h10c1.15 0 2.25-0.46 3.06-1.27S75 48.48 75 47.33v-10c0-1.15-0.46-2.25-1.27-3.06S71.82 33 70.67 33h-10Z" />
14+
<path
15+
android:fillColor="#FFEA4335"
16+
android:fillType="evenOdd"
17+
android:pathData="M60.67 56.33c-1.15 0-2.26 0.46-3.07 1.27s-1.27 1.92-1.27 3.07v10c0 2.4 1.94 4.33 4.34 4.33h10c1.15 0 2.25-0.46 3.06-1.27S75 71.82 75 70.67v-10c0-1.15-0.46-2.26-1.27-3.07s-1.91-1.27-3.06-1.27h-10Z" />
18+
<path
19+
android:fillColor="#FF4285F4"
20+
android:fillType="evenOdd"
21+
android:pathData="M37.33 56.33c-1.15 0-2.25 0.46-3.06 1.27S33 59.52 33 60.67v10c0 2.4 1.94 4.33 4.33 4.33h10c1.15 0 2.26-0.46 3.07-1.27s1.27-1.91 1.27-3.06v-10c0-1.15-0.46-2.26-1.27-3.07s-1.92-1.27-3.07-1.27h-10Z" />
22+
</vector>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="108"
5+
android:viewportHeight="108">
6+
<path
7+
android:fillColor="@android:color/white"
8+
android:fillType="evenOdd"
9+
android:pathData="M37.33 33c-1.15 0-2.25 0.46-3.06 1.27S33 36.18 33 37.33v10c0 2.4 1.94 4.34 4.33 4.34h10c1.15 0 2.26-0.46 3.07-1.27s1.27-1.92 1.27-3.07v-10c0-1.15-0.46-2.25-1.27-3.06S48.48 33 47.33 33h-10Zm23.34 0c-1.15 0-2.26 0.46-3.07 1.27s-1.27 1.91-1.27 3.06v10c0 2.4 1.94 4.34 4.34 4.34h10c1.15 0 2.25-0.46 3.06-1.27S75 48.48 75 47.33v-10c0-1.15-0.46-2.25-1.27-3.06S71.82 33 70.67 33h-10ZM37.33 56.33c-1.15 0-2.25 0.46-3.06 1.27S33 59.52 33 60.67v10c0 2.4 1.94 4.33 4.33 4.33h10c1.15 0 2.26-0.46 3.07-1.27s1.27-1.91 1.27-3.06v-10c0-1.15-0.46-2.26-1.27-3.07s-1.92-1.27-3.07-1.27h-10Zm23.34 0c-1.15 0-2.26 0.46-3.07 1.27s-1.27 1.92-1.27 3.07v10c0 2.4 1.94 4.33 4.34 4.33h10c1.15 0 2.25-0.46 3.06-1.27S75 71.82 75 70.67v-10c0-1.15-0.46-2.26-1.27-3.07s-1.91-1.27-3.06-1.27h-10Z" />
10+
</vector>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
2+
<background android:drawable="@color/ic_launcher_background" />
3+
<foreground android:drawable="@drawable/ic_launcher_foreground_collections" />
4+
<monochrome android:drawable="@drawable/ic_launcher_monochrome_collections" />
5+
</adaptive-icon>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@
5353
<string name="incognito">متخفٍ</string>
5454
<string name="search">بحث</string>
5555
<string name="history">السجلّ</string>
56+
<string name="collections">المجموعات</string>
5657

5758
<string name="google_not_found">النشاط غير موجود. الرجاء تثبيت أو تفعيل تطبيق Google</string>
5859
<string name="play_services_not_found">النشاط غير موجود. الرجاء تثبيت أو تفعيل خدمات Google Play</string>
5960
<string name="play_games_not_found">النشاط غير موجود. الرجاء تثبيت أو تفعيل ألعاب Google Play</string>
61+
<string name="play_store_not_found">النشاط غير موجود. الرجاء تثبيت أو تفعيل متجر Google Play</string>
6062
<string name="browser_not_found">لم يتم العثور على متصفح، الرجاء تثبيت أو تفعيل المتصفح</string>
6163
<string name="game_manager_not_found">مدير الألعاب غير مدعوم على هذا الجهاز</string>
6264
<string name="files_not_found">الملفات غير مدعومة على هذا الجهاز</string>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@
5353
<string name="incognito">Incógnito</string>
5454
<string name="search">Buscar</string>
5555
<string name="history">Historial</string>
56+
<string name="collections">Colecciones</string>
5657

5758
<string name="google_not_found">Actividad no encontrada. Instale o active Google App</string>
5859
<string name="play_games_not_found">Actividad no encontrada. Instale o active Google Play Games</string>
5960
<string name="play_services_not_found">Actividad no encontrada. Por favor, instale o active Google Play Services</string>
61+
<string name="play_store_not_found">Actividad no encontrada. Instale o active Google Play Store</string>
6062
<string name="browser_not_found">Navegador no encontrado. Instale o active su navegador</string>
6163
<string name="game_manager_not_found">El administrador de juegos no es compatible con este dispositivo</string>
6264
<string name="files_not_found">Archivos no compatibles con este dispositivo</string>

app/src/main/res/values-fa-rIR/strings.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@
5353
<string name="incognito">ناشناس</string>
5454
<string name="search">جستجو</string>
5555
<string name="history">تاریخچه</string>
56+
<string name="collections">مجموعه‌ها</string>
5657

5758
<string name="google_not_found">فعالیت یافت نشد. لطفاً برنامه گوگل را نصب یا فعال کنید</string>
5859
<string name="play_games_not_found">فعالیت یافت نشد. لطفاً بازی‌های گوگل پلی را نصب یا فعال کنید</string>
5960
<string name="play_services_not_found">فعالیت یافت نشد. لطفاً Google Play Services را نصب یا فعال کنید</string>
61+
<string name="play_store_not_found">فعالیت یافت نشد. لطفاً فروشگاه گوگل پلی را نصب یا فعال کنید</string>
6062
<string name="browser_not_found">مرورگری پیدا نشد، لطفا مرورگر خود را نصب یا فعال کنید</string>
6163
<string name="game_manager_not_found">مدیر بازی در این دستگاه پشتیبانی نمی شود</string>
6264
<string name="files_not_found">فایل‌ها در این دستگاه پشتیبانی نمی‌شوند</string>

0 commit comments

Comments
 (0)