Added option to scan QR codes directly from the app

This commit is contained in:
2016-02-06 13:25:04 +01:00
parent a3c3fc082d
commit a4f6642f6a
8 changed files with 120 additions and 36 deletions

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#DEFFFFFF"
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
</vector>

View File

@ -0,0 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path android:fillColor="#000" android:pathData="M3,11H5V13H3V11M11,5H13V9H11V5M9,11H13V15H11V13H9V11M15,11H17V13H19V11H21V13H19V15H21V19H19V21H17V19H13V21H11V17H15V15H17V13H15V11M19,19V15H17V19H19M15,3H21V9H15V3M17,5V7H19V5H17M3,3H9V9H3V3M5,5V7H7V5H5M3,15H9V21H3V15M5,17V19H7V17H5Z" />
</vector>

View File

@ -5,25 +5,28 @@
android:layout_height="match_parent">
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@id/android:list"
android:id="@id/android:list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="88dp"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"/>
android:clipToPadding="false"
android:paddingBottom="88dp"
android:scrollbarStyle="outsideOverlay"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_add_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_action_add_contact"
app:elevation="8dp"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_margin="16dp"/>
<io.github.yavski.fabspeeddial.FabSpeedDial
android:id="@+id/fab_add_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/ic_action_add_contact"
app:elevation="8dp"
app:fabGravity="bottom_end"
app:fabMenu="@menu/fab_address"/>
</RelativeLayout>

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Christian Basler
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_read_qr_code"
android:icon="@drawable/ic_action_qr_code"
android:title="@string/scan_qr_code"/>
<item
android:id="@+id/action_create_contact"
android:icon="@drawable/ic_action_create_contact"
android:title="@string/create_contact"/>
</menu>

View File

@ -63,4 +63,6 @@
<string name="share">Teilen</string>
<string name="delete_contact_warning">Sind Sie sicher dass dieser Kontakt gelöscht werden soll?</string>
<string name="delete_identity_warning">Sind Sie sicher dass diese Identität gelöscht werden soll? Sie werden keine Nachrichten mehr empfangen können welche an diese Adresse gesendet werden, und es est nicht möglich diese Aktion rückgängig zu machen.</string>
<string name="create_contact">Kontakt erfassen</string>
<string name="scan_qr_code">QR-Code scannen</string>
</resources>

View File

@ -66,4 +66,6 @@
<string name="share">Share</string>
<string name="delete_identity_warning">Are you sure you want to delete this identity? You won\'t be able to receive any messages sent to this address and can\'t undo this operation.</string>
<string name="delete_contact_warning">Are you sure you want to delete this contact?</string>
<string name="scan_qr_code">Scan QR code</string>
<string name="create_contact">Create contact</string>
</resources>