aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@dominikschuermann.de>2015-12-22 01:46:11 +0100
committerDominik Schürmann <dominik@dominikschuermann.de>2015-12-22 01:46:11 +0100
commit35e16b75b243fd301642bbf1572f85ebbef1c161 (patch)
tree48b57091a666775e3f37f4ec9dca65013260866d /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util
parent6c25cb19270b70eb8dd20f9731b3b65cbc198f11 (diff)
downloadopen-keychain-35e16b75b243fd301642bbf1572f85ebbef1c161.tar.gz
open-keychain-35e16b75b243fd301642bbf1572f85ebbef1c161.tar.bz2
open-keychain-35e16b75b243fd301642bbf1572f85ebbef1c161.zip
Follow notification style guidelines, dismiss permission notification on click
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/NotificationUtils.java50
1 files changed, 0 insertions, 50 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/NotificationUtils.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/NotificationUtils.java
deleted file mode 100644
index 40ff92a1c..000000000
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/NotificationUtils.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2015 Dominik Schürmann <dominik@dominikschuermann.de>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package org.sufficientlysecure.keychain.ui.util;
-
-import android.content.Context;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.drawable.Drawable;
-import android.os.Build;
-
-public class NotificationUtils {
-
- // from de.azapps.mirakel.helper.Helpers from https://github.com/MirakelX/mirakel-android
- public static Bitmap getBitmap(int resId, Context context) {
- int mLargeIconWidth = (int) context.getResources().getDimension(
- android.R.dimen.notification_large_icon_width);
- int mLargeIconHeight = (int) context.getResources().getDimension(
- android.R.dimen.notification_large_icon_height);
- Drawable d;
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
- // noinspection deprecation (can't help it at this api level)
- d = context.getResources().getDrawable(resId);
- } else {
- d = context.getDrawable(resId);
- }
- if (d == null) {
- return null;
- }
- Bitmap b = Bitmap.createBitmap(mLargeIconWidth, mLargeIconHeight, Bitmap.Config.ARGB_8888);
- Canvas c = new Canvas(b);
- d.setBounds(0, 0, mLargeIconWidth, mLargeIconHeight);
- d.draw(c);
- return b;
- }
-}