diff options
| author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-03-23 01:11:17 +0100 | 
|---|---|---|
| committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-03-23 01:11:17 +0100 | 
| commit | 633b64fd95f6bdcbe0283366c53978a8373365c2 (patch) | |
| tree | 740668859d24903111def540c1edf99731f114c6 /OpenKeychain/src/main/java/org | |
| parent | b3a599f214489ba9edce5b8c3f56b3f671499e86 (diff) | |
| parent | 4af9b3c7e864e71dccab2121cdbe5a2baa648c82 (diff) | |
| download | open-keychain-633b64fd95f6bdcbe0283366c53978a8373365c2.tar.gz open-keychain-633b64fd95f6bdcbe0283366c53978a8373365c2.tar.bz2 open-keychain-633b64fd95f6bdcbe0283366c53978a8373365c2.zip  | |
Merge branch 'development' of github.com:open-keychain/open-keychain into development
Diffstat (limited to 'OpenKeychain/src/main/java/org')
| -rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/Notify.java | 37 | 
1 files changed, 23 insertions, 14 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 3121e02ef..7e07ed818 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 @@ -37,7 +37,28 @@ import org.sufficientlysecure.keychain.util.FabContainer;   */  public class Notify { -    public static enum Style {OK, WARN, ERROR} +    public static enum Style { +        OK, WARN, ERROR; + +        public void applyToBar(Snackbar bar) { + +            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; +            } + +        } +    }      public static final int LENGTH_INDEFINITE = 0;      public static final int LENGTH_LONG = 3500; @@ -54,19 +75,7 @@ public class Notify {              snackbar.duration(duration);          } -        switch (style) { -            case OK: -                snackbar.actionColorResource(R.color.android_green_light); -                break; - -            case WARN: -                snackbar.textColorResource(R.color.android_orange_light); -                break; - -            case ERROR: -                snackbar.textColorResource(R.color.android_red_light); -                break; -        } +        style.applyToBar(snackbar);          if (actionListener != null) {              snackbar.actionLabel(actionResId)  | 
