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
acf59a84
Commit
acf59a84
authored
Oct 10, 2017
by
Sebastián Katzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow led option to be a hash as well
parent
bc2c02cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
Options.java
src/android/notification/Options.java
+15
-4
No files found.
src/android/notification/Options.java
View file @
acf59a84
...
...
@@ -170,6 +170,9 @@ public class Options {
}
else
if
(
cfg
instanceof
JSONArray
)
{
hex
=
options
.
optJSONArray
(
"led"
).
optString
(
0
);
}
else
if
(
cfg
instanceof
JSONObject
)
{
hex
=
options
.
optJSONObject
(
"led"
).
optString
(
"color"
);
}
if
(
hex
==
null
)
...
...
@@ -192,11 +195,15 @@ public class Options {
*/
int
getLedOn
()
{
Object
cfg
=
options
.
opt
(
"led"
);
int
defVal
=
1000
;
if
(
cfg
instanceof
JSONArray
)
return
options
.
optJSONArray
(
"led"
).
optInt
(
1
);
return
options
.
optJSONArray
(
"led"
).
optInt
(
1
,
defVal
);
if
(
cfg
instanceof
JSONObject
)
return
options
.
optJSONObject
(
"led"
).
optInt
(
"on"
,
defVal
);
return
1000
;
return
defVal
;
}
/**
...
...
@@ -204,11 +211,15 @@ public class Options {
*/
int
getLedOff
()
{
Object
cfg
=
options
.
opt
(
"led"
);
int
defVal
=
1000
;
if
(
cfg
instanceof
JSONArray
)
return
options
.
optJSONArray
(
"led"
).
optInt
(
2
);
return
options
.
optJSONArray
(
"led"
).
optInt
(
2
,
defVal
);
if
(
cfg
instanceof
JSONObject
)
return
options
.
optJSONObject
(
"led"
).
optInt
(
"off"
,
defVal
);
return
1000
;
return
defVal
;
}
/**
...
...
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