-
Notifications
You must be signed in to change notification settings - Fork 33
Feature/itbl 2763 html in app notifcation #19
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
Feature/itbl 2763 html in app notifcation #19
Conversation
Added in click close callback handler
Added in optional parameters for SDK & platform Updated setter functions for notification
|
Starting the review now, still need to wrap up some unit tests. |
| public void spawnInAppNotification(final Context context, final IterableHelper.IterableActionHandler clickCallback) { | ||
| String htmlString; | ||
|
|
||
| htmlString = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional //EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><meta name=\"viewport\" content=\"width=device-width\"/><!--[if !mso]><!--><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"/><!--<![endif]--><title>Simple</title><style type=\"text/css\" id=\"media-query\">\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a better place to put/format this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should actually be removed. Missed it from the diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
| addEmailOrUserIdToJson(requestJSON); | ||
| requestJSON.put(IterableConstants.ITERABLE_IN_APP_COUNT, count); | ||
| requestJSON.put(IterableConstants.KEY_PLATFORM, IterableConstants.ITBL_PLATFORM_ANDROID); | ||
| requestJSON.put(IterableConstants.ITBL_KEY_SDK_VERSION, "0.0.0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably want something other than 0.0.0... and can you pull the value from some other config or something? seems weird to have it hardcoded here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| */ | ||
| int getLocation(Rect padding) { | ||
| int gravity = Gravity.CENTER_VERTICAL; | ||
| if (padding.top == 0 && padding.bottom < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra whitespace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
| * Retrieves the padding percentage | ||
| * @param jsonObject | ||
| * @return | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to return a display percentage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonSEng: For V2 What are your thoughts on changing the server API to just return -1 rather than displayOption/AutoExpand?
Changing that on the server is still backwards compatible with the SDK since I get the percentage.
| * @return | ||
| */ | ||
| int getLocation(Rect padding) { | ||
| int gravity = Gravity.CENTER_VERTICAL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about horizontal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The horizontal position gets handled through the offset calculation in resize. I'll add some documentation to that.
| * @param padding | ||
| * @return | ||
| */ | ||
| int getLocation(Rect padding) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole percentage/padding/-1 thing seems kind of jank
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any issues with this function specifically?
Basically 0 represents a fixed dialog location, and -1 represents automatic resizing for that side of the dialog.
I think that decodePadding could be cleaned up so that we pass down -1 directly from the server rather than the Autoexpand/displayOption.
dontgitit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems fine
No description provided.