Fix #197 Shortcuts for Android 7

Added a shortcut to create a new note for Android 7 and above.
This commit is contained in:
Niedermann IT-Dienstleistungen 2017-04-09 15:45:33 +02:00 committed by GitHub
parent bc4a3f2aac
commit 68aaae4d72
8 changed files with 21 additions and 2 deletions

View file

@ -11,8 +11,8 @@
android:fullBackupContent="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/OwnCloud">
<activity
@ -31,6 +31,8 @@
<meta-data
android:name="android.app.default_searchable"
android:value="it.niedermann.owncloud.notes.android.activity.NotesListViewActivity" />
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

View file

@ -100,10 +100,12 @@
<string name="widget_all_notes_title">All notes</string>
<string name="widget_single_note_title">Single note</string>
<!-- Shortcuts -->
<string name="shortcut_create_long">Create a new note</string>
<!-- Plurals -->
<plurals name="ab_selected">
<item quantity="one">%d selected</item>
<item quantity="other">%d selected</item>
</plurals>
</resources>
</resources>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:shortcutId="it.niedermann.owncloud.notes"
android:enabled="true"
android:icon="@drawable/ic_action_new_theme"
android:shortcutShortLabel="@string/action_create"
android:shortcutLongLabel="@string/shortcut_create_long">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="it.niedermann.owncloud.notes"
android:targetClass="it.niedermann.owncloud.notes.android.activity.CreateNoteActivity" />
<categories android:name="android.shortcut.conversation" />
</shortcut>
</shortcuts>