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
327f01f9
Commit
327f01f9
authored
Sep 05, 2016
by
Dani Palou
Committed by
Sebastián Katzer
Sep 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow configuring Android led time (#1080)
Default time extended from 100 to 1000 ms
parent
366557fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletions
+39
-1
Builder.java
src/android/notification/Builder.java
+1
-1
Options.java
src/android/notification/Options.java
+36
-0
local-notification-util.js
www/local-notification-util.js
+2
-0
No files found.
src/android/notification/Builder.java
View file @
327f01f9
...
...
@@ -131,7 +131,7 @@ public class Builder {
.
setColor
(
options
.
getColor
());
if
(
ledColor
!=
0
)
{
builder
.
setLights
(
ledColor
,
100
,
100
);
builder
.
setLights
(
ledColor
,
options
.
getLedOnTime
(),
options
.
getLedOffTime
()
);
}
if
(
sound
!=
null
)
{
...
...
src/android/notification/Options.java
View file @
327f01f9
...
...
@@ -252,6 +252,42 @@ public class Options {
/**
* @return
* The time that the LED should be on (in milliseconds).
*/
public
int
getLedOnTime
()
{
String
timeOn
=
options
.
optString
(
"ledOnTime"
,
null
);
if
(
timeOn
==
null
)
{
return
1000
;
}
try
{
return
Integer
.
parseInt
(
timeOn
);
}
catch
(
NumberFormatException
e
)
{
return
1000
;
}
}
/**
* @return
* The time that the LED should be off (in milliseconds).
*/
public
int
getLedOffTime
()
{
String
timeOff
=
options
.
optString
(
"ledOffTime"
,
null
);
if
(
timeOff
==
null
)
{
return
1000
;
}
try
{
return
Integer
.
parseInt
(
timeOff
);
}
catch
(
NumberFormatException
e
)
{
return
1000
;
}
}
/**
* @return
* The notification background color for the small icon
* Returns null, if no color is given.
*/
...
...
www/local-notification-util.js
View file @
327f01f9
...
...
@@ -68,6 +68,8 @@ exports.applyPlatformSpecificOptions = function () {
defaults
.
ongoing
=
false
;
defaults
.
autoClear
=
true
;
defaults
.
led
=
undefined
;
defaults
.
ledOnTime
=
undefined
;
defaults
.
ledOffTime
=
undefined
;
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