Commit 465c1b13 authored by Volker Krause's avatar Volker Krause
Browse files

Add Android shortcuts, their equivalent to jump list actions

Translation of the strings.xml content has yet to be sorted out though.
parent e4240f78
......@@ -130,6 +130,8 @@
<!-- auto screen scale factor -->
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="true"/>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts"/>
</activity>
<provider
......
<?xml version='1.0' encoding='utf-8'?>
<!--
SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: CC0-1.0
-->
<resources>
<string name="shortcut_label_current_ticket_short">Current Ticket</string>
<string name="shortcut_label_health_certs_short">Health Certficates</string>
</resources>
<?xml version='1.0' encoding='utf-8'?>
<!--
SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: CC0-1.0
-->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut android:shortcutId="currentTicket" android:enabled="true" android:shortcutShortLabel="@string/shortcut_label_current_ticket_short">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="org.kde.itinerary"
android:targetClass="org.kde.itinerary.Activity"
android:data="page:///currentTicket" />
</shortcut>
<shortcut android:shortcutId="healthCertificates" android:enabled="true" android:shortcutShortLabel="@string/shortcut_label_health_certs_short">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="org.kde.itinerary"
android:targetClass="org.kde.itinerary.Activity"
android:data="page:///healthCert" />
</shortcut>
</shortcuts>
......@@ -206,9 +206,15 @@ void ApplicationController::importFromIntent(const KAndroidExtras::Intent &inten
return;
}
// opening a file
// opening a URL, can be something to import or a shortcut path
if (action == Intent::ACTION_VIEW) {
importFromUrl(intent.getData());
const auto url = intent.getData();
if (url.scheme() == QLatin1String("page")) {
qCDebug(Log) << url;
requestOpenPage(url.path().mid(1));
} else {
importFromUrl(intent.getData());
}
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment