First part of BQP UI improvements.

Includes parallel improvements to Bluetooth key exchange UI.
This commit is contained in:
str4d
2016-04-01 03:24:24 +00:00
committed by akwizgran
parent 5f5ceedc29
commit b81a567468
22 changed files with 443 additions and 134 deletions

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="svg2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="-47 347.2 409.2 161.7" style="enable-background:new -47 347.2 409.2 161.7;" xml:space="preserve">
<style type="text/css">
.st0{display:none;fill:none;stroke:#FFFFFF;stroke-width:4.3281;}
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#020202;}
</style>
<path id="path4201" d="M322.8,504.6l-4.3-4.3l-7.1-2.4c-3.9-1.3-8.7-3-10.7-3.7l-3.7-1.3l3.5-0.2c8.2-0.4,13-4,14.3-10.9
c0.8-4.1,1.1-17.3,0.8-33c-0.2-8.1-0.2-15.4,0-16.3c0.1-0.9,0.5-2.4,0.9-3.4c1.2-3.5,0.3-11.9-1.9-17.6c-0.3-0.9-1.9-4.2-3.5-7.4
c-4.2-8.2-4.5-8.9-4.9-10.5c-0.5-1.8-0.2-5.4,0.5-6.8c0.7-1.3,2.2-2.9,3.2-3.5c1.3-0.7,2.6,0.1,4.7,2.9c3.4,4.5,14,19.4,15.7,22.2
c3.7,6,6,11.2,8,18.8c0.7,2.5,1.9,7,2.7,10.1c0.8,3.1,2.7,10.2,4.1,15.8l2.6,10.2l4.6,5.2c2.6,2.9,5.8,6.5,7.2,8
c1.4,1.6,2.5,3,2.5,3.2c0,0.3-34.5,29.3-34.9,29.3C327.2,508.9,325.2,506.9,322.8,504.6z M228.9,488.2c-1.3-0.6-2.2-1.4-2.9-2.3
c-2.1-2.7-2,2.4-1.9-68.5l0.1-64l0.7-1.2c1-1.9,2-2.9,3.7-3.9l1.6-0.9l37.8-0.1c42.5-0.1,39.4-0.2,42.1,2.2c0.9,0.8,1.8,2,2.2,2.9
c0.7,1.6,0.7,1.6,0.8,14.2l0.1,12.6l-1.8-0.1c-1.4-0.1-2.1,0-3.2,0.5c-2,1-3.9,2.9-5.1,5.1l-1,2l0-12.8l0-12.8h-33.6h-33.6v51.3
v51.3h33.6h33.6l0.1-34.4c0.1-33,0.1-34.4,0.6-32.9c0.3,0.8,1.8,4,3.4,7c5.5,10.6,5.4,9.9,5.4,47.2c0,27.6-0.1,30-1.7,33.1
c-1.1,2.2-2.7,3.7-5.1,4.7l-1.7,0.7L267,489l-36.2,0.1L228.9,488.2L228.9,488.2z M271.3,483.1c2.9-1.3,4.5-3.7,4.4-6.6
c0-4.1-3.1-7.2-7.1-7.2c-2.1,0-3.6,0.6-5.2,2.2c-2.2,2.2-2.8,5.4-1.3,8.3c0.7,1.4,2.5,3,4,3.5C267.6,483.8,270,483.8,271.3,483.1z"
/>
<path id="path4201-1" d="M-7.6,504.6l4.3-4.3l7.1-2.4c3.9-1.3,8.7-3,10.7-3.7l3.7-1.3l-3.5-0.2c-8.2-0.4-13-4-14.3-10.9
c-0.8-4.1-1.1-17.3-0.8-33c0.2-8.1,0.2-15.4,0-16.3c-0.1-0.9-0.5-2.4-0.9-3.4c-1.2-3.5-0.3-11.9,1.9-17.6c0.3-0.9,1.9-4.2,3.5-7.4
c4.2-8.2,4.5-8.9,4.9-10.5c0.5-1.8,0.2-5.4-0.5-6.8c-0.7-1.3-2.2-2.9-3.2-3.5c-1.3-0.7-2.6,0.1-4.7,2.9c-3.4,4.5-14,19.4-15.7,22.2
c-3.7,6-6,11.2-8,18.8c-0.7,2.5-1.9,7-2.7,10.1c-0.8,3.1-2.7,10.2-4.1,15.8l-2.6,10.2l-4.6,5.2c-2.6,2.9-5.8,6.5-7.2,8
s-2.5,3-2.5,3.2c0,0.3,34.5,29.3,34.9,29.3C-12,508.9-9.9,506.9-7.6,504.6z M86.3,488.2c1.3-0.6,2.2-1.4,2.9-2.3
c2.1-2.7,2,2.4,1.9-68.5l-0.1-64l-0.7-1.2c-1-1.9-2-2.9-3.7-3.9l-1.6-0.9l-37.8-0.1c-42.5-0.1-39.4-0.2-42.1,2.2
c-0.9,0.8-1.8,2-2.2,2.9c-0.7,1.6-0.7,1.6-0.8,14.2L2,379.2l1.8-0.1c1.4-0.1,2.1,0,3.2,0.5c2,1,3.9,2.9,5.1,5.1l1,2l0-12.8l0-12.8
h33.6h33.6v51.3v51.3H46.8H13.2l-0.1-34.4c-0.1-33-0.1-34.4-0.6-32.9c-0.3,0.8-1.8,4-3.4,7c-5.5,10.6-5.4,9.9-5.4,47.2
c0,27.6,0.1,30,1.7,33.1c1.1,2.2,2.7,3.7,5.1,4.7l1.7,0.7l36.2,0.1l36.2,0.1L86.3,488.2L86.3,488.2z M43.9,483.1
c-2.9-1.3-4.5-3.7-4.4-6.6c0-4.1,3.1-7.2,7.1-7.2c2.1,0,3.6,0.6,5.2,2.2c2.2,2.2,2.8,5.4,1.3,8.3c-0.7,1.4-2.5,3-4,3.5
C47.6,483.8,45.3,483.8,43.9,483.1z"/>
<g>
<path d="M33.5,410.2h2.3v2.3h2.3v2.3H26.6v-2.3h2.3v-4.6h4.6L33.5,410.2L33.5,410.2z M63.5,431h2.3v-2.3h-2.3V431z M35.8,410.2h2.3
v-2.3h-2.3V410.2z M68.1,431h2.3v-2.3h-2.3V431z M40.4,433.3H45V431h-4.6V433.3z M61.2,433.3V431h-2.3v2.3H61.2z M52,433.3h2.3
v-4.6H52V433.3z M33.5,403.3v2.3h6.9v-2.3H33.5z M31.2,405.6v-2.3h-4.6v4.6h2.3v-2.3H31.2z M38.1,401H22v-16.1h16.1V401z
M35.8,387.2H24.3v11.5h11.5V387.2z M26.6,428.7h6.9v-6.9h-6.9V428.7z M49.6,426.3v2.3H52v-2.3H49.6z M33.5,389.5h-6.9v6.9h6.9
V389.5z M70.4,384.9V401H54.3v-16.1H70.4z M68.1,387.2H56.6v11.5h11.5V387.2z M22,417.1h16.1v16.1H22V417.1z M24.3,431h11.5v-11.5
H24.3V431z M24.3,403.3H22v11.5h2.3V403.3z M54.3,414.8v2.3h2.3v-2.3H54.3z M47.3,424.1v-2.3H45v2.3h-4.6v4.6H45v2.3h2.3v-4.6h2.3
v-2.3H47.3z M40.4,394.1H45v-2.3h-4.6V394.1z M58.9,412.5h4.6v2.3h2.3v-6.9h-2.3v-4.6h-2.3v6.9h-6.9v2.3h2.3v2.3h2.3V412.5z
M61.2,419.4h-2.3v-2.3h-2.3v4.6h-6.9v2.3h4.6v4.6h2.3v2.3h2.3v-4.6h9.2v-2.3h-6.9V419.4z M61.2,419.4h2.3v-4.6h-2.3V419.4z
M42.7,419.4v-2.3H45v-2.3h2.3v-2.3h2.3v-4.6h6.9v-4.6h-2.3v2.3H52v-9.2h-2.3v-4.6H52v-6.9h-2.3v4.6h-2.3v-4.6h-6.9v4.6h2.3v-2.3
H45v4.6h2.3v6.9h2.3v2.3h-2.3v4.6H45V401h-2.3v-2.3h-2.3v4.6h2.3v2.3h-2.3v6.9h2.3v-4.6H45v4.6h-2.3v2.3h-2.3v6.9H45v-2.3H42.7z
M68.1,421.7v-2.3h-4.6v2.3H68.1z M65.8,389.5h-6.9v6.9h6.9V389.5z M47.3,419.4H52v-2.3h-2.3v-2.3h-2.3V419.4z M52,414.8v-2.3h-2.3
v2.3H52z M65.8,405.6h4.6v-2.3h-4.6V405.6z M68.1,424.1h2.3v-2.3h-2.3V424.1z M68.1,410.2h2.3v-2.3h-2.3V410.2z M47.3,398.7H45v2.3
h2.3V398.7z M47.3,398.7"/>
</g>
<g>
<path d="M256.5,410.2h2.3v2.3h2.3v2.3h-11.5v-2.3h2.3v-4.6h4.6L256.5,410.2L256.5,410.2z M286.5,431h2.3v-2.3h-2.3V431z
M258.8,410.2h2.3v-2.3h-2.3V410.2z M291.1,431h2.3v-2.3h-2.3V431z M263.4,433.3h4.6V431h-4.6V433.3z M284.2,433.3V431h-2.3v2.3
H284.2z M275,433.3h2.3v-4.6H275V433.3z M256.5,403.3v2.3h6.9v-2.3H256.5z M254.2,405.6v-2.3h-4.6v4.6h2.3v-2.3H254.2z M261.1,401
H245v-16.1h16.1V401z M258.8,387.2h-11.5v11.5h11.5V387.2z M249.6,428.7h6.9v-6.9h-6.9V428.7z M272.6,426.3v2.3h2.3v-2.3H272.6z
M256.5,389.5h-6.9v6.9h6.9V389.5z M293.4,384.9V401h-16.1v-16.1H293.4z M291.1,387.2h-11.5v11.5h11.5V387.2z M245,417.1h16.1v16.1
H245V417.1z M247.3,431h11.5v-11.5h-11.5V431z M247.3,403.3H245v11.5h2.3V403.3z M277.3,414.8v2.3h2.3v-2.3H277.3z M270.3,424.1
v-2.3H268v2.3h-4.6v4.6h4.6v2.3h2.3v-4.6h2.3v-2.3H270.3z M263.4,394.1h4.6v-2.3h-4.6V394.1z M281.9,412.5h4.6v2.3h2.3v-6.9h-2.3
v-4.6h-2.3v6.9h-6.9v2.3h2.3v2.3h2.3V412.5z M284.2,419.4h-2.3v-2.3h-2.3v4.6h-6.9v2.3h4.6v4.6h2.3v2.3h2.3v-4.6h9.2v-2.3h-6.9
V419.4z M284.2,419.4h2.3v-4.6h-2.3V419.4z M265.7,419.4v-2.3h2.3v-2.3h2.3v-2.3h2.3v-4.6h6.9v-4.6h-2.3v2.3H275v-9.2h-2.3v-4.6
h2.3v-6.9h-2.3v4.6h-2.3v-4.6h-6.9v4.6h2.3v-2.3h2.3v4.6h2.3v6.9h2.3v2.3h-2.3v4.6H268V401h-2.3v-2.3h-2.3v4.6h2.3v2.3h-2.3v6.9
h2.3v-4.6h2.3v4.6h-2.3v2.3h-2.3v6.9h4.6v-2.3H265.7z M291.1,421.7v-2.3h-4.6v2.3H291.1z M288.8,389.5h-6.9v6.9h6.9V389.5z
M270.3,419.4h4.6v-2.3h-2.3v-2.3h-2.3V419.4z M275,414.8v-2.3h-2.3v2.3H275z M288.8,405.6h4.6v-2.3h-4.6V405.6z M291.1,424.1h2.3
v-2.3h-2.3V424.1z M291.1,410.2h2.3v-2.3h-2.3V410.2z M270.3,398.7H268v2.3h2.3V398.7z M270.3,398.7"/>
</g>
<polygon class="st0" points="152,392 152,411.8 110,411.8 126,383.1 126,392 "/>
<polygon class="st0" points="152,392 152,411.8 110,411.8 126,383.1 126,392 "/>
<g>
<path class="st1" d="M132.6,396.1l-20.6,18l20.6,16.7v-5.2H152v-24.3h-19.3V396.1z"/>
<path class="st1" d="M182.4,430.9l20.6-18l-20.6-16.7v5.2H163v24.3h19.3V430.9z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="499.24373dp"
android:height="175.49413dp"
android:viewportWidth="499.24373"

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="#FF000000"
android:pathData="M16.59,8.59L12,13.17 7.41,8.59 6,10l6,6 6,-6z"/>
</vector>

View File

@@ -0,0 +1,24 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="409dp"
android:height="162dp"
android:viewportHeight="161.7"
android:viewportWidth="409.2">
<path
android:fillColor="#FF000000"
android:pathData="M369.8,157.4l-4.3,-4.3l-7.1,-2.4c-3.9,-1.3 -8.7,-3 -10.7,-3.7l-3.7,-1.3l3.5,-0.2c8.2,-0.4 13,-4 14.3,-10.9c0.8,-4.1 1.1,-17.3 0.8,-33c-0.2,-8.1 -0.2,-15.4 0,-16.3c0.1,-0.9 0.5,-2.4 0.9,-3.4c1.2,-3.5 0.3,-11.9 -1.9,-17.6c-0.3,-0.9 -1.9,-4.2 -3.5,-7.4c-4.2,-8.2 -4.5,-8.9 -4.9,-10.5c-0.5,-1.8 -0.2,-5.4 0.5,-6.8c0.7,-1.3 2.2,-2.9 3.2,-3.5c1.3,-0.7 2.6,0.1 4.7,2.9c3.4,4.5 14,19.4 15.7,22.2c3.7,6 6,11.2 8,18.8c0.7,2.5 1.9,7 2.7,10.1c0.8,3.1 2.7,10.2 4.1,15.8l2.6,10.2l4.6,5.2c2.6,2.9 5.8,6.5 7.2,8c1.4,1.6 2.5,3 2.5,3.2c0,0.3 -34.5,29.3 -34.9,29.3C374.2,161.7 372.2,159.7 369.8,157.4zM275.9,141c-1.3,-0.6 -2.2,-1.4 -2.9,-2.3c-2.1,-2.7 -2,2.4 -1.9,-68.5l0.1,-64l0.7,-1.2c1,-1.9 2,-2.9 3.7,-3.9l1.6,-0.9l37.8,-0.1c42.5,-0.1 39.4,-0.2 42.1,2.2c0.9,0.8 1.8,2 2.2,2.9c0.7,1.6 0.7,1.6 0.8,14.2l0.1,12.6l-1.8,-0.1c-1.4,-0.1 -2.1,0 -3.2,0.5c-2,1 -3.9,2.9 -5.1,5.1l-1,2l0,-12.8l0,-12.8h-33.6h-33.6v51.3v51.3h33.6h33.6l0.1,-34.4c0.1,-33 0.1,-34.4 0.6,-32.9c0.3,0.8 1.8,4 3.4,7c5.5,10.6 5.4,9.9 5.4,47.2c0,27.6 -0.1,30 -1.7,33.1c-1.1,2.2 -2.7,3.7 -5.1,4.7l-1.7,0.7L314,141.8l-36.2,0.1L275.9,141L275.9,141zM318.3,135.9c2.9,-1.3 4.5,-3.7 4.4,-6.6c0,-4.1 -3.1,-7.2 -7.1,-7.2c-2.1,0 -3.6,0.6 -5.2,2.2c-2.2,2.2 -2.8,5.4 -1.3,8.3c0.7,1.4 2.5,3 4,3.5C314.6,136.6 317,136.6 318.3,135.9z"/>
<path
android:fillColor="#FF000000"
android:pathData="M39.4,157.4l4.3,-4.3l7.1,-2.4c3.9,-1.3 8.7,-3 10.7,-3.7l3.7,-1.3l-3.5,-0.2c-8.2,-0.4 -13,-4 -14.3,-10.9c-0.8,-4.1 -1.1,-17.3 -0.8,-33c0.2,-8.1 0.2,-15.4 0,-16.3c-0.1,-0.9 -0.5,-2.4 -0.9,-3.4c-1.2,-3.5 -0.3,-11.9 1.9,-17.6c0.3,-0.9 1.9,-4.2 3.5,-7.4c4.2,-8.2 4.5,-8.9 4.9,-10.5c0.5,-1.8 0.2,-5.4 -0.5,-6.8c-0.7,-1.3 -2.2,-2.9 -3.2,-3.5c-1.3,-0.7 -2.6,0.1 -4.7,2.9c-3.4,4.5 -14,19.4 -15.7,22.2c-3.7,6 -6,11.2 -8,18.8c-0.7,2.5 -1.9,7 -2.7,10.1c-0.8,3.1 -2.7,10.2 -4.1,15.8l-2.6,10.2l-4.6,5.2c-2.6,2.9 -5.8,6.5 -7.2,8s-2.5,3 -2.5,3.2c0,0.3 34.5,29.3 34.9,29.3C35,161.7 37.1,159.7 39.4,157.4zM133.3,141c1.3,-0.6 2.2,-1.4 2.9,-2.3c2.1,-2.7 2,2.4 1.9,-68.5l-0.1,-64l-0.7,-1.2c-1,-1.9 -2,-2.9 -3.7,-3.9l-1.6,-0.9l-37.8,-0.1c-42.5,-0.1 -39.4,-0.2 -42.1,2.2c-0.9,0.8 -1.8,2 -2.2,2.9c-0.7,1.6 -0.7,1.6 -0.8,14.2L49,32l1.8,-0.1c1.4,-0.1 2.1,0 3.2,0.5c2,1 3.9,2.9 5.1,5.1l1,2l0,-12.8l0,-12.8h33.6h33.6v51.3v51.3L93.8,116.5L60.2,116.5l-0.1,-34.4c-0.1,-33 -0.1,-34.4 -0.6,-32.9c-0.3,0.8 -1.8,4 -3.4,7c-5.5,10.6 -5.4,9.9 -5.4,47.2c0,27.6 0.1,30 1.7,33.1c1.1,2.2 2.7,3.7 5.1,4.7l1.7,0.7l36.2,0.1l36.2,0.1L133.3,141L133.3,141zM90.9,135.9c-2.9,-1.3 -4.5,-3.7 -4.4,-6.6c0,-4.1 3.1,-7.2 7.1,-7.2c2.1,0 3.6,0.6 5.2,2.2c2.2,2.2 2.8,5.4 1.3,8.3c-0.7,1.4 -2.5,3 -4,3.5C94.6,136.6 92.3,136.6 90.9,135.9z"/>
<path
android:fillColor="#FF000000"
android:pathData="M80.5,63h2.3v2.3h2.3v2.3L73.6,67.6v-2.3h2.3v-4.6h4.6L80.5,63L80.5,63zM110.5,83.8h2.3v-2.3h-2.3L110.5,83.8zM82.8,63h2.3v-2.3h-2.3L82.8,63zM115.1,83.8h2.3v-2.3h-2.3L115.1,83.8zM87.4,86.1L92,86.1L92,83.8h-4.6L87.4,86.1zM108.2,86.1L108.2,83.8h-2.3v2.3L108.2,86.1zM99,86.1h2.3v-4.6L99,81.5L99,86.1zM80.5,56.1v2.3h6.9v-2.3L80.5,56.1zM78.2,58.4v-2.3h-4.6v4.6h2.3v-2.3L78.2,58.4zM85.1,53.8L69,53.8v-16.1h16.1L85.1,53.8zM82.8,40L71.3,40v11.5h11.5L82.8,40zM73.6,81.5h6.9v-6.9h-6.9L73.6,81.5zM96.6,79.1v2.3L99,81.4v-2.3L96.6,79.1zM80.5,42.3h-6.9v6.9h6.9L80.5,42.3zM117.4,37.7L117.4,53.8L101.3,53.8v-16.1L117.4,37.7zM115.1,40L103.6,40v11.5h11.5L115.1,40zM69,69.9h16.1v16.1L69,86L69,69.9zM71.3,83.8h11.5v-11.5L71.3,72.3L71.3,83.8zM71.3,56.1L69,56.1v11.5h2.3L71.3,56.1zM101.3,67.6v2.3h2.3v-2.3L101.3,67.6zM94.3,76.9v-2.3L92,74.6v2.3h-4.6v4.6L92,81.5v2.3h2.3v-4.6h2.3v-2.3L94.3,76.9zM87.4,46.9L92,46.9v-2.3h-4.6L87.4,46.9zM105.9,65.3h4.6v2.3h2.3v-6.9h-2.3v-4.6h-2.3v6.9h-6.9v2.3h2.3v2.3h2.3L105.9,65.3zM108.2,72.2h-2.3v-2.3h-2.3v4.6h-6.9v2.3h4.6v4.6h2.3v2.3h2.3v-4.6h9.2v-2.3h-6.9L108.2,72.2zM108.2,72.2h2.3v-4.6h-2.3L108.2,72.2zM89.7,72.2v-2.3L92,69.9v-2.3h2.3v-2.3h2.3v-4.6h6.9v-4.6h-2.3v2.3L99,58.4v-9.2h-2.3v-4.6L99,44.6v-6.9h-2.3v4.6h-2.3v-4.6h-6.9v4.6h2.3v-2.3L92,40v4.6h2.3v6.9h2.3v2.3h-2.3v4.6L92,58.4L92,53.8h-2.3v-2.3h-2.3v4.6h2.3v2.3h-2.3v6.9h2.3v-4.6L92,60.7v4.6h-2.3v2.3h-2.3v6.9L92,74.5v-2.3L89.7,72.2zM115.1,74.5v-2.3h-4.6v2.3L115.1,74.5zM112.8,42.3h-6.9v6.9h6.9L112.8,42.3zM94.3,72.2L99,72.2v-2.3h-2.3v-2.3h-2.3L94.4,72.2zM99,67.6v-2.3h-2.3v2.3L99,67.6zM112.8,58.4h4.6v-2.3h-4.6L112.8,58.4zM115.1,76.9h2.3v-2.3h-2.3L115.1,76.9zM115.1,63h2.3v-2.3h-2.3L115.1,63zM94.3,51.5L92,51.5v2.3h2.3L94.3,51.5zM94.3,51.5"/>
<path
android:fillColor="#FF000000"
android:pathData="M303.5,63h2.3v2.3h2.3v2.3h-11.5v-2.3h2.3v-4.6h4.6L303.5,63L303.5,63zM333.5,83.8h2.3v-2.3h-2.3L333.5,83.8zM305.8,63h2.3v-2.3h-2.3L305.8,63zM338.1,83.8h2.3v-2.3h-2.3L338.1,83.8zM310.4,86.1h4.6L315,83.8h-4.6L310.4,86.1zM331.2,86.1L331.2,83.8h-2.3v2.3L331.2,86.1zM322,86.1h2.3v-4.6L322,81.5L322,86.1zM303.5,56.1v2.3h6.9v-2.3L303.5,56.1zM301.2,58.4v-2.3h-4.6v4.6h2.3v-2.3L301.2,58.4zM308.1,53.8L292,53.8v-16.1h16.1L308.1,53.8zM305.8,40h-11.5v11.5h11.5L305.8,40zM296.6,81.5h6.9v-6.9h-6.9L296.6,81.5zM319.6,79.1v2.3h2.3v-2.3L319.6,79.1zM303.5,42.3h-6.9v6.9h6.9L303.5,42.3zM340.4,37.7L340.4,53.8h-16.1v-16.1L340.4,37.7zM338.1,40h-11.5v11.5h11.5L338.1,40zM292,69.9h16.1v16.1L292,86L292,69.9zM294.3,83.8h11.5v-11.5h-11.5L294.3,83.8zM294.3,56.1L292,56.1v11.5h2.3L294.3,56.1zM324.3,67.6v2.3h2.3v-2.3L324.3,67.6zM317.3,76.9v-2.3L315,74.6v2.3h-4.6v4.6h4.6v2.3h2.3v-4.6h2.3v-2.3L317.3,76.9zM310.4,46.9h4.6v-2.3h-4.6L310.4,46.9zM328.9,65.3h4.6v2.3h2.3v-6.9h-2.3v-4.6h-2.3v6.9h-6.9v2.3h2.3v2.3h2.3L328.9,65.3zM331.2,72.2h-2.3v-2.3h-2.3v4.6h-6.9v2.3h4.6v4.6h2.3v2.3h2.3v-4.6h9.2v-2.3h-6.9L331.2,72.2zM331.2,72.2h2.3v-4.6h-2.3L331.2,72.2zM312.7,72.2v-2.3h2.3v-2.3h2.3v-2.3h2.3v-4.6h6.9v-4.6h-2.3v2.3L322,58.4v-9.2h-2.3v-4.6h2.3v-6.9h-2.3v4.6h-2.3v-4.6h-6.9v4.6h2.3v-2.3h2.3v4.6h2.3v6.9h2.3v2.3h-2.3v4.6L315,58.4L315,53.8h-2.3v-2.3h-2.3v4.6h2.3v2.3h-2.3v6.9h2.3v-4.6h2.3v4.6h-2.3v2.3h-2.3v6.9h4.6v-2.3L312.7,72.2zM338.1,74.5v-2.3h-4.6v2.3L338.1,74.5zM335.8,42.3h-6.9v6.9h6.9L335.8,42.3zM317.3,72.2h4.6v-2.3h-2.3v-2.3h-2.3L317.3,72.2zM322,67.6v-2.3h-2.3v2.3L322,67.6zM335.8,58.4h4.6v-2.3h-4.6L335.8,58.4zM338.1,76.9h2.3v-2.3h-2.3L338.1,76.9zM338.1,63h2.3v-2.3h-2.3L338.1,63zM317.3,51.5L315,51.5v2.3h2.3L317.3,51.5zM317.3,51.5"/>
<path
android:fillColor="#FF000000"
android:pathData="M179.6,48.9l-20.6,18l20.6,16.7v-5.2L199,78.4v-24.3h-19.3L179.7,48.9z"/>
<path
android:fillColor="#FF000000"
android:pathData="M229.4,83.7l20.6,-18l-20.6,-16.7v5.2L210,54.2v24.3h19.3L229.3,83.7z"/>
</vector>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@android:color/transparent"/>
<stroke
android:width="1dp"
android:color="@color/spinner_border"/>
<corners
android:radius="2dp"/>
</shape>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="@dimen/margin_activity_vertical"
android:paddingEnd="@dimen/margin_activity_horizontal"
android:paddingLeft="@dimen/margin_activity_horizontal"
android:paddingRight="@dimen/margin_activity_horizontal"
android:paddingStart="@dimen/margin_activity_horizontal"
android:paddingTop="@dimen/margin_activity_vertical">
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginRight="@dimen/margin_medium"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/qr_code_intro"/>
<ScrollView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/yourNicknameView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/your_nickname"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:background="@drawable/spinner_border"
android:spinnerMode="dropdown"/>
<TextView
android:id="@+id/faceToFaceView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:text="@string/face_to_face"/>
<Button
android:id="@+id/continueButton"
style="@style/BriarButton.Default"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_medium"
android:text="@string/continue_button"/>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="@dimen/margin_activity_vertical"
android:paddingEnd="@dimen/margin_activity_horizontal"
android:paddingLeft="@dimen/margin_activity_horizontal"
android:paddingRight="@dimen/margin_activity_horizontal"
android:paddingStart="@dimen/margin_activity_horizontal"
android:paddingTop="@dimen/margin_activity_vertical">
<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_marginRight="@dimen/margin_medium"
android:layout_weight="1"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/bluetooth"/>
<ScrollView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/yourNicknameView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/your_nickname"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:background="@drawable/spinner_border"
android:spinnerMode="dropdown"/>
<TextView
android:id="@+id/faceToFaceView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:text="@string/face_to_face"/>
<Button
android:id="@+id/continueButton"
style="@style/BriarButton.Default"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_medium"
android:text="@string/continue_button"/>
</LinearLayout>
</ScrollView>
</LinearLayout>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
@@ -12,14 +12,15 @@
android:layout_width="@dimen/dropdown_picture_size"
android:layout_height="@dimen/dropdown_picture_size"
android:layout_margin="@dimen/margin_small"
app:civ_border_width="@dimen/avatar_border_width"
app:civ_border_color="@color/briar_text_primary"/>
app:civ_border_color="@color/briar_text_primary"
app:civ_border_width="@dimen/avatar_border_width"/>
<TextView
android:id="@+id/nameView"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:textSize="@dimen/text_size_medium"

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/margin_activity_vertical"
android:paddingEnd="@dimen/margin_activity_horizontal"
android:paddingLeft="@dimen/margin_activity_horizontal"
android:paddingRight="@dimen/margin_activity_horizontal"
android:paddingStart="@dimen/margin_activity_horizontal"
android:paddingTop="@dimen/margin_activity_vertical">
<TextView
android:id="@+id/yourNicknameView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/your_nickname"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:background="@drawable/spinner_border"
android:spinnerMode="dropdown"/>
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_xlarge"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="@drawable/qr_code_intro"/>
<TextView
android:id="@+id/faceToFaceView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_xlarge"
android:text="@string/face_to_face"/>
<Button
android:id="@+id/continueButton"
style="@style/BriarButton.Default"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_medium"
android:text="@string/continue_button"/>
</LinearLayout>
</ScrollView>

View File

@@ -1,32 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/qr_layout"
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="2">
android:layout_height="match_parent">
<FrameLayout
<org.briarproject.android.util.CameraView
android:id="@+id/camera_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@android:color/black"
android:gravity="center">
android:layout_height="match_parent"/>
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/background_light">
android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout
android:id="@+id/status_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_height="match_parent"
android:background="@android:color/background_light"
android:gravity="center"
android:orientation="vertical"
android:padding="@dimen/margin_medium">
android:padding="@dimen/margin_medium"
android:visibility="invisible">
<ProgressBar
android:layout_width="wrap_content"
@@ -41,19 +43,25 @@
android:paddingTop="@dimen/margin_large"
tools:text="Connection failed"/>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
<org.briarproject.android.util.CameraView
android:id="@+id/camera_view"
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
android:layout_height="0dp"
android:layout_weight="1"
android:background="@android:color/white">
<ImageView
android:id="@+id/qr_code"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scaleType="fitCenter"/>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingTop="@dimen/margin_large"/>
</LinearLayout>
<ImageView
android:id="@+id/qr_code"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"/>
</RelativeLayout>
</LinearLayout>
</FrameLayout>

View File

@@ -18,18 +18,6 @@
android:paddingLeft="@dimen/margin_activity_horizontal"
android:paddingTop="@dimen/margin_activity_vertical">
<TextView
android:id="@+id/stepView"
style="@style/BriarTextBody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:padding="@dimen/margin_medium"
tools:text="Step 3/3"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
<TextView
android:id="@+id/connectedView"
style="@style/BriarTextTitle"
@@ -38,7 +26,6 @@
android:layout_height="wrap_content"
android:text="@string/connected_to_contact"
android:padding="@dimen/margin_medium"
android:layout_below="@+id/stepView"
android:layout_centerHorizontal="true"
android:drawableLeft="@drawable/navigation_accept"
android:drawableStart="@drawable/navigation_accept"

View File

@@ -18,18 +18,6 @@
android:paddingLeft="@dimen/margin_activity_horizontal"
android:paddingTop="@dimen/margin_activity_vertical">
<TextView
android:id="@+id/stepView"
style="@style/BriarTextBody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="@dimen/margin_medium"
tools:text="Step 2/3"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
<TextView
android:id="@+id/yourCodeView"
style="@style/BriarTextBody"
@@ -37,7 +25,6 @@
android:layout_height="wrap_content"
android:text="@string/your_invitation_code"
android:layout_marginTop="@dimen/margin_medium"
android:layout_below="@+id/stepView"
android:layout_centerHorizontal="true"/>
<TextView

View File

@@ -1,69 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/margin_activity_vertical"
android:paddingEnd="@dimen/margin_activity_horizontal"
android:paddingLeft="@dimen/margin_activity_horizontal"
android:paddingRight="@dimen/margin_activity_horizontal"
android:paddingStart="@dimen/margin_activity_horizontal"
android:paddingLeft="@dimen/margin_activity_horizontal"
android:paddingTop="@dimen/margin_activity_vertical">
<TextView
android:id="@+id/stepView"
style="@style/BriarTextBody"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
tools:text="Step 1/3"/>
<TextView
android:id="@+id/yourNicknameView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/your_nickname"
android:layout_marginTop="@dimen/margin_medium"/>
android:text="@string/your_nickname"/>
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/spinner"
android:spinnerMode="dropdown"
android:layout_marginTop="@dimen/margin_medium"/>
android:background="@drawable/spinner_border"
android:layout_marginTop="@dimen/margin_medium"
android:spinnerMode="dropdown"/>
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/bluetooth"
android:scaleType="fitCenter"
android:layout_marginTop="@dimen/margin_xlarge"
android:adjustViewBounds="true"
android:layout_marginTop="@dimen/margin_medium"/>
android:scaleType="fitCenter"
android:src="@drawable/bluetooth"/>
<TextView
android:id="@+id/faceToFaceView"
style="@style/BriarTextBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/face_to_face"
android:layout_marginTop="@dimen/margin_medium"/>
android:layout_marginTop="@dimen/margin_xlarge"
android:text="@string/face_to_face"/>
<Button
android:id="@+id/continueButton"
style="@style/BriarButton.Default"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/continue_button"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/margin_medium"/>
android:layout_marginTop="@dimen/margin_medium"
android:text="@string/continue_button"/>
</LinearLayout>
</ScrollView>

View File

@@ -39,4 +39,7 @@
<color name="default_separator">#000000</color>
<color name="default_separator_inverted">#ffffff</color>
<color name="menu_background">#FFFFFF</color>
<color name="spinner_border">#61000000</color> <!-- 38% Black -->
<color name="spinner_arrow">@color/briar_blue_dark</color>
</resources>

View File

@@ -1,6 +1,8 @@
package org.briarproject.android.identity;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -97,7 +99,17 @@ public class LocalAuthorSpinnerAdapter extends BaseAdapter
}
public View getView(int position, View convertView, ViewGroup parent) {
return getDropDownView(position, convertView, parent);
View view = getDropDownView(position, convertView, parent);
Drawable d = ctx.getResources()
.getDrawable(R.drawable.ic_expand_more_black_24dp);
if (d != null) {
d.setColorFilter(
ctx.getResources().getColor(R.color.spinner_arrow),
PorterDuff.Mode.SRC_IN);
}
((TextView) view.findViewById(R.id.nameView))
.setCompoundDrawablesWithIntrinsicBounds(null, null, d, null);
return view;
}
@Override

View File

@@ -36,6 +36,11 @@ implements InvitationListener {
static final int REQUEST_BLUETOOTH = 1;
static final int REQUEST_CREATE_IDENTITY = 2;
private static final int STEP_CHOOSE = 1;
private static final int STEP_INVITE = 2;
private static final int STEP_CONFIRM = 3;
private static final int STEPS = 3;
private static final Logger LOG =
Logger.getLogger(AddContactActivity.class.getName());
@@ -189,10 +194,23 @@ implements InvitationListener {
}
}
@SuppressWarnings("ConstantConditions")
void setView(AddContactView view) {
this.view = view;
view.init(this);
setContentView(view);
int step = 0;
if (view instanceof ChooseIdentityView) step = STEP_CHOOSE;
else if (view instanceof InvitationCodeView) step = STEP_INVITE;
else if (view instanceof ConfirmationCodeView) step = STEP_CONFIRM;
if (step > 0) {
getSupportActionBar().setTitle(
String.format(getString(R.string.add_contact_title_step),
step, STEPS));
} else {
getSupportActionBar().setTitle(R.string.add_contact_title);
}
}
void reset(AddContactView view) {

View File

@@ -9,7 +9,6 @@ import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import org.briarproject.R;
import org.briarproject.android.identity.CreateIdentityActivity;
@@ -45,11 +44,6 @@ implements OnItemSelectedListener, OnClickListener {
(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.invitation_bluetooth_start, this);
// current step
// TODO this could go into the ActionBar eventually
TextView step = (TextView) view.findViewById(R.id.stepView);
step.setText(String.format(ctx.getString(R.string.step), 1, 3));
adapter = new LocalAuthorSpinnerAdapter(ctx, false);
spinner = (Spinner) view.findViewById(R.id.spinner);
spinner.setAdapter(adapter);

View File

@@ -15,7 +15,6 @@ import android.widget.TextView;
import org.briarproject.R;
import static android.content.Context.INPUT_METHOD_SERVICE;
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
class ConfirmationCodeView extends AddContactView {
@@ -40,11 +39,6 @@ class ConfirmationCodeView extends AddContactView {
(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.invitation_bluetooth_confirmation_code, this);
// current step
// TODO this could go into the ActionBar eventually
TextView step = (TextView) view.findViewById(R.id.stepView);
step.setText(String.format(ctx.getString(R.string.step), 3, 3));
// local confirmation code
TextView code = (TextView) view.findViewById(R.id.codeView);
int localCode = container.getLocalConfirmationCode();

View File

@@ -15,7 +15,6 @@ import android.widget.TextView;
import org.briarproject.R;
import static android.content.Context.INPUT_METHOD_SERVICE;
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
class InvitationCodeView extends AddContactView {
@@ -38,11 +37,6 @@ class InvitationCodeView extends AddContactView {
(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.invitation_bluetooth_invitation_code, this);
// current step
// TODO this could go into the ActionBar eventually
TextView step = (TextView) view.findViewById(R.id.stepView);
step.setText(String.format(ctx.getString(R.string.step), 2, 3));
// local invitation code
TextView code = (TextView) view.findViewById(R.id.codeView);
int localCode = container.getLocalInvitationCode();

View File

@@ -91,7 +91,7 @@ public class ChooseIdentityFragment extends BaseFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.invitation_bluetooth_start, container,
return inflater.inflate(R.layout.fragment_keyagreement_id, container,
false);
}
@@ -106,13 +106,12 @@ public class ChooseIdentityFragment extends BaseFragment
button = view.findViewById(R.id.continueButton);
button.setEnabled(false);
button.setOnClickListener(
new OnClickListener() {
@Override
public void onClick(View view) {
lsnr.identitySelected(localAuthorId);
}
});
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
lsnr.identitySelected(localAuthorId);
}
});
loadLocalAuthors();
}

View File

@@ -10,13 +10,11 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Base64;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -52,8 +50,6 @@ import static android.bluetooth.BluetoothAdapter.ACTION_STATE_CHANGED;
import static android.bluetooth.BluetoothAdapter.EXTRA_STATE;
import static android.bluetooth.BluetoothAdapter.STATE_ON;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
import static android.widget.LinearLayout.HORIZONTAL;
import static android.widget.LinearLayout.VERTICAL;
import static android.widget.Toast.LENGTH_LONG;
import static java.util.logging.Level.WARNING;
@@ -78,8 +74,8 @@ public class ShowQrCodeFragment extends BaseEventFragment
@IoExecutor
protected Executor ioExecutor;
private LinearLayout qrLayout;
private CameraView cameraView;
private View statusView;
private TextView status;
private ImageView qrCode;
@@ -119,8 +115,8 @@ public class ShowQrCodeFragment extends BaseEventFragment
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
qrLayout = (LinearLayout) view.findViewById(R.id.qr_layout);
cameraView = (CameraView) view.findViewById(R.id.camera_view);
statusView = view.findViewById(R.id.status_container);
status = (TextView) view.findViewById(R.id.connect_status);
qrCode = (ImageView) view.findViewById(R.id.qr_code);
}
@@ -132,10 +128,6 @@ public class ShowQrCodeFragment extends BaseEventFragment
getActivity().setRequestedOrientation(SCREEN_ORIENTATION_NOSENSOR);
decoder = new QrCodeDecoder(this);
Display display = getActivity().getWindowManager().getDefaultDisplay();
boolean portrait = display.getWidth() < display.getHeight();
qrLayout.setOrientation(portrait ? VERTICAL : HORIZONTAL);
}
@Override
@@ -165,13 +157,13 @@ public class ShowQrCodeFragment extends BaseEventFragment
@Override
public void onResume() {
super.onResume();
if (!gotRemotePayload) openCamera();
openCamera();
}
@Override
public void onPause() {
super.onPause();
if (!gotRemotePayload) releaseCamera();
releaseCamera();
}
@Override
@@ -183,7 +175,6 @@ public class ShowQrCodeFragment extends BaseEventFragment
private void startListening() {
task = keyAgreementTaskFactory.getTask();
gotRemotePayload = false;
ioExecutor.execute(new Runnable() {
@Override
public void run() {
@@ -252,9 +243,11 @@ public class ShowQrCodeFragment extends BaseEventFragment
}
private void reset() {
statusView.setVisibility(View.INVISIBLE);
cameraView.setVisibility(View.VISIBLE);
gotRemotePayload = false;
cameraView.startConsumer();
startListening();
openCamera();
}
private void qrCodeScanned(String content) {
@@ -262,7 +255,8 @@ public class ShowQrCodeFragment extends BaseEventFragment
// TODO use Base32
Payload remotePayload = payloadParser.parse(
Base64.decode(content, 0));
cameraView.setVisibility(View.GONE);
cameraView.setVisibility(View.INVISIBLE);
statusView.setVisibility(View.VISIBLE);
status.setText(R.string.connecting_to_device);
task.connectAndRunProtocol(remotePayload);
} catch (IOException e) {
@@ -359,7 +353,7 @@ public class ShowQrCodeFragment extends BaseEventFragment
LOG.info("Got result from decoder");
if (!gotRemotePayload) {
gotRemotePayload = true;
releaseCamera();
cameraView.stopConsumer();
qrCodeScanned(result.getText());
}
}

View File

@@ -97,8 +97,7 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
try {
camera.setPreviewDisplay(holder);
camera.startPreview();
if (autoFocus) camera.autoFocus(this);
previewConsumer.start(camera);
startConsumer();
} catch (IOException | RuntimeException e) {
LOG.log(WARNING, "Error starting camera preview", e);
}
@@ -106,14 +105,23 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
private void stopPreview() {
try {
previewConsumer.stop();
if (autoFocus) camera.cancelAutoFocus();
stopConsumer();
camera.stopPreview();
} catch (RuntimeException e) {
LOG.log(WARNING, "Error stopping camera preview", e);
}
}
public void startConsumer() {
if (autoFocus) camera.autoFocus(this);
previewConsumer.start(camera);
}
public void stopConsumer() {
previewConsumer.stop();
if (autoFocus) camera.cancelAutoFocus();
}
private void setDisplayOrientation(int rotationDegrees) {
int orientation;
CameraInfo info = new CameraInfo();
@@ -124,7 +132,7 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
} else {
orientation = (info.orientation - rotationDegrees + 360) % 360;
}
if(LOG.isLoggable(INFO))
if (LOG.isLoggable(INFO))
LOG.info("Display orientation " + orientation + " degrees");
try {
camera.setDisplayOrientation(orientation);
@@ -211,7 +219,7 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
}
}
if (bestSize != null) {
if(LOG.isLoggable(INFO))
if (LOG.isLoggable(INFO))
LOG.info("Best size " + bestSize.width + "x" + bestSize.height);
params.setPreviewSize(bestSize.width, bestSize.height);
}