compose: couple of small ui updates for encryption status

This commit is contained in:
Vincent Breitmoser 2016-03-02 17:10:43 +01:00
parent b09d5bd2c5
commit 38b64ea651
21 changed files with 215 additions and 27 deletions

View file

@ -0,0 +1,49 @@
<?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"
version="1.1"
id="svg3344"
viewBox="0 0 49.999997 99.999998"
height="100"
width="50">
<defs
id="defs3346" />
<metadata
id="metadata3349">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-113.57143,-22.362198)"
id="layer1">
<circle
r="13"
cy="106.8622"
cx="138.57143"
id="circle4219"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<circle
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="circle4741"
cx="138.57143"
cy="72.362198"
r="13" />
<circle
r="13"
cy="37.862198"
cx="138.57143"
id="circle4743"
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,49 @@
<?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"
version="1.1"
id="svg3344"
viewBox="0 0 49.999997 99.999998"
height="100"
width="50">
<defs
id="defs3346" />
<metadata
id="metadata3349">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-113.57143,-22.362198)"
id="layer1">
<circle
r="13"
cy="106.8622"
cx="138.57143"
id="circle4219"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<circle
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="circle4741"
cx="138.57143"
cy="72.362198"
r="13" />
<circle
r="13"
cy="37.862198"
cx="138.57143"
id="circle4743"
style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,49 @@
<?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"
version="1.1"
id="svg3344"
viewBox="0 0 49.999997 99.999998"
height="100"
width="50">
<defs
id="defs3346" />
<metadata
id="metadata3349">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-113.57143,-22.362198)"
id="layer1">
<circle
r="13"
cy="106.8622"
cx="138.57143"
id="circle4219"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
<circle
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="circle4741"
cx="138.57143"
cy="72.362198"
r="13" />
<circle
r="13"
cy="37.862198"
cx="138.57143"
id="circle4743"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -26,3 +26,12 @@ inkscape -w 48 -h 32 -e "$HDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
inkscape -w 72 -h 48 -e "$XDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
inkscape -w 96 -h 64 -e "$XXDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
done
for NAME in "status_dots_1" "status_dots_2" "status_dots_3"
do
echo $NAME
inkscape -w 12 -h 24 -e "$MDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
inkscape -w 16 -h 32 -e "$HDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
inkscape -w 24 -h 48 -e "$XDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
inkscape -w 32 -h 64 -e "$XXDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
done

View file

@ -164,15 +164,15 @@ public class AlternateRecipientAdapter extends BaseAdapter {
private void configureCryptoStatusView(RecipientTokenHolder holder, Recipient recipient) {
switch (recipient.getCryptoStatus()) {
case AVAILABLE_TRUSTED: {
setCryptoStatusView(holder, R.drawable.status_lock_closed, R.color.openpgp_green);
setCryptoStatusView(holder, R.drawable.status_lock_dots_3, R.color.openpgp_green);
break;
}
case AVAILABLE_UNTRUSTED: {
setCryptoStatusView(holder, R.drawable.status_lock_error, R.color.openpgp_orange);
setCryptoStatusView(holder, R.drawable.status_lock_dots_2, R.color.openpgp_orange);
break;
}
case UNAVAILABLE: {
setCryptoStatusView(holder, R.drawable.status_lock_open, R.color.openpgp_red);
setCryptoStatusView(holder, R.drawable.status_lock_disabled_dots_1, R.color.openpgp_red);
break;
}
case UNDEFINED: {

View file

@ -96,17 +96,17 @@ public class RecipientAdapter extends BaseAdapter implements Filterable {
RecipientCryptoStatus cryptoStatus = recipient.getCryptoStatus();
switch (cryptoStatus) {
case AVAILABLE_TRUSTED: {
cryptoStatusRes = R.drawable.status_lock_closed;
cryptoStatusRes = R.drawable.status_lock_dots_3;
cryptoStatusColor = context.getResources().getColor(R.color.openpgp_green);
break;
}
case AVAILABLE_UNTRUSTED: {
cryptoStatusRes = R.drawable.status_lock_opportunistic;
cryptoStatusRes = R.drawable.status_lock_dots_2;
cryptoStatusColor = context.getResources().getColor(R.color.openpgp_orange);
break;
}
case UNAVAILABLE: {
cryptoStatusRes = R.drawable.status_lock_open;
cryptoStatusRes = R.drawable.status_lock_disabled_dots_1;
cryptoStatusColor = context.getResources().getColor(R.color.openpgp_red);
break;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,002 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

View file

@ -107,14 +107,29 @@
tools:text="address@example.com"
/>
<ImageView
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="6dp"
android:padding="13dp"
android:id="@+id/alternate_crypto_status"
tools:src="@drawable/status_lock_open"
/>
android:padding="13dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:src="@drawable/status_dots"
android:tint="@color/openpgp_grey"
/>
<ImageView
android:id="@+id/alternate_crypto_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
tools:src="@drawable/status_lock_dots_2"
tools:tint="@color/openpgp_grey"
/>
</FrameLayout>
</LinearLayout>

View file

@ -45,12 +45,28 @@
</LinearLayout>
<ImageView
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="12dp"
android:id="@+id/contact_crypto_status"
tools:src="@drawable/status_lock_open"
/>
android:padding="13dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:src="@drawable/status_dots"
android:tint="@color/openpgp_grey"
/>
<ImageView
android:id="@+id/contact_crypto_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
tools:src="@drawable/status_lock_dots_2"
tools:tint="@color/openpgp_grey"
/>
</FrameLayout>
</LinearLayout>

View file

@ -15,8 +15,9 @@
/>
<TextView
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@android:id/text1"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
@ -27,38 +28,38 @@
/>
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:layout_marginEnd="6dp"
android:layout_gravity="center_vertical"
android:id="@+id/contact_crypto_status_red"
android:src="@drawable/status_lock_open"
android:src="@drawable/status_dots_1"
android:tint="@color/openpgp_red"
android:visibility="gone"
/>
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:layout_marginEnd="6dp"
android:layout_gravity="center_vertical"
android:id="@+id/contact_crypto_status_orange"
android:src="@drawable/status_lock_opportunistic"
android:src="@drawable/status_dots_2"
android:tint="@color/openpgp_orange"
android:visibility="gone"
tools:visibility="visible"
/>
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:layout_marginEnd="6dp"
android:layout_gravity="center_vertical"
android:id="@+id/contact_crypto_status_green"
android:src="@drawable/status_lock_closed"
android:src="@drawable/status_dots_3"
android:tint="@color/openpgp_green"
android:visibility="gone"
/>