aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-02-25 11:29:46 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2015-02-25 11:29:46 +0100
commit430ba2f7778e70c6c8a8c46e51de46543e074f34 (patch)
tree704ad5c6139a5ef2de9f85f5937e8daa5a5c07ed /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java
parent56d38dd68b7248dff54d56affce0af14e8e2e161 (diff)
downloadopen-keychain-430ba2f7778e70c6c8a8c46e51de46543e074f34.tar.gz
open-keychain-430ba2f7778e70c6c8a8c46e51de46543e074f34.tar.bz2
open-keychain-430ba2f7778e70c6c8a8c46e51de46543e074f34.zip
Bigger status icon in key view
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java57
1 files changed, 41 insertions, 16 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java
index 1c3dec629..38ed88b9c 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/KeyFormattingUtils.java
@@ -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;
}