Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cordova-plugin-local-notifications
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nabil Sadki
cordova-plugin-local-notifications
Commits
5cb48c41
Commit
5cb48c41
authored
Dec 29, 2015
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added color option for Android
parent
3afb5985
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletions
+26
-1
CHANGELOG.md
CHANGELOG.md
+2
-1
Builder.java
src/android/notification/Builder.java
+5
-0
Options.java
src/android/notification/Options.java
+18
-0
local-notification-util.js
www/local-notification-util.js
+1
-0
No files found.
CHANGELOG.md
View file @
5cb48c41
...
...
@@ -4,7 +4,8 @@ ChangeLog
Please also read the
[
Upgrade Guide
](
https://github.com/katzer/cordova-plugin-local-notifications/wiki/Upgrade-Guide
)
for more information.
#### Version 0.8.3 (not yet released)
-
New "quarter" intervall for iOS & Android
-
New
`color`
attribute for Android (Thanks to @Eusebius1920)
-
New
`quarter`
intervall for iOS & Android
-
Made small icon optional (Android)
-
Fixed #588 crash when basename & extension can't be extracted (Android)
-
Fixed #732 loop between update and trigger (Android)
...
...
src/android/notification/Builder.java
View file @
5cb48c41
...
...
@@ -127,12 +127,17 @@ public class Builder {
.
setTicker
(
options
.
getText
())
.
setAutoCancel
(
options
.
isAutoClear
())
.
setOngoing
(
options
.
isOngoing
())
.
setColor
(
options
.
getColor
())
.
setLights
(
options
.
getLedColor
(),
500
,
500
);
if
(
sound
!=
null
)
{
builder
.
setSound
(
sound
);
}
if
(
sound
!=
null
)
{
builder
.
setSound
(
sound
);
}
if
(
smallIcon
==
0
)
{
builder
.
setSmallIcon
(
options
.
getIcon
());
}
else
{
...
...
src/android/notification/Options.java
View file @
5cb48c41
...
...
@@ -27,6 +27,7 @@ import android.app.AlarmManager;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.net.Uri
;
import
android.support.v4.app.NotificationCompat
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
...
...
@@ -250,6 +251,23 @@ public class Options {
}
/**
* @return
* The notification background color for the small icon
* Returns null, if no color is given.
*/
public
Integer
getColor
()
{
String
hex
=
options
.
optString
(
"color"
,
null
);
if
(
hex
==
null
)
{
return
NotificationCompat
.
COLOR_DEFAULT
;
}
int
aRGB
=
Integer
.
parseInt
(
hex
,
16
);
return
aRGB
+
0xFF000000
;
}
/**
* Sound file path for the local notification.
*/
public
Uri
getSoundUri
()
{
...
...
www/local-notification-util.js
View file @
5cb48c41
...
...
@@ -65,6 +65,7 @@ exports.applyPlatformSpecificOptions = function () {
defaults
.
ongoing
=
false
;
defaults
.
autoClear
=
true
;
defaults
.
led
=
'FFFFFF'
;
defaults
.
color
=
undefined
;
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment