Add app shortcuts for launchers that support them
So a user can go directly to the preferences for example.
@ -31,6 +31,9 @@
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<meta-data
|
||||
android:name="android.app.shortcuts"
|
||||
android:resource="@xml/shortcuts"/>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.CameraActivity"
|
||||
@ -71,7 +74,8 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activity.MainActivity"
|
||||
android:label="@string/app_name"/>
|
||||
android:label="@string/app_name"
|
||||
android:exported="true"/>
|
||||
<provider
|
||||
android:name="android.support.v4.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
|
BIN
app/src/main/res/drawable-hdpi/ic_shortcut_decode.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_shortcut_encode.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-hdpi/ic_shortcut_preferences.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_shortcut_decode.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-ldpi/ic_shortcut_encode.png
Normal file
After Width: | Height: | Size: 899 B |
BIN
app/src/main/res/drawable-ldpi/ic_shortcut_preferences.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_shortcut_decode.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_shortcut_encode.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-mdpi/ic_shortcut_preferences.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_shortcut_decode.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_shortcut_encode.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_shortcut_preferences.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_shortcut_decode.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_shortcut_encode.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_shortcut_preferences.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_shortcut_decode.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_shortcut_encode.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/ic_shortcut_preferences.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
@ -86,4 +86,7 @@
|
||||
<string name="rotate_image_cw">Bild im Uhrzeigersinn rotieren</string>
|
||||
<string name="pick_file">Bilddatei auswählen</string>
|
||||
<string name="pick_code_to_scan">Code im Bild auswählen</string>
|
||||
<string name="shortcut_decode">Barcode einlesen</string>
|
||||
<string name="shortcut_encode">Barcode erstellen</string>
|
||||
<string name="shortcut_preferences">Einstellungen</string>
|
||||
</resources>
|
||||
|
@ -86,4 +86,7 @@
|
||||
<string name="rotate_image_cw">Rotate image clockwise</string>
|
||||
<string name="pick_file">Pick image file</string>
|
||||
<string name="pick_code_to_scan">Pick code to scan</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -86,4 +86,7 @@
|
||||
<string name="rotate_image_cw">Kép forgatása jobbra</string>
|
||||
<string name="pick_file">Képfájl kiválasztása</string>
|
||||
<string name="pick_code_to_scan">Kód kiválasztása a beolvasáshoz</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -85,4 +85,7 @@
|
||||
<string name="rotate_image_cw">Putar gambar searah jarum jam</string>
|
||||
<string name="pick_file">Pilih berkas gambar</string>
|
||||
<string name="pick_code_to_scan">Pilih kode untuk dipindai</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -86,4 +86,7 @@
|
||||
<string name="rotate_image_cw">Ruota immagine in senso orario</string>
|
||||
<string name="pick_file">Scegli file immagine</string>
|
||||
<string name="pick_code_to_scan">Scegli codice da scansionare</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -86,4 +86,7 @@
|
||||
<string name="rotate_image_cw">Rotate image clockwise</string>
|
||||
<string name="pick_file">Pick image file</string>
|
||||
<string name="pick_code_to_scan">Pick code to scan</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -86,4 +86,7 @@
|
||||
<string name="rotate_image_cw">Rotate image clockwise</string>
|
||||
<string name="pick_file">Pick image file</string>
|
||||
<string name="pick_code_to_scan">Pick code to scan</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -82,4 +82,7 @@
|
||||
<string name="rotate_image_cw">Rotate image clockwise</string>
|
||||
<string name="pick_file">Pick image file</string>
|
||||
<string name="pick_code_to_scan">Pick code to scan</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -85,4 +85,7 @@
|
||||
<string name="rotate_image_cw">旋转图片</string>
|
||||
<string name="pick_file">选择图片文件</string>
|
||||
<string name="pick_code_to_scan">选择扫描的编码</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -85,4 +85,7 @@
|
||||
<string name="rotate_image_cw">Rotate image clockwise</string>
|
||||
<string name="pick_file">Pick image file</string>
|
||||
<string name="pick_code_to_scan">Pick code to scan</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
@ -86,4 +86,7 @@
|
||||
<string name="rotate_image_cw">Rotate image clockwise</string>
|
||||
<string name="pick_file">Pick image file</string>
|
||||
<string name="pick_code_to_scan">Pick code to scan</string>
|
||||
<string name="shortcut_decode">Scan a barcode</string>
|
||||
<string name="shortcut_encode">Create a barcode</string>
|
||||
<string name="shortcut_preferences">Settings</string>
|
||||
</resources>
|
||||
|
42
app/src/main/res/xml/shortcuts.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<shortcuts
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="UnusedAttribute">
|
||||
<shortcut
|
||||
android:shortcutId="decode"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_shortcut_decode"
|
||||
android:shortcutShortLabel="@string/shortcut_decode"
|
||||
android:shortcutDisabledMessage="@string/shortcut_decode">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetPackage="de.markusfisch.android.binaryeye"
|
||||
android:targetClass="de.markusfisch.android.binaryeye.activity.CameraActivity"/>
|
||||
</shortcut>
|
||||
<shortcut
|
||||
android:shortcutId="encode"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_shortcut_encode"
|
||||
android:shortcutShortLabel="@string/shortcut_encode"
|
||||
android:shortcutDisabledMessage="@string/shortcut_encode">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetPackage="de.markusfisch.android.binaryeye"
|
||||
android:targetClass="de.markusfisch.android.binaryeye.activity.MainActivity">
|
||||
<extra android:name="encode" android:value="encode"/>
|
||||
</intent>
|
||||
</shortcut>
|
||||
<shortcut
|
||||
android:shortcutId="preferences"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_shortcut_preferences"
|
||||
android:shortcutShortLabel="@string/shortcut_preferences"
|
||||
android:shortcutDisabledMessage="@string/shortcut_preferences">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetPackage="de.markusfisch.android.binaryeye"
|
||||
android:targetClass="de.markusfisch.android.binaryeye.activity.MainActivity">
|
||||
<extra android:name="preferences" android:value="preferences"/>
|
||||
</intent>
|
||||
</shortcut>
|
||||
</shortcuts>
|
91
svg/ic_shortcut_decode.svg
Normal file
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="Ebene_1"
|
||||
x="0px"
|
||||
y="0px"
|
||||
viewBox="0 0 48.000002 48.000002"
|
||||
xml:space="preserve"
|
||||
inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
|
||||
sodipodi:docname="ic_shortcut_decode.svg"
|
||||
width="48"
|
||||
height="48">
|
||||
<metadata
|
||||
id="metadata23">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
|
||||
<dc:title />
|
||||
|
||||
</cc:Work>
|
||||
|
||||
</rdf:RDF>
|
||||
|
||||
</metadata>
|
||||
|
||||
<defs
|
||||
id="defs21" />
|
||||
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:window-height="907"
|
||||
id="namedview19"
|
||||
showgrid="false"
|
||||
inkscape:showpageshadow="false"
|
||||
inkscape:zoom="7.9431804"
|
||||
inkscape:cx="24.000002"
|
||||
inkscape:cy="24.000002"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="Ebene_1"
|
||||
inkscape:document-rotation="0" />
|
||||
|
||||
<style
|
||||
type="text/css"
|
||||
id="style3">
|
||||
.st0{clip-path:url(#SVGID_2_);fill:#FFFFFF;}
|
||||
</style>
|
||||
|
||||
<circle
|
||||
style="fill:#b6d46f;fill-opacity:1"
|
||||
id="path4134"
|
||||
cx="24.000002"
|
||||
cy="24.000002"
|
||||
r="22.000004" />
|
||||
|
||||
<circle
|
||||
style="opacity:1;fill:#ffffff;stop-opacity:1"
|
||||
cx="24"
|
||||
cy="24"
|
||||
r="3.2"
|
||||
id="circle911" />
|
||||
|
||||
<path
|
||||
style="opacity:1;fill:#ffffff;stop-opacity:1"
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 21,14 -1.83,2 H 16 c -1.1,0 -2,0.9 -2,2 v 12 c 0,1.1 0.9,2 2,2 h 16 c 1.1,0 2,-0.9 2,-2 V 18 c 0,-1.1 -0.9,-2 -2,-2 H 28.83 L 27,14 Z m 3,15 c -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 0,2.76 -2.24,5 -5,5 z"
|
||||
id="path913" />
|
||||
|
||||
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
72
svg/ic_shortcut_encode.svg
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
height="48"
|
||||
width="48"
|
||||
sodipodi:docname="ic_shortcut_encode.svg"
|
||||
inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
|
||||
xml:space="preserve"
|
||||
viewBox="0 0 48.000002 48.000002"
|
||||
y="0px"
|
||||
x="0px"
|
||||
id="Ebene_1"
|
||||
version="1.1">
|
||||
<metadata
|
||||
id="metadata23">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs21" />
|
||||
<sodipodi:namedview
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:current-layer="Ebene_1"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-x="0"
|
||||
inkscape:cy="24.000002"
|
||||
inkscape:cx="24.000002"
|
||||
inkscape:zoom="5.6166768"
|
||||
inkscape:showpageshadow="false"
|
||||
showgrid="false"
|
||||
id="namedview19"
|
||||
inkscape:window-height="907"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0"
|
||||
guidetolerance="10"
|
||||
gridtolerance="10"
|
||||
objecttolerance="10"
|
||||
borderopacity="1"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff" />
|
||||
<style
|
||||
id="style3"
|
||||
type="text/css">
|
||||
.st0{clip-path:url(#SVGID_2_);fill:#FFFFFF;}
|
||||
</style>
|
||||
<circle
|
||||
r="22.000004"
|
||||
cy="24.000002"
|
||||
cx="24.000002"
|
||||
id="path4134"
|
||||
style="fill:#b6d46f;fill-opacity:1" />
|
||||
<path
|
||||
id="path879"
|
||||
d="m 31,25 h -6 v 6 h -2 v -6 h -6 v -2 h 6 v -6 h 2 v 6 h 6 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="opacity:1;stop-opacity:1;fill:#ffffff" />
|
||||
</svg>
|
After Width: | Height: | Size: 2.0 KiB |
72
svg/ic_shortcut_preferences.svg
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
height="48"
|
||||
width="48"
|
||||
sodipodi:docname="ic_shortcut_preferences.svg"
|
||||
inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
|
||||
xml:space="preserve"
|
||||
viewBox="0 0 48.000002 48.000002"
|
||||
y="0px"
|
||||
x="0px"
|
||||
id="Ebene_1"
|
||||
version="1.1">
|
||||
<metadata
|
||||
id="metadata23">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs21" />
|
||||
<sodipodi:namedview
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:current-layer="Ebene_1"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-x="0"
|
||||
inkscape:cy="24.000002"
|
||||
inkscape:cx="24.000002"
|
||||
inkscape:zoom="11.233354"
|
||||
inkscape:showpageshadow="false"
|
||||
showgrid="false"
|
||||
id="namedview19"
|
||||
inkscape:window-height="907"
|
||||
inkscape:window-width="1600"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0"
|
||||
guidetolerance="10"
|
||||
gridtolerance="10"
|
||||
objecttolerance="10"
|
||||
borderopacity="1"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff" />
|
||||
<style
|
||||
id="style3"
|
||||
type="text/css">
|
||||
.st0{clip-path:url(#SVGID_2_);fill:#FFFFFF;}
|
||||
</style>
|
||||
<circle
|
||||
r="22.000004"
|
||||
cy="24.000002"
|
||||
cx="24.000002"
|
||||
id="path4134"
|
||||
style="fill:#b6d46f;fill-opacity:1" />
|
||||
<path
|
||||
id="path895"
|
||||
d="m 31.14,24.94 c 0.04,-0.3 0.06,-0.61 0.06,-0.94 0,-0.32 -0.02,-0.64 -0.07,-0.94 l 2.03,-1.58 c 0.18,-0.14 0.23,-0.41 0.12,-0.61 l -1.92,-3.32 c -0.12,-0.22 -0.37,-0.29 -0.59,-0.22 l -2.39,0.96 c -0.5,-0.38 -1.03,-0.7 -1.62,-0.94 L 26.4,14.81 C 26.36,14.57 26.16,14.4 25.92,14.4 h -3.84 c -0.24,0 -0.43,0.17 -0.47,0.41 l -0.36,2.54 c -0.59,0.24 -1.13,0.57 -1.62,0.94 l -2.39,-0.96 c -0.22,-0.08 -0.47,0 -0.59,0.22 l -1.91,3.32 c -0.12,0.21 -0.08,0.47 0.12,0.61 l 2.03,1.58 c -0.05,0.3 -0.09,0.63 -0.09,0.94 0,0.31 0.02,0.64 0.07,0.94 l -2.03,1.58 c -0.18,0.14 -0.23,0.41 -0.12,0.61 l 1.92,3.32 c 0.12,0.22 0.37,0.29 0.59,0.22 l 2.39,-0.96 c 0.5,0.38 1.03,0.7 1.62,0.94 l 0.36,2.54 c 0.05,0.24 0.24,0.41 0.48,0.41 h 3.84 c 0.24,0 0.44,-0.17 0.47,-0.41 l 0.36,-2.54 c 0.59,-0.24 1.13,-0.56 1.62,-0.94 l 2.39,0.96 c 0.22,0.08 0.47,0 0.59,-0.22 l 1.92,-3.32 c 0.12,-0.22 0.07,-0.47 -0.12,-0.61 z M 24,27.6 c -1.98,0 -3.6,-1.62 -3.6,-3.6 0,-1.98 1.62,-3.6 3.6,-3.6 1.98,0 3.6,1.62 3.6,3.6 0,1.98 -1.62,3.6 -3.6,3.6 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="opacity:1;fill:#ffffff;stop-opacity:1" />
|
||||
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
@ -111,6 +111,9 @@ svg/ic_launcher.svg 48
|
||||
EOF
|
||||
|
||||
update app/src/main/res/drawable << EOF
|
||||
svg/wallpaper.svg 384
|
||||
svg/ic_shortcut_decode.svg 48
|
||||
svg/ic_shortcut_encode.svg 48
|
||||
svg/ic_shortcut_preferences.svg 48
|
||||
svg/logo.svg 80
|
||||
svg/wallpaper.svg 384
|
||||
EOF
|
||||
|