New all-white status bar icon to fix issue #1356
51
Graphics/drawables/ic_stat_notify.svg
Normal file
|
@ -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>
|
After Width: | Height: | Size: 2.4 KiB |
BIN
OpenKeychain/src/debug/res/drawable-hdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
OpenKeychain/src/debug/res/drawable-mdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
OpenKeychain/src/debug/res/drawable-xhdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
OpenKeychain/src/debug/res/drawable-xxhdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
OpenKeychain/src/debug/res/drawable-xxxhdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
|
@ -36,6 +36,9 @@ import android.os.Messenger;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.support.v4.app.NotificationCompat;
|
import android.support.v4.app.NotificationCompat;
|
||||||
import android.support.v4.util.LongSparseArray;
|
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.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
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() {
|
private Notification getNotification() {
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
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))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
.setContentText(String.format(getString(R.string.passp_cache_notif_n_keys),
|
.setContentText(String.format(getString(R.string.passp_cache_notif_n_keys),
|
||||||
mPassphraseCache.size()));
|
mPassphraseCache.size()));
|
||||||
|
@ -510,7 +528,8 @@ public class PassphraseCacheService extends Service {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Fallback, since expandable notifications weren't available back then
|
// 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),
|
.setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys),
|
||||||
mPassphraseCache.size()))
|
mPassphraseCache.size()))
|
||||||
.setContentText(getString(R.string.passp_cache_notif_click_to_clear));
|
.setContentText(getString(R.string.passp_cache_notif_click_to_clear));
|
||||||
|
|
BIN
OpenKeychain/src/main/res/drawable-hdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
OpenKeychain/src/main/res/drawable-mdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
OpenKeychain/src/main/res/drawable-xhdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
OpenKeychain/src/main/res/drawable-xxhdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
OpenKeychain/src/main/res/drawable-xxxhdpi/ic_stat_notify.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
|
@ -205,6 +205,9 @@ See [In-app about screen](https://github.com/open-keychain/open-keychain/blob/HE
|
||||||
* icon.svg
|
* icon.svg
|
||||||
modified version of kgpg_key2_kopete.svgz
|
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
|
* Actionbar icons
|
||||||
http://developer.android.com/design/downloads/index.html#action-bar-icon-pack
|
http://developer.android.com/design/downloads/index.html#action-bar-icon-pack
|
||||||
|
|
||||||
|
|