Skip to content

Conversation

@davidtruong
Copy link
Contributor

No description provided.

@davidtruong
Copy link
Contributor Author

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" +
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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");
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra whitespace

Copy link
Contributor Author

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
*/
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about horizontal?

Copy link
Contributor Author

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) {
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

@dontgitit dontgitit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine

@davidtruong davidtruong merged commit b1e9c7f into master Nov 3, 2017
@davidtruong davidtruong changed the title <In-Progress> Feature/itbl 2763 html in app notifcation Feature/itbl 2763 html in app notifcation Nov 6, 2017
@davidtruong davidtruong deleted the feature/ITBL-2763-html-in-app-notifcation branch April 11, 2018 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants