瀏覽代碼

feat: app shortcuts (#259)

Reviewed-on: https://gitea.angry.im/PeterCxy/OpenEUICC/pulls/259
Co-authored-by: septs <github@septs.pw>
Co-committed-by: septs <github@septs.pw>
septs 2 月之前
父節點
當前提交
69fe2764c9

+ 6 - 0
app-common/src/main/AndroidManifest.xml

@@ -36,6 +36,12 @@
             android:exported="true"
             android:name="im.angry.openeuicc.ui.wizard.DownloadWizardActivity"
             android:label="@string/download_wizard">
+
+            <intent-filter>
+                <action android:name="im.angry.openeuicc.action.DOWNLOAD_WIZARD_ACTIVITY" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
 

+ 11 - 0
app-common/src/main/res/xml/shortcuts.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
+    <!-- https://developer.android.com/develop/ui/views/launch/shortcuts -->
+    <shortcut
+        android:enabled="true"
+        android:icon="@drawable/ic_task_sim_card_download"
+        android:shortcutId="download"
+        android:shortcutShortLabel="@string/profile_download">
+        <intent android:action="im.angry.openeuicc.action.DOWNLOAD_WIZARD_ACTIVITY" />
+    </shortcut>
+</shortcuts>

+ 4 - 0
app-unpriv/src/main/AndroidManifest.xml

@@ -21,6 +21,10 @@
 
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
+
+            <meta-data
+                android:name="android.app.shortcuts"
+                android:resource="@xml/shortcuts" />
         </activity>
 
         <activity