@@ -5,17 +5,13 @@ import org.json.JSONObject
5
5
const val HTML = " html"
6
6
const val STYLES = " styles"
7
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"
8
+ const val REMOVE_HEIGHT_MARGIN = " remove_height_margin"
9
+ const val REMOVE_WIDTH_MARGIN = " remove_width_margin"
12
10
13
11
internal open class OSInAppMessageContent constructor(jsonObject : JSONObject ) {
14
12
var contentHtml: String? = null
15
- var topMargin: Int? = 1
16
- var bottomMargin: Int? = 1
17
- var leftMargin: Int? = 1
18
- var rightMargin: Int? = 1
13
+ var useHeightMargin: Boolean = true
14
+ var useWidthMargin: Boolean = true
19
15
// The following properties are populated from Javascript events
20
16
var displayLocation: WebViewManager .Position ? = null
21
17
var displayDuration: Double? = null
@@ -25,9 +21,7 @@ internal open class OSInAppMessageContent constructor(jsonObject: JSONObject) {
25
21
contentHtml = jsonObject.optString(HTML )
26
22
displayDuration = jsonObject.optDouble(DISPLAY_DURATION )
27
23
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 )
24
+ useHeightMargin = ! (styles?.optBoolean(REMOVE_HEIGHT_MARGIN , false ) ? : false )
25
+ useWidthMargin = ! (styles?.optBoolean(REMOVE_WIDTH_MARGIN , false ) ? : false )
32
26
}
33
27
}
0 commit comments