From 54a7c72ee9deded605328a157f21661d4228a992 Mon Sep 17 00:00:00 2001 From: Manoj Khanna Date: Sun, 22 Mar 2015 08:16:24 +0530 Subject: [PATCH 1/2] Updated openpgp-api-lib --- extern/openpgp-api-lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/openpgp-api-lib b/extern/openpgp-api-lib index 70a17dcbe..9abb91d3a 160000 --- a/extern/openpgp-api-lib +++ b/extern/openpgp-api-lib @@ -1 +1 @@ -Subproject commit 70a17dcbeb5d8de095f09a7ce756543deff0165a +Subproject commit 9abb91d3a69964a547f26aa1d56de233e75c4410 From 8b4388e1a2d5cb2b7f0524c18ad3383e3375ba7b Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sun, 22 Mar 2015 16:55:46 +0100 Subject: [PATCH 2/2] use top line in snackbar for status indication --- .gitmodules | 3 ++ OpenKeychain/build.gradle | 4 +- .../keychain/ui/util/Notify.java | 37 ++++++++++++------- extern/snackbar | 1 + settings.gradle | 1 + 5 files changed, 30 insertions(+), 16 deletions(-) create mode 160000 extern/snackbar diff --git a/.gitmodules b/.gitmodules index 4c1a9e403..e946dca3c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -34,3 +34,6 @@ path = extern/safeslinger-exchange url = https://github.com/open-keychain/exchange-android ignore = dirty +[submodule "extern/snackbar"] + path = extern/snackbar + url = https://github.com/open-keychain/snackbar diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle index 97c8a6d5e..b3ab0b3ef 100644 --- a/OpenKeychain/build.gradle +++ b/OpenKeychain/build.gradle @@ -18,7 +18,6 @@ dependencies { compile 'com.google.zxing:core:3.0.1' compile 'com.jpardogo.materialtabstrip:library:1.0.9' compile 'it.neokree:MaterialNavigationDrawer:1.3.1' - compile 'com.nispok:snackbar:2.9.1' compile 'com.getbase:floatingactionbutton:1.8.0' // libs as submodules @@ -34,6 +33,7 @@ dependencies { compile project(':extern:KeybaseLib:Lib') compile project(':extern:TokenAutoComplete:library') compile project(':extern:safeslinger-exchange') + compile project(':extern:snackbar:lib') } // Output of ./gradlew -q calculateChecksums @@ -50,7 +50,7 @@ dependencyVerification { 'com.google.zxing:core:38c49045765281e4c170062fa3f48e4e988629bf985cab850c7497be5eaa72a1', 'com.jpardogo.materialtabstrip:library:c6ef812fba4f74be7dc4a905faa4c2908cba261a94c13d4f96d5e67e4aad4aaa', 'it.neokree:MaterialNavigationDrawer:1174d751a54689fccf53c1fbcdf439745926ae19024f4f1017afb6b29643c57d', - 'com.nispok:snackbar:59dc092a44c877e9ce5f9040c632d99e62d8932b0a4d67ba0ec9e35467d9047c', + // 'com.nispok:snackbar:59dc092a44c877e9ce5f9040c632d99e62d8932b0a4d67ba0ec9e35467d9047c', 'com.getbase:floatingactionbutton:e63966148212e9685afad2370780ea239b6dbd2a06f6a3f919b98882318e6a32', 'com.android.support:support-annotations:fdee2354787ef66b268e75958de3f7f6c4f8f325510a6dac9f49c929f83a63de', 'com.balysv:material-ripple:587f19c1e27f16c7dc67ff9ac73838aa1451086ef05a15cee38bee3e4e1454ae', 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) diff --git a/extern/snackbar b/extern/snackbar new file mode 160000 index 000000000..025ecadc5 --- /dev/null +++ b/extern/snackbar @@ -0,0 +1 @@ +Subproject commit 025ecadc592e591a96fa081265667efc0b0f0e15 diff --git a/settings.gradle b/settings.gradle index bb7db9f86..e15270e49 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,4 +11,5 @@ include ':extern:minidns' include ':extern:KeybaseLib:Lib' include ':extern:TokenAutoComplete:library' include ':extern:safeslinger-exchange' +include ':extern:snackbar:lib' include ':OpenKeychain-Test'