Inital app shortcuts.

This commit is contained in:
Amine 2018-11-07 20:25:48 +01:00
parent c473dd7227
commit fb1614070e
4 changed files with 63 additions and 1 deletions

View File

@ -75,7 +75,6 @@ android {
buildConfigField "String", "LOGIN_URL", appLoginUrl
buildConfigField "String", "LOGIN_USERNAME", appLoginUsername
buildConfigField "String", "LOGIN_PASSWORD", appLoginPassword
applicationIdSuffix ".dev"
}
}
flavorDimensions "build"

View File

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

View File

@ -165,4 +165,5 @@
<string name="new_items_notification_title">New items !</string>
<string name="new_items_notification_text">%1$d new items loaded.</string>
<string name="pref_switch_notify_new_items">Notify on new items synced.</string>
<string name="shortcut_offline">Offline</string>
</resources>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="new"
android:enabled="true"
android:icon="@drawable/ic_fiber_new_black_24dp"
android:shortcutShortLabel="@string/tab_new">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="apps.amine.bou.readerforselfoss"
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
<extra
android:name="shortcutTab"
android:value="1" />
</intent>
</shortcut>
<shortcut
android:shortcutId="read"
android:enabled="true"
android:icon="@drawable/ic_archive_black_24dp"
android:shortcutShortLabel="@string/tab_read">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="apps.amine.bou.readerforselfoss"
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
<extra
android:name="shortcutTab"
android:value="2" />
</intent>
</shortcut>
<shortcut
android:shortcutId="favs"
android:enabled="true"
android:icon="@drawable/ic_favorite_black_24dp"
android:shortcutShortLabel="@string/tab_favs">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="apps.amine.bou.readerforselfoss"
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
<extra
android:name="shortcutTab"
android:value="3" />
</intent>
</shortcut>
<shortcut
android:shortcutId="offline"
android:enabled="true"
android:icon="@drawable/ic_signal_wifi_statusbar_not_connected"
android:shortcutShortLabel="@string/shortcut_offline">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="apps.amine.bou.readerforselfoss"
android:targetClass="apps.amine.bou.readerforselfoss.HomeActivity">
<extra
android:name="startOffline"
android:value="true" />
</intent>
</shortcut>
</shortcuts>