diff options
author | moparisthebest <admin@moparisthebest.com> | 2015-06-22 22:40:15 -0400 |
---|---|---|
committer | moparisthebest <admin@moparisthebest.com> | 2015-06-22 22:40:15 -0400 |
commit | 7366f14d32dc5df6a1035450d968eab8fcbdc5c1 (patch) | |
tree | 7c4042ec5c67f44b412d2bd6f2040285d9de445a | |
parent | 2b26f293b8cb03a0b605e3a95365160f5c034329 (diff) | |
download | open-keychain-7366f14d32dc5df6a1035450d968eab8fcbdc5c1.tar.gz open-keychain-7366f14d32dc5df6a1035450d968eab8fcbdc5c1.tar.bz2 open-keychain-7366f14d32dc5df6a1035450d968eab8fcbdc5c1.zip |
New all-white status bar icon to fix issue #1356
13 files changed, 78 insertions, 5 deletions
diff --git a/Graphics/drawables/ic_stat_notify.svg b/Graphics/drawables/ic_stat_notify.svg new file mode 100644 index 000000000..11d326e06 --- /dev/null +++ b/Graphics/drawables/ic_stat_notify.svg @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + x="0px" + y="0px" + viewBox="0 0 95 95" + enable-background="new 0 0 100 100" + xml:space="preserve" + id="svg2" + inkscape:version="0.48.4 r9939" + width="100%" + height="100%" + sodipodi:docname="ic_stat_notify.svg"><metadata + id="metadata14"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs + id="defs12" /><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1145" + id="namedview10" + showgrid="false" + inkscape:zoom="3.776" + inkscape:cx="56.6318" + inkscape:cy="73.41883" + inkscape:window-x="1917" + inkscape:window-y="-3" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /><path + d="m 36.917194,57.417227 5.333672,5.267283 9.512321,1.139867 1.441261,9.395693 9.80158,1.42359 0.863749,9.681407 9.944699,1.281231 L 74.966476,95 93.848,93.718769 95,74.642665 57.527222,37.629328 c 0,0 5.836602,-15.873525 -7.855375,-29.398624 C 35.97987,-5.2943953 17.169906,0.04556 8.5233497,8.587099 0.30816341,16.700566 -5.1686273,36.063379 7.5144667,48.589975 22.215327,63.112582 36.917194,57.417227 36.917194,57.417227 z m 53.904158,19.076105 -0.28926,5.411632 -38.338543,-37.869481 2.88353,-2.848176 35.744273,35.306025 z M 13.884235,13.882256 c 5.835594,-5.76305 13.617394,-7.4205864 17.383821,-3.700338 3.76542,3.719253 2.088317,11.406638 -3.747277,17.170684 -5.835595,5.762055 -13.618402,7.418596 -17.383822,3.699343 C 6.3715371,27.332692 8.0486407,19.645306 13.884235,13.882256 z" + id="path4" + inkscape:connector-curvature="0" + style="fill:#ffffff" /></svg>
\ No newline at end of file diff --git a/OpenKeychain/src/debug/res/drawable-hdpi/ic_stat_notify.png b/OpenKeychain/src/debug/res/drawable-hdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..b31481995 --- /dev/null +++ b/OpenKeychain/src/debug/res/drawable-hdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/debug/res/drawable-mdpi/ic_stat_notify.png b/OpenKeychain/src/debug/res/drawable-mdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..39e799e5a --- /dev/null +++ b/OpenKeychain/src/debug/res/drawable-mdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/debug/res/drawable-xhdpi/ic_stat_notify.png b/OpenKeychain/src/debug/res/drawable-xhdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..af1613d40 --- /dev/null +++ b/OpenKeychain/src/debug/res/drawable-xhdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_stat_notify.png b/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..9da107396 --- /dev/null +++ b/OpenKeychain/src/debug/res/drawable-xxhdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_stat_notify.png b/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..5c81db8bf --- /dev/null +++ b/OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java index dbbfe3133..9679cb7bc 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/service/PassphraseCacheService.java @@ -36,6 +36,9 @@ import android.os.Messenger; import android.os.RemoteException; import android.support.v4.app.NotificationCompat; import android.support.v4.util.LongSparseArray; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.drawable.Drawable; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; @@ -474,11 +477,26 @@ public class PassphraseCacheService extends Service { } } + // from de.azapps.mirakel.helper.Helpers from https://github.com/MirakelX/mirakel-android + private static Bitmap getBitmap(int resId, Context ctx) { + final int mLargeIconWidth = (int) ctx.getResources().getDimension( + android.R.dimen.notification_large_icon_width); + final int mLargeIconHeight = (int) ctx.getResources().getDimension( + android.R.dimen.notification_large_icon_height); + final Drawable d = ctx.getResources().getDrawable(resId); + final Bitmap b = Bitmap.createBitmap(mLargeIconWidth, mLargeIconHeight, Bitmap.Config.ARGB_8888); + final Canvas c = new Canvas(b); + d.setBounds(0, 0, mLargeIconWidth, mLargeIconHeight); + d.draw(c); + return b; + } + private Notification getNotification() { NotificationCompat.Builder builder = new NotificationCompat.Builder(this); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { - builder.setSmallIcon(R.drawable.ic_launcher) + builder.setSmallIcon(R.drawable.ic_stat_notify) + .setLargeIcon(getBitmap(R.drawable.ic_launcher, getBaseContext())) .setContentTitle(getString(R.string.app_name)) .setContentText(String.format(getString(R.string.passp_cache_notif_n_keys), mPassphraseCache.size())); @@ -510,7 +528,8 @@ public class PassphraseCacheService extends Service { ); } else { // Fallback, since expandable notifications weren't available back then - builder.setSmallIcon(R.drawable.ic_launcher) + builder.setSmallIcon(R.drawable.ic_stat_notify) + .setLargeIcon(getBitmap(R.drawable.ic_launcher, getBaseContext())) .setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys), mPassphraseCache.size())) .setContentText(getString(R.string.passp_cache_notif_click_to_clear)); diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_stat_notify.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..b31481995 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_stat_notify.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..39e799e5a --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_stat_notify.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..af1613d40 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_stat_notify.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..9da107396 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_stat_notify.png diff --git a/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_stat_notify.png b/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_stat_notify.png Binary files differnew file mode 100644 index 000000000..5c81db8bf --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_stat_notify.png @@ -204,15 +204,18 @@ See [In-app about screen](https://github.com/open-keychain/open-keychain/blob/HE ### Images * icon.svg modified version of kgpg_key2_kopete.svgz - + +* ic_stat_notify.svg + modified version of Key by Egor Culcea from the Noun Project https://thenounproject.com/term/key/2511/ + * Actionbar icons http://developer.android.com/design/downloads/index.html#action-bar-icon-pack - + * QR Code Actionbar icon https://github.com/openintents/openintents/blob/master/extensions/qrcode_ext/icons/ic_menu_qr_code/ic_menu_qr_code_holo_light/ic_menu_qr_code.svg * Key status icons by the ModernPGP working group https://github.com/ModernPGP - + * Purple color scheme http://android-holo-colors.com/ |