Commit 215a6597 by Sebastián Katzer

New Android specific `led:` flag

parent 91169ad7
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
- [enhancement:] Scope parameter for `isScheduled` and `getScheduledIds` - [enhancement:] Scope parameter for `isScheduled` and `getScheduledIds`
- [enhancement:] Callbacks for `cancel` & `cancelAll` - [enhancement:] Callbacks for `cancel` & `cancelAll`
- [enhancement:] `image:` accepts remote URLs and local URIs (Android) - [enhancement:] `image:` accepts remote URLs and local URIs (Android)
- [feature:] New Android specific `led:` flag.
#### Version 0.7.4 (22.03.2014) #### Version 0.7.4 (22.03.2014)
- [bugfix:] Platform specific properties were ignored. - [bugfix:] Platform specific properties were ignored.
......
...@@ -74,6 +74,7 @@ More informations can be found [here][PGB_plugin]. ...@@ -74,6 +74,7 @@ More informations can be found [here][PGB_plugin].
- [enhancement:] Scope parameter for `isScheduled` and `getScheduledIds` - [enhancement:] Scope parameter for `isScheduled` and `getScheduledIds`
- [enhancement:] Callbacks for `cancel` & `cancelAll` - [enhancement:] Callbacks for `cancel` & `cancelAll`
- [enhancement:] `image:` accepts remote URLs and local URIs (Android) - [enhancement:] `image:` accepts remote URLs and local URIs (Android)
- [feature:] New Android specific `led:` flag
#### Further informations #### Further informations
- See [CHANGELOG.md][changelog] to get the full changelog for the plugin. - See [CHANGELOG.md][changelog] to get the full changelog for the plugin.
...@@ -420,6 +421,13 @@ To specify a custom interval, the `repeat` property can be assigned with an numb ...@@ -420,6 +421,13 @@ To specify a custom interval, the `repeat` property can be assigned with an numb
window.plugin.notification.local.add({ repeat: 15 }); window.plugin.notification.local.add({ repeat: 15 });
``` ```
### Change the LED color on Android devices
The LED color can be specified through the `led` property. By default the color value is white (FFFFFF). Its possible to change that value by setting another hex code.
```javascript
window.plugin.notification.local.add({ led: 'A0FF05' });
```
## Quirks ## Quirks
......
...@@ -245,6 +245,19 @@ public class Options { ...@@ -245,6 +245,19 @@ public class Options {
} }
/** /**
* @return
* The notification color for LED
*/
public int getColor () {
String hexColor = options.optString("led", "000000");
int aRGB = Integer.parseInt(hexColor,16);
aRGB += 0xFF000000;
return aRGB;
}
/**
* Returns numerical icon Value * Returns numerical icon Value
* *
* @param {String} className * @param {String} className
......
...@@ -126,7 +126,8 @@ public class Receiver extends BroadcastReceiver { ...@@ -126,7 +126,8 @@ public class Receiver extends BroadcastReceiver {
.setSmallIcon(options.getSmallIcon()) .setSmallIcon(options.getSmallIcon())
.setLargeIcon(options.getIcon()) .setLargeIcon(options.getIcon())
.setAutoCancel(options.getAutoCancel()) .setAutoCancel(options.getAutoCancel())
.setOngoing(options.getOngoing()); .setOngoing(options.getOngoing())
.setLights(options.getColor(), 500, 500);
if (sound != null) { if (sound != null) {
notification.setSound(sound); notification.setSound(sound);
......
...@@ -95,6 +95,7 @@ LocalNotification.prototype = { ...@@ -95,6 +95,7 @@ LocalNotification.prototype = {
defaults.icon = 'icon'; defaults.icon = 'icon';
defaults.smallIcon = null; defaults.smallIcon = null;
defaults.ongoing = false; defaults.ongoing = false;
defaults.led = 'FFFFFF'; /*RRGGBB*/
defaults.sound = 'TYPE_NOTIFICATION'; break; defaults.sound = 'TYPE_NOTIFICATION'; break;
case 'iOS': case 'iOS':
defaults.sound = ''; break; defaults.sound = ''; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment