Bigger status icon in key view
@ -48,13 +48,22 @@ inkscape -w 64 -h 64 -e "$XDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 96 -h 96 -e "$XXDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
|
||||
done
|
||||
|
||||
for NAME in "status_lock_closed" "status_lock_error" "status_lock_open" "status_signature_expired_cutout" "status_signature_expired" "status_signature_invalid_cutout" "status_signature_invalid" "status_signature_revoked_cutout" "status_signature_revoked" "status_signature_unknown_cutout" "status_signature_unknown" "status_signature_unverified_cutout" "status_signature_unverified" "status_signature_verified_cutout" "status_signature_verified" "key_flag_authenticate" "key_flag_certify" "key_flag_encrypt" "key_flag_sign"
|
||||
for NAME in "status_lock_closed" "status_lock_error" "status_lock_open" "status_signature_expired_cutout" "status_signature_invalid_cutout" "status_signature_revoked_cutout" "status_signature_unknown_cutout" "status_signature_unverified_cutout" "status_signature_verified_cutout" "key_flag_authenticate" "key_flag_certify" "key_flag_encrypt" "key_flag_sign"
|
||||
do
|
||||
echo $NAME
|
||||
inkscape -w 24 -h 24 -e "$MDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 32 -h 32 -e "$HDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 48 -h 48 -e "$XDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 64 -h 64 -e "$XXDPI_DIR/$NAME.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 24 -h 24 -e "$MDPI_DIR/${NAME}_24px.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 32 -h 32 -e "$HDPI_DIR/${NAME}_24px.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 48 -h 48 -e "$XDPI_DIR/${NAME}_24px.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 64 -h 64 -e "$XXDPI_DIR/${NAME}_24px.png" "$SRC_DIR/$NAME.svg"
|
||||
done
|
||||
|
||||
for NAME in "status_signature_expired_cutout" "status_signature_invalid_cutout" "status_signature_revoked_cutout" "status_signature_unknown_cutout" "status_signature_unverified_cutout" "status_signature_verified_cutout"
|
||||
do
|
||||
echo $NAME
|
||||
inkscape -w 96 -h 96 -e "$MDPI_DIR/${NAME}_96px.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 128 -h 128 -e "$HDPI_DIR/${NAME}_96px.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 192 -h 192 -e "$XDPI_DIR/${NAME}_96px.png" "$SRC_DIR/$NAME.svg"
|
||||
inkscape -w 256 -h 256 -e "$XXDPI_DIR/${NAME}_96px.png" "$SRC_DIR/$NAME.svg"
|
||||
done
|
||||
|
||||
for NAME in "create_key_robot"
|
||||
|
@ -406,7 +406,7 @@ public class ViewKeyActivity extends BaseActivity implements
|
||||
if (isRevoked) {
|
||||
mStatusText.setText(R.string.view_key_revoked);
|
||||
mStatusImage.setVisibility(View.VISIBLE);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_REVOKED, R.color.icons);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_REVOKED, R.color.icons, true);
|
||||
color = getResources().getColor(R.color.android_red_light);
|
||||
|
||||
mActionEncryptFile.setVisibility(View.INVISIBLE);
|
||||
@ -416,7 +416,7 @@ public class ViewKeyActivity extends BaseActivity implements
|
||||
} else if (isExpired) {
|
||||
mStatusText.setText(R.string.view_key_expired);
|
||||
mStatusImage.setVisibility(View.VISIBLE);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_EXPIRED, R.color.icons);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_EXPIRED, R.color.icons, true);
|
||||
color = getResources().getColor(R.color.android_red_light);
|
||||
|
||||
mActionEncryptFile.setVisibility(View.INVISIBLE);
|
||||
@ -439,7 +439,7 @@ public class ViewKeyActivity extends BaseActivity implements
|
||||
if (isVerified) {
|
||||
mStatusText.setText(R.string.view_key_verified);
|
||||
mStatusImage.setVisibility(View.VISIBLE);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_VERIFIED, R.color.icons);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_VERIFIED, R.color.icons, true);
|
||||
color = getResources().getColor(R.color.primary);
|
||||
|
||||
AsyncTask<String, Void, Bitmap> photoTask =
|
||||
@ -461,7 +461,7 @@ public class ViewKeyActivity extends BaseActivity implements
|
||||
} else {
|
||||
mStatusText.setText(R.string.view_key_unverified);
|
||||
mStatusImage.setVisibility(View.VISIBLE);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_UNVERIFIED, R.color.icons);
|
||||
KeyFormattingUtils.setStatusImage(this, mStatusImage, mStatusText, KeyFormattingUtils.STATE_UNVERIFIED, R.color.icons, true);
|
||||
color = getResources().getColor(R.color.android_orange_light);
|
||||
|
||||
mActionVerify.setVisibility(View.VISIBLE);
|
||||
@ -472,6 +472,8 @@ public class ViewKeyActivity extends BaseActivity implements
|
||||
mStatusBar.setBackgroundColor(color);
|
||||
mBigToolbar.setBackgroundColor(color);
|
||||
|
||||
mStatusImage.setAlpha(80);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -272,12 +272,12 @@ public class SubkeysAdapter extends CursorAdapter {
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
|
||||
if (isRevoked) {
|
||||
vStatus.setImageResource(R.drawable.status_signature_revoked_cutout);
|
||||
vStatus.setImageResource(R.drawable.status_signature_revoked_cutout_24px);
|
||||
vStatus.setColorFilter(
|
||||
mContext.getResources().getColor(R.color.bg_gray),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
} else if (isExpired) {
|
||||
vStatus.setImageResource(R.drawable.status_signature_expired_cutout);
|
||||
vStatus.setImageResource(R.drawable.status_signature_expired_cutout_24px);
|
||||
vStatus.setColorFilter(
|
||||
mContext.getResources().getColor(R.color.bg_gray),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
|
@ -395,19 +395,29 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
|
||||
public static void setStatusImage(Context context, ImageView statusIcon, TextView statusText, int state) {
|
||||
setStatusImage(context, statusIcon, statusText, state, KeyFormattingUtils.DEFAULT_COLOR);
|
||||
setStatusImage(context, statusIcon, statusText, state, KeyFormattingUtils.DEFAULT_COLOR, false);
|
||||
}
|
||||
|
||||
public static void setStatusImage(Context context, ImageView statusIcon, TextView statusText,
|
||||
int state, int color) {
|
||||
setStatusImage(context, statusIcon, statusText, state, color, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets status image based on constant
|
||||
*/
|
||||
public static void setStatusImage(Context context, ImageView statusIcon, TextView statusText,
|
||||
int state, int color) {
|
||||
int state, int color, boolean big) {
|
||||
switch (state) {
|
||||
/** GREEN: everything is good **/
|
||||
case STATE_VERIFIED: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_verified_cutout));
|
||||
if (big) {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_verified_cutout_96px));
|
||||
} else {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_verified_cutout_24px));
|
||||
}
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_green_light;
|
||||
}
|
||||
@ -420,7 +430,7 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
case STATE_ENCRYPTED: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_lock_closed));
|
||||
context.getResources().getDrawable(R.drawable.status_lock_closed_24px));
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_green_light;
|
||||
}
|
||||
@ -433,8 +443,13 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
/** ORANGE: mostly bad... **/
|
||||
case STATE_UNVERIFIED: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_unverified_cutout));
|
||||
if (big) {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_unverified_cutout_96px));
|
||||
} else {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_unverified_cutout_24px));
|
||||
}
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_orange_light;
|
||||
}
|
||||
@ -447,7 +462,7 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
case STATE_UNKNOWN_KEY: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_unknown_cutout));
|
||||
context.getResources().getDrawable(R.drawable.status_signature_unknown_cutout_24px));
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_orange_light;
|
||||
}
|
||||
@ -460,8 +475,13 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
/** RED: really bad... **/
|
||||
case STATE_REVOKED: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_revoked_cutout));
|
||||
if (big) {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_revoked_cutout_96px));
|
||||
} else {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_revoked_cutout_24px));
|
||||
}
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_red_light;
|
||||
}
|
||||
@ -473,8 +493,13 @@ public class KeyFormattingUtils {
|
||||
break;
|
||||
}
|
||||
case STATE_EXPIRED: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_expired_cutout));
|
||||
if (big) {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_expired_cutout_96px));
|
||||
} else {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_expired_cutout_24px));
|
||||
}
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_red_light;
|
||||
}
|
||||
@ -487,7 +512,7 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
case STATE_NOT_ENCRYPTED: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_lock_open));
|
||||
context.getResources().getDrawable(R.drawable.status_lock_open_24px));
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_red_light;
|
||||
}
|
||||
@ -500,7 +525,7 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
case STATE_NOT_SIGNED: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_unknown_cutout));
|
||||
context.getResources().getDrawable(R.drawable.status_signature_unknown_cutout_24px));
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_red_light;
|
||||
}
|
||||
@ -513,7 +538,7 @@ public class KeyFormattingUtils {
|
||||
}
|
||||
case STATE_INVALID: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_invalid_cutout));
|
||||
context.getResources().getDrawable(R.drawable.status_signature_invalid_cutout_24px));
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.android_red_light;
|
||||
}
|
||||
@ -527,7 +552,7 @@ public class KeyFormattingUtils {
|
||||
/** special **/
|
||||
case STATE_UNAVAILABLE: {
|
||||
statusIcon.setImageDrawable(
|
||||
context.getResources().getDrawable(R.drawable.status_signature_invalid_cutout));
|
||||
context.getResources().getDrawable(R.drawable.status_signature_invalid_cutout_24px));
|
||||
if (color == KeyFormattingUtils.DEFAULT_COLOR) {
|
||||
color = R.color.bg_gray;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 675 B After Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 748 B After Width: | Height: | Size: 748 B |
Before Width: | Height: | Size: 675 B After Width: | Height: | Size: 675 B |
Before Width: | Height: | Size: 723 B |
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 789 B |
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 528 B |
Before Width: | Height: | Size: 444 B After Width: | Height: | Size: 444 B |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 861 B After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 640 B |
Before Width: | Height: | Size: 740 B After Width: | Height: | Size: 740 B |
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 813 B After Width: | Height: | Size: 813 B |
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 695 B After Width: | Height: | Size: 695 B |
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 897 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 528 B |
Before Width: | Height: | Size: 622 B After Width: | Height: | Size: 622 B |
Before Width: | Height: | Size: 522 B After Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 601 B |
Before Width: | Height: | Size: 643 B After Width: | Height: | Size: 643 B |
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 410 B After Width: | Height: | Size: 410 B |
After Width: | Height: | Size: 958 B |
Before Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 685 B |
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 517 B |
Before Width: | Height: | Size: 589 B After Width: | Height: | Size: 589 B |
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 469 B |
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 667 B |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 557 B |
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 1008 B After Width: | Height: | Size: 1008 B |
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 676 B |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 1017 B After Width: | Height: | Size: 1017 B |
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 840 B |
Before Width: | Height: | Size: 694 B After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 946 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |