public class NotificationUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NotificationUtil.GeneralIcon
Plugins using the NotificationUtil will need to use resources that are built into ATAK.
|
static class |
NotificationUtil.NotificationColor
Class used to represent the color of the icon backed by the integer representation in ARGB format.
|
static interface |
NotificationUtil.NotificationListener |
Modifier and Type | Field and Description |
---|---|
static NotificationUtil.NotificationColor |
BLUE |
static int |
DEFAULT_NOTIFY_ID |
static NotificationUtil.NotificationColor |
GREEN
Color choices for icons.
|
static NotificationUtil.NotificationColor |
RED |
static java.lang.String |
TAG |
static NotificationUtil.NotificationColor |
WHITE |
static NotificationUtil.NotificationColor |
YELLOW |
Modifier and Type | Method and Description |
---|---|
void |
addOnRemoveListener(MapItem marker)
Add a listener to remove a notification should the marker be removed.
|
void |
cancelAll()
Cancels all notification managed by the notification manager.
|
void |
clearNotification(int notifyId)
Clears a notification managed referenced by its notification identifier.
|
void |
dispose() |
static NotificationUtil |
getInstance() |
android.app.Notification.Builder |
getNotificationBuilder(int notifyId)
Obtains the notification builder currently being used by the specified Notification Identifier.
|
void |
initialize(android.content.Context svc) |
void |
postMarkerNotification(MapItem mapItem,
int notifyId,
int icon,
NotificationUtil.NotificationColor color,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg,
android.content.Intent notificationIntent,
boolean user)
Essentially a wrapper to postNotification in NotificationUtils.
|
void |
postNotification(int notifyId,
int icon,
NotificationUtil.NotificationColor color,
java.lang.String title,
java.lang.String msg,
android.content.Intent notificationIntent,
boolean user)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
void |
postNotification(int notifyId,
int icon,
NotificationUtil.NotificationColor color,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
void |
postNotification(int notifyId,
int icon,
NotificationUtil.NotificationColor color,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg,
android.content.Intent notificationIntent,
boolean user)
Produces a standard notification with a ticker, no sound, vibrate, or flashing.
|
void |
postNotification(int notifyId,
int icon,
NotificationUtil.NotificationColor color,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg,
android.content.Intent notificationIntent,
boolean vibrate,
boolean chime,
boolean blink,
boolean user)
Produces a standard notification with or without a ticker.
|
void |
postNotification(int notifyId,
int icon,
java.lang.String title,
java.lang.String msg,
android.content.Intent notificationIntent,
boolean user)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
void |
postNotification(int notifyId,
int icon,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
void |
postNotification(int notifyId,
int icon,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg,
android.content.Intent notificationIntent,
boolean user)
Produces a standard notification with a ticker, no sound, vibrate, or flashing without a specified color.
|
void |
postNotification(int notifyId,
int icon,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg,
android.content.Intent notificationIntent,
boolean vibrate,
boolean chime,
boolean blink,
boolean user)
Produces a standard notification with a ticker, no sound, vibrate, or flashing without a specified color.
|
void |
postNotification(int notifyId,
android.app.Notification notification,
boolean fade)
Given a notification, post it either under the control of the notification fader or not.
|
int |
postNotification(int icon,
NotificationUtil.NotificationColor color,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
int |
postNotification(int icon,
NotificationUtil.NotificationColor color,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg,
android.content.Intent notificationIntent)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
int |
postNotification(int icon,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
int |
postNotification(int icon,
java.lang.String title,
java.lang.String ticker,
java.lang.String msg,
android.content.Intent notificationIntent)
Produces a standard notification without a ticker, no sound, vibrate, or flashing.
|
void |
registerNotificationListener(NotificationUtil.NotificationListener listener)
Registers a notification listener with the centralized notification class.
|
int |
reserveNotifyId()
Reserves a notification identifier that is unique for the current run of the application.
|
void |
unregisterNotificationListener(NotificationUtil.NotificationListener listener)
Unregisters a notification listener with the centralized notification class.
|
public static NotificationUtil.NotificationColor GREEN
public static NotificationUtil.NotificationColor RED
public static NotificationUtil.NotificationColor YELLOW
public static NotificationUtil.NotificationColor WHITE
public static NotificationUtil.NotificationColor BLUE
public static final java.lang.String TAG
public static final int DEFAULT_NOTIFY_ID
public static NotificationUtil getInstance()
public void initialize(android.content.Context svc)
public void dispose()
public void cancelAll()
public void addOnRemoveListener(MapItem marker)
marker
- The marker that needs to be watched.public int postNotification(int icon, java.lang.String title, java.lang.String ticker, java.lang.String msg)
public void postNotification(int notifyId, int icon, java.lang.String title, java.lang.String ticker, java.lang.String msg)
public int postNotification(int icon, java.lang.String title, java.lang.String ticker, java.lang.String msg, android.content.Intent notificationIntent)
public void postNotification(int notifyId, int icon, java.lang.String title, java.lang.String msg, android.content.Intent notificationIntent, boolean user)
public int postNotification(int icon, NotificationUtil.NotificationColor color, java.lang.String title, java.lang.String ticker, java.lang.String msg)
public void postNotification(int notifyId, int icon, NotificationUtil.NotificationColor color, java.lang.String title, java.lang.String ticker, java.lang.String msg)
public int postNotification(int icon, NotificationUtil.NotificationColor color, java.lang.String title, java.lang.String ticker, java.lang.String msg, android.content.Intent notificationIntent)
public void postNotification(int notifyId, int icon, NotificationUtil.NotificationColor color, java.lang.String title, java.lang.String msg, android.content.Intent notificationIntent, boolean user)
public void postMarkerNotification(MapItem mapItem, int notifyId, int icon, NotificationUtil.NotificationColor color, java.lang.String title, java.lang.String ticker, java.lang.String msg, android.content.Intent notificationIntent, boolean user)
notifyId
- the identifying number for the notificationicon
- The resource id of the icon to put in the status bar.color
- The color used to display the icon.title
- The title that goes in the expanded entry.ticker
- The text that flows by in the status bar when the notification first activates
or null, if no ticker is to be used.msg
- The text that goes in the expanded entry.notificationIntent
- the intent to fire when the notification is selected within ATAK.
If ATAK is not in the front, it will bring ATAK to the front and
pass the specified intent within the system.user
- specify if the user can dismiss the notification.public void postNotification(int notifyId, int icon, NotificationUtil.NotificationColor color, java.lang.String title, java.lang.String ticker, java.lang.String msg, android.content.Intent notificationIntent, boolean user)
public void postNotification(int notifyId, int icon, java.lang.String title, java.lang.String ticker, java.lang.String msg, android.content.Intent notificationIntent, boolean user)
public void postNotification(int notifyId, int icon, java.lang.String title, java.lang.String ticker, java.lang.String msg, android.content.Intent notificationIntent, boolean vibrate, boolean chime, boolean blink, boolean user)
public void postNotification(int notifyId, int icon, NotificationUtil.NotificationColor color, java.lang.String title, java.lang.String ticker, java.lang.String msg, android.content.Intent notificationIntent, boolean vibrate, boolean chime, boolean blink, boolean user)
notifyId
- the identifying number for the notificationicon
- The resource id of the icon to put in the status bar.color
- The color that may be applied to the icon.
Can be null to indicate that the default behavior should be used.title
- The title that goes in the expanded entry.ticker
- The text that flows by in the status bar when the notification first activates or
null, if no ticker is to be used.msg
- The text that goes in the expanded entry.notificationIntent
- the intent to fire when the notification is selected within ATAK. If ATAK
is not in the front, it will bring ATAK to the front and pass the specified intent within the
system.vibrate
- true to vibrate false to not.chime
- true to chime false to not.blink
- true to blink false to not.user
- set true if the user can dismiss the notification.public android.app.Notification.Builder getNotificationBuilder(int notifyId)
notifyId
- the notification id used.public void clearNotification(int notifyId)
notifyId
- the notification id used.public int reserveNotifyId()
public void postNotification(int notifyId, android.app.Notification notification, boolean fade)
notifyId
- the notification id used.notification
- the actual notification.fade
- false will remove this notification from the fader, true will begin or reset
the time for this notification to be removed.public void registerNotificationListener(NotificationUtil.NotificationListener listener)
listener
- the listener to registerpublic void unregisterNotificationListener(NotificationUtil.NotificationListener listener)
listener
- the listener to unregister