-
Notifications
You must be signed in to change notification settings - Fork 289
feat(fcm): Add 12 new android notification params support #320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ebd8b1b
Add 12 new parameter support for Android Notifications
chong-shao 3cb348d
Add new classes for the new light settings field
chong-shao 69de21b
set time zone in the test to be UTC
chong-shao 9e4fcf7
Add support for defaultLightSettings
chong-shao c08771d
Update Color class to include alpha, address reviewers comments
chong-shao d5096cc
Remove Duration class, use String to represent lightOn/OffDuration an…
chong-shao 92b7990
Address reviewer's comments
chong-shao 6e25179
Add priority mapping so the priority values are with the prefix "PRIO…
chong-shao 62dac2b
address reviewer's comments
chong-shao 013e945
address reviewer's comments
chong-shao b3bf96b
address reviewer's comments
chong-shao fb65807
Rename Color to LightSettingsColor
chong-shao b9c677c
Add LightSettingsColor class
chong-shao f02c2bc
address reviewer's comments
chong-shao 0c5e8bb
Parse timestamp with a timezone 'Z' so that in the MessageTest, the e…
chong-shao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright 2019 Google Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.firebase.messaging; | ||
|
||
import static com.google.common.base.Preconditions.checkArgument; | ||
|
||
import com.google.api.client.util.Key; | ||
|
||
/** | ||
* A class representing color in LightSettings. | ||
*/ | ||
public final class Color { | ||
|
||
@Key("red") | ||
private final Float red; | ||
|
||
@Key("green") | ||
private final Float green; | ||
|
||
@Key("blue") | ||
private final Float blue; | ||
|
||
@Key("alpha") | ||
private final Float alpha; | ||
|
||
/** | ||
* Creates a new {@link Color} using the given red, green, blue, and | ||
* alpha values. | ||
* | ||
* @param red The red component. | ||
* @param green The green component. | ||
* @param blue The blue component. | ||
* @param alpha The alpha component. | ||
*/ | ||
public Color(float red, float green, float blue, float alpha) { | ||
this.red = red; | ||
this.green = green; | ||
this.blue = blue; | ||
this.alpha = alpha; | ||
} | ||
|
||
/** | ||
* Creates a new {@link Color} with a string. Alpha of the color will be | ||
* set to 1. | ||
* | ||
* @param rrggbb Color specified in the {@code #rrggbb} format. | ||
* @return A {@link Color} instance. | ||
*/ | ||
public static Color fromString(String rrggbb) { | ||
checkArgument(rrggbb.matches("^#[0-9a-fA-F]{6}$"), | ||
"color must be in the form #RRGGBB"); | ||
float red = (float) Integer.parseInt(rrggbb.substring(1, 3), 16) / 255.0f; | ||
float green = (float) Integer.valueOf(rrggbb.substring(3, 5), 16) / 255.0f; | ||
float blue = (float) Integer.valueOf(rrggbb.substring(5, 7), 16) / 255.0f; | ||
return new Color(red, green, blue, 1.0f); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.