Robots like coffee too...

This commit is contained in:
Dominik Schürmann 2014-07-31 21:18:24 +02:00
parent 7bbe869c88
commit 138d5a1d9c
17 changed files with 163 additions and 36 deletions

View file

@ -21,13 +21,10 @@ import android.content.Context;
import android.os.Bundle;
import android.os.Parcel;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.KeychainApplication;
import org.sufficientlysecure.keychain.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
@ -80,7 +77,6 @@ public class FileImportCache {
File tempFile = new File(cacheDir, FILENAME);
try {
FileInputStream fis = new FileInputStream(tempFile);
byte[] array = new byte[(int) fis.getChannel().size()];
fis.read(array, 0, array.length);

View file

@ -132,7 +132,7 @@ public class DecryptFragment extends Fragment {
mResultText.setText(R.string.decrypt_result_decrypted_and_signature_certified);
}
mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_green));
mResultLayout.setBackgroundColor(getResources().getColor(R.color.android_green_light));
mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
mSignatureLayout.setVisibility(View.VISIBLE);
mLookupKey.setVisibility(View.GONE);
@ -146,7 +146,7 @@ public class DecryptFragment extends Fragment {
mResultText.setText(R.string.decrypt_result_decrypted_and_signature_uncertified);
}
mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_orange));
mResultLayout.setBackgroundColor(getResources().getColor(R.color.android_orange_light));
mSignatureStatusImage.setImageResource(R.drawable.overlay_ok);
mSignatureLayout.setVisibility(View.VISIBLE);
mLookupKey.setVisibility(View.GONE);
@ -160,7 +160,7 @@ public class DecryptFragment extends Fragment {
mResultText.setText(R.string.decrypt_result_decrypted_unknown_pub_key);
}
mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_orange));
mResultLayout.setBackgroundColor(getResources().getColor(R.color.android_orange_light));
mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
mSignatureLayout.setVisibility(View.VISIBLE);
mLookupKey.setVisibility(View.VISIBLE);
@ -170,7 +170,7 @@ public class DecryptFragment extends Fragment {
case OpenPgpSignatureResult.SIGNATURE_ERROR: {
mResultText.setText(R.string.decrypt_result_invalid_signature);
mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_red));
mResultLayout.setBackgroundColor(getResources().getColor(R.color.android_red_light));
mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
mSignatureLayout.setVisibility(View.GONE);
mLookupKey.setVisibility(View.GONE);
@ -180,7 +180,7 @@ public class DecryptFragment extends Fragment {
default: {
mResultText.setText(R.string.error);
mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_red));
mResultLayout.setBackgroundColor(getResources().getColor(R.color.android_red_light));
mSignatureStatusImage.setImageResource(R.drawable.overlay_error);
mSignatureLayout.setVisibility(View.GONE);
mLookupKey.setVisibility(View.GONE);
@ -192,7 +192,7 @@ public class DecryptFragment extends Fragment {
mLookupKey.setVisibility(View.GONE);
// successful decryption-only
mResultLayout.setBackgroundColor(getResources().getColor(R.color.result_purple));
mResultLayout.setBackgroundColor(getResources().getColor(R.color.android_purple_light));
mResultText.setText(R.string.decrypt_result_decrypted);
}
}

View file

@ -47,7 +47,6 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.AdapterView;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
@ -493,19 +492,19 @@ public class KeyListFragment extends LoaderFragment
if (isRevoked) {
h.mStatus.setImageDrawable(
getResources().getDrawable(R.drawable.status_signature_revoked_cutout));
h.mStatus.setColorFilter(getResources().getColor(R.color.result_red),
h.mStatus.setColorFilter(getResources().getColor(R.color.android_red_light),
PorterDuff.Mode.SRC_ATOP);
h.mStatus.setVisibility(View.VISIBLE);
} else if (isExpired) {
h.mStatus.setImageDrawable(
getResources().getDrawable(R.drawable.status_signature_expired_cutout));
h.mStatus.setColorFilter(getResources().getColor(R.color.result_orange),
h.mStatus.setColorFilter(getResources().getColor(R.color.android_orange_light),
PorterDuff.Mode.SRC_ATOP);
h.mStatus.setVisibility(View.VISIBLE);
} else if (isVerified) {
h.mStatus.setImageDrawable(
getResources().getDrawable(R.drawable.status_signature_verified_cutout));
h.mStatus.setColorFilter(getResources().getColor(R.color.result_green),
h.mStatus.setColorFilter(getResources().getColor(R.color.android_green_light),
PorterDuff.Mode.SRC_ATOP);
h.mStatus.setVisibility(View.VISIBLE);
} else {

View file

@ -152,7 +152,7 @@ public class ViewCertActivity extends ActionBarActivity
sig.init(signerRing.getPublicKey());
if (sig.verifySignature(signeeRing.getPublicKey(), signeeUid)) {
mStatus.setText(R.string.cert_verify_ok);
mStatus.setTextColor(getResources().getColor(R.color.result_green));
mStatus.setTextColor(getResources().getColor(R.color.android_green_light));
} else {
mStatus.setText(R.string.cert_verify_failed);
mStatus.setTextColor(getResources().getColor(R.color.alert));

View file

@ -516,19 +516,19 @@ public class ViewKeyActivity extends ActionBarActivity implements
// Note: order is important
if (isRevoked) {
mStatusText.setText(R.string.view_key_revoked);
mStatusText.setTextColor(getResources().getColor(R.color.result_red));
mStatusText.setTextColor(getResources().getColor(R.color.android_red_light));
mStatusImage.setImageDrawable(
getResources().getDrawable(R.drawable.status_signature_revoked_cutout));
mStatusImage.setColorFilter(getResources().getColor(R.color.result_red),
mStatusImage.setColorFilter(getResources().getColor(R.color.android_red_light),
PorterDuff.Mode.SRC_ATOP);
mStatusDivider.setVisibility(View.VISIBLE);
mStatusLayout.setVisibility(View.VISIBLE);
} else if (isExpired) {
mStatusText.setText(R.string.view_key_expired);
mStatusText.setTextColor(getResources().getColor(R.color.result_orange));
mStatusText.setTextColor(getResources().getColor(R.color.android_orange_light));
mStatusImage.setImageDrawable(
getResources().getDrawable(R.drawable.status_signature_expired_cutout));
mStatusImage.setColorFilter(getResources().getColor(R.color.result_orange),
mStatusImage.setColorFilter(getResources().getColor(R.color.android_orange_light),
PorterDuff.Mode.SRC_ATOP);
mStatusDivider.setVisibility(View.VISIBLE);
mStatusLayout.setVisibility(View.VISIBLE);

View file

@ -188,7 +188,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
case Certs.VERIFIED_SECRET:
vVerified.setImageResource(R.drawable.status_signature_verified_cutout);
vVerified.setColorFilter(
mContext.getResources().getColor(R.color.result_green),
mContext.getResources().getColor(R.color.android_green_light),
PorterDuff.Mode.SRC_IN);
break;
case Certs.VERIFIED_SELF:
@ -200,7 +200,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
default:
vVerified.setImageResource(R.drawable.status_signature_invalid_cutout);
vVerified.setColorFilter(
mContext.getResources().getColor(R.color.result_red),
mContext.getResources().getColor(R.color.android_red_light),
PorterDuff.Mode.SRC_IN);
break;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -76,15 +76,30 @@
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<TextView
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="8dp"
android:text="Creating the key can take up to 3 Minutes, be patient!\n(3 subkeys, RSA, 4096 bit)"
android:textColor="@color/result_red"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView" />
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:src="@drawable/create_key_robot"
android:layout_gravity="center_vertical" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="Creating a key may take a while, have a cup of coffee in the meantime…\n(3 subkeys, RSA, 4096 bit)"
android:textColor="@color/android_green_dark"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView" />
</LinearLayout>
</LinearLayout>
</ScrollView>

View file

@ -8,7 +8,7 @@
android:paddingRight="16dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:background="@color/result_purple">
android:background="@color/android_purple_light">
<View
android:layout_width="match_parent"

View file

@ -9,7 +9,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:minWidth="10dp"
android:background="@color/result_green" />
android:background="@color/android_green_light" />
<TableLayout
android:layout_width="0dp"

View file

@ -10,7 +10,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:minWidth="10dp"
android:background="@color/result_green" />
android:background="@color/android_green_light" />
<LinearLayout
android:orientation="vertical"

View file

@ -10,8 +10,14 @@
<color name="holo_gray_light">#33999999</color>
<color name="holo_gray_bright">#33CCCCCC</color>
<color name="result_red">#ffff4444</color>
<color name="result_orange">#ffffbb33</color>
<color name="result_green">#ff99cc00</color>
<color name="result_purple">#aa66cc</color>
<!-- http://developer.android.com/design/style/color.html -->
<color name="android_red_light">#ffff4444</color>
<color name="android_red_dark">#ffCC0000</color>
<color name="android_orange_light">#ffffbb33</color>
<color name="android_orange_dark">#ffFF8800</color>
<color name="android_green_light">#ff99cc00</color>
<color name="android_green_dark">#ff669900</color>
<color name="android_purple_light">#ffaa66cc</color>
<color name="android_purple_dark">#ff9933CC</color>
</resources>

View file

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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"
width="45"
height="45"
id="svg4316"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="create_key_robot.svg">
<defs
id="defs4318" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
inkscape:cx="19.859075"
inkscape:cy="10.23901"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="2558"
inkscape:window-height="1419"
inkscape:window-x="0"
inkscape:window-y="19"
inkscape:window-maximized="1" />
<metadata
id="metadata4321">
<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>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1007.3622)">
<g
id="g3761">
<path
id="path5399"
d="m 22.166071,1009.3123 c -5.613738,0 -10.131173,4.5175 -10.131173,10.1312 l 0,18.6956 c 0,5.6138 4.517435,10.1365 10.131173,10.1365 l 0.6677,0 c 5.613732,0 10.131173,-4.5227 10.131173,-10.1365 l 0,-18.6956 c 0,-5.6137 -4.517441,-10.1312 -10.131173,-10.1312 l -0.6677,0 z m 0.336476,3.3649 c 4.044517,0 7.223786,3.1791 7.223786,7.1291 l 0,14.9628 c 0,3.95 -3.179269,7.1292 -7.223786,7.1292 -4.044516,0 -7.229038,-3.1792 -7.229038,-7.1292 l 0,-14.9628 c 0,-3.95 3.184522,-7.1291 7.229038,-7.1291 z"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#669900;stroke-width:1.74663651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
inkscape:connector-curvature="0" />
<rect
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#669900;stroke-width:1.74663651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect5401"
width="33.961983"
height="24.945528"
x="5.5190063"
y="1025.4666"
rx="0.79848224"
ry="0.79848224" />
<path
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#669900;stroke-width:1.74663651;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="m 11.109664,1043.5389 c 2.495006,2.065 6.666898,3.4226 11.392966,3.4226 4.725665,0 8.89263,-1.3579 11.387713,-3.4226 z"
id="path5403"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cscc" />
<path
sodipodi:type="arc"
style="color:#000000;fill:none;stroke:#669900;stroke-width:9.60078144;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="path5405"
sodipodi:cx="307.48431"
sodipodi:cy="407.66223"
sodipodi:rx="9.388834"
sodipodi:ry="9.388834"
d="m 316.87315,407.66223 a 9.388834,9.388834 0 1 1 -18.77767,0"
transform="matrix(0.1819265,0,0,0.1819265,-43.957774,964.33702)"
sodipodi:start="0"
sodipodi:end="3.1415927"
sodipodi:open="true" />
<path
d="m 316.87315,407.66223 a 9.388834,9.388834 0 1 1 -18.77767,0 9.388834,9.388834 0 1 1 18.77767,0 z"
sodipodi:ry="9.388834"
sodipodi:rx="9.388834"
sodipodi:cy="407.66223"
sodipodi:cx="307.48431"
id="path5407"
style="color:#000000;fill:#669900;fill-opacity:1;fill-rule:nonzero;stroke:#669900;stroke-width:9.60078144000000044;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc"
transform="matrix(0.1819265,0,0,0.1819265,-21.704758,965.01923)" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5 KiB

View file

@ -53,4 +53,13 @@ inkscape -w 24 -h 24 -e "$MDPI_DIR/${NAME%%.*}.png" $NAME
inkscape -w 32 -h 32 -e "$HDPI_DIR/${NAME%%.*}.png" $NAME
inkscape -w 48 -h 48 -e "$XDPI_DIR/${NAME%%.*}.png" $NAME
inkscape -w 64 -h 64 -e "$XXDPI_DIR/${NAME%%.*}.png" $NAME
done
for NAME in "create_key_robot"
do
echo $NAME
inkscape -w 48 -h 48 -e "$MDPI_DIR/$NAME.png" $NAME.svg
inkscape -w 64 -h 64 -e "$HDPI_DIR/$NAME.png" $NAME.svg
inkscape -w 96 -h 96 -e "$XDPI_DIR/$NAME.png" $NAME.svg
inkscape -w 128 -h 128 -e "$XXDPI_DIR/$NAME.png" $NAME.svg
done