Skip to content

Commit 8338f38

Browse files
committed
renaming OSInAppMessageStyle to OSInAppMessageContent
1 parent 0832d44 commit 8338f38

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.onesignal
2+
3+
import org.json.JSONObject
4+
5+
const val HTML = "html"
6+
const val STYLES = "styles"
7+
const val DISPLAY_DURATION = "display_duration"
8+
const val TOP_MARGIN = "top_margin"
9+
const val BOTTOM_MARGIN = "bottom_margin"
10+
const val LEFT_MARGIN = "left_margin"
11+
const val RIGHT_MARGIN = "right_margin"
12+
13+
internal open class OSInAppMessageContent constructor(jsonObject: JSONObject) {
14+
var contentHtml: String? = null
15+
var topMargin: Int? = 1
16+
var bottomMargin: Int? = 1
17+
var leftMargin: Int? = 1
18+
var rightMargin: Int? = 1
19+
// The following properties are populated from Javascript events
20+
var displayLocation: WebViewManager.Position? = null
21+
var dismissDuration: Double? = null
22+
var pageHeight: Int = 0
23+
24+
init {
25+
contentHtml = jsonObject.optString(HTML)
26+
displayDuration = jsonObject.optDouble(DISPLAY_DURATION)
27+
var styles: JSONObject? = jsonObject.optJSONObject(STYLES)
28+
topMargin = styles?.optInt(TOP_MARGIN, 1)
29+
bottomMargin = styles?.optInt(BOTTOM_MARGIN, 1)
30+
leftMargin = styles?.optInt(LEFT_MARGIN, 1)
31+
rightMargin = styles?.optInt(RIGHT_MARGIN,1)
32+
}
33+
}

OneSignalSDK/onesignal/src/main/java/com/onesignal/OSInAppMessageStyle.kt

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)