aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-06-14 18:06:57 +0200
committerVincent Breitmoser <valodim@mugenguild.com>2015-06-17 18:52:19 +0200
commit7998b2a262aa809f9879d51e6edc55ddadcf2699 (patch)
tree160108a455270eb858f1b43c7ada93daa5a3676b /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util
parent6f47c78981efd8e135e3e3cf2b5818bfd17970d4 (diff)
downloadopen-keychain-7998b2a262aa809f9879d51e6edc55ddadcf2699.tar.gz
open-keychain-7998b2a262aa809f9879d51e6edc55ddadcf2699.tar.bz2
open-keychain-7998b2a262aa809f9879d51e6edc55ddadcf2699.zip
instrument: add helper method for snackbar checking
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/Notify.java23
1 files changed, 7 insertions, 16 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/Notify.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/Notify.java
index 8c554dbde..7dfd56430 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/Notify.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/Notify.java
@@ -38,25 +38,16 @@ import org.sufficientlysecure.keychain.util.FabContainer;
public class Notify {
public static enum Style {
- OK, WARN, ERROR;
+ OK (R.color.android_green_light), WARN(R.color.android_orange_light), ERROR(R.color.android_red_light);
- public void applyToBar(Snackbar bar) {
+ public final int mLineColor;
- switch (this) {
- case OK:
- // bar.actionColorResource(R.color.android_green_light);
- bar.lineColorResource(R.color.android_green_light);
- break;
- case WARN:
- // bar.textColorResource(R.color.android_orange_light);
- bar.lineColorResource(R.color.android_orange_light);
- break;
- case ERROR:
- // bar.textColorResource(R.color.android_red_light);
- bar.lineColorResource(R.color.android_red_light);
- break;
- }
+ Style(int color) {
+ mLineColor = color;
+ }
+ public void applyToBar(Snackbar bar) {
+ bar.lineColorResource(mLineColor);
}
}