Panagiotis Triantafyllou

new model part1

...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
2 2
3 ext { 3 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 4 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.5.4r9' 5 + PUBLISH_VERSION = '4.5.5.4r10'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -103,6 +103,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -103,6 +103,7 @@ public class Campaign implements Parcelable, Serializable {
103 private String campaignTypeSettings; 103 private String campaignTypeSettings;
104 private String bannerImage; 104 private String bannerImage;
105 private String bannerTitle; 105 private String bannerTitle;
106 + private UnifiedCampaignModel unifiedCampaign;
106 107
107 /** 108 /**
108 * Basic constructor used to create an object from a String, representing a 109 * Basic constructor used to create an object from a String, representing a
...@@ -142,6 +143,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -142,6 +143,7 @@ public class Campaign implements Parcelable, Serializable {
142 this.campaignTypeSettings = ""; 143 this.campaignTypeSettings = "";
143 this.bannerImage = ""; 144 this.bannerImage = "";
144 this.bannerTitle = ""; 145 this.bannerTitle = "";
146 + this.unifiedCampaign = new UnifiedCampaignModel();
145 } 147 }
146 148
147 /** 149 /**
...@@ -628,6 +630,14 @@ public class Campaign implements Parcelable, Serializable { ...@@ -628,6 +630,14 @@ public class Campaign implements Parcelable, Serializable {
628 this.bannerTitle = bannerTitle; 630 this.bannerTitle = bannerTitle;
629 } 631 }
630 632
633 + public UnifiedCampaignModel getUnifiedCampaign() {
634 + return unifiedCampaign;
635 + }
636 +
637 + public void setUnifiedCampaign(UnifiedCampaignModel unifiedCampaign) {
638 + this.unifiedCampaign = unifiedCampaign;
639 + }
640 +
631 @Override 641 @Override
632 public int describeContents() { 642 public int describeContents() {
633 return 0; 643 return 0;
......
1 +package ly.warp.sdk.io.models;
2 +
3 +import org.json.JSONArray;
4 +import org.json.JSONObject;
5 +
6 +import java.io.Serializable;
7 +import java.util.ArrayList;
8 +
9 +/**
10 + * Created by Panagiotis Triantafyllou on 23/Feb/2024.
11 + */
12 +
13 +public class UnifiedCampaignModel implements Serializable {
14 + private String id, title, affiliatedId, shortDescription, longDescription,
15 + logoImagePath, bigLogoImagePath, dayText, imagePath, bigImagePath,
16 + markerImagePath, details;
17 + private int position, days;
18 + private boolean isHot;
19 + private ArrayList<UnifiedCampaignLocation> locations;
20 +
21 +
22 + public UnifiedCampaignModel() {
23 + this.id = "";
24 + this.title = "";
25 + this.affiliatedId = "";
26 + this.shortDescription = "";
27 + this.longDescription = "";
28 + this.logoImagePath = "";
29 + this.bigLogoImagePath = "";
30 + this.dayText = "";
31 + this.imagePath = "";
32 + this.bigImagePath = "";
33 + this.markerImagePath = "";
34 + this.details = "";
35 + this.position = 0;
36 + this.days = 0;
37 + this.isHot = false;
38 + this.locations = new ArrayList<UnifiedCampaignLocation>();
39 + }
40 +
41 + public UnifiedCampaignModel(JSONObject jobj) {
42 + if (jobj != null) {
43 + this.id = jobj.optString("id", "");
44 + this.title = jobj.optString("title", "");
45 + this.affiliatedId = jobj.optString("affiliatedId", "");
46 + this.shortDescription = jobj.optString("shortDescription", "");
47 + this.longDescription = jobj.optString("longDescription", "");
48 + this.logoImagePath = jobj.optString("logoImagePath", "");
49 + this.bigLogoImagePath = jobj.optString("bigLogoImagePath", "");
50 + this.dayText = jobj.optString("dayText", "");
51 + this.imagePath = jobj.optString("imagePath", "");
52 + this.bigImagePath = jobj.optString("bigImagePath", "");
53 + this.markerImagePath = jobj.optString("markerImagePath", "");
54 + this.details = jobj.optString("details", "");
55 + this.position = jobj.optInt("position", 0);
56 + this.days = jobj.optInt("days", 0);
57 + this.isHot = jobj.optBoolean("isHot", false);
58 + this.locations = new ArrayList<>();
59 + JSONArray tempLocations = new JSONArray();
60 + tempLocations = jobj.optJSONArray("locations");
61 + if (tempLocations != null && tempLocations.length() > 0) {
62 + ArrayList<UnifiedCampaignLocation> locationsList = new ArrayList<>();
63 + for (int i = 0; i < tempLocations.length(); i++) {
64 + locationsList.add(new UnifiedCampaignLocation(tempLocations.optJSONObject(i)));
65 + }
66 + this.locations.addAll(locationsList);
67 + }
68 + }
69 + }
70 +
71 + public class UnifiedCampaignLocation {
72 + private String id, title, address, municipality, telephone,
73 + afiliateId, url, logoImage, pinLogoImage;
74 + private int roadNumber;
75 + private double latitude = 0.0;
76 + private double longitude = 0.0;
77 +
78 + public UnifiedCampaignLocation() {
79 + this.id = "";
80 + this.title = "";
81 + this.address = "";
82 + this.municipality = "";
83 + this.telephone = "";
84 + this.afiliateId = "";
85 + this.url = "";
86 + this.logoImage = "";
87 + this.pinLogoImage = "";
88 + this.roadNumber = 0;
89 + this.latitude = 0.0;
90 + this.longitude = 0.0;
91 + }
92 +
93 + public UnifiedCampaignLocation(JSONObject jobj) {
94 + if (jobj != null) {
95 + this.id = jobj.optString("id", "");
96 + this.title = jobj.optString("title", "");
97 + this.address = jobj.optString("address", "");
98 + this.municipality = jobj.optString("municipality", "");
99 + this.telephone = jobj.optString("telephone", "");
100 + this.afiliateId = jobj.optString("afiliateId", "");
101 + this.url = jobj.optString("url", "");
102 + this.logoImage = jobj.optString("logoImage", "");
103 + this.pinLogoImage = jobj.optString("pinLogoImage", "");
104 + this.roadNumber = jobj.optInt("roadNumber", 0);
105 + this.latitude = jobj.optDouble("latitude", 0.0);
106 + this.longitude = jobj.optDouble("longitude", 0.0);
107 + }
108 + }
109 +
110 + public String getId() {
111 + return id;
112 + }
113 +
114 + public void setId(String id) {
115 + this.id = id;
116 + }
117 +
118 + public String getTitle() {
119 + return title;
120 + }
121 +
122 + public void setTitle(String title) {
123 + this.title = title;
124 + }
125 +
126 + public String getAddress() {
127 + return address;
128 + }
129 +
130 + public void setAddress(String address) {
131 + this.address = address;
132 + }
133 +
134 + public String getMunicipality() {
135 + return municipality;
136 + }
137 +
138 + public void setMunicipality(String municipality) {
139 + this.municipality = municipality;
140 + }
141 +
142 + public String getTelephone() {
143 + return telephone;
144 + }
145 +
146 + public void setTelephone(String telephone) {
147 + this.telephone = telephone;
148 + }
149 +
150 + public String getAfiliateId() {
151 + return afiliateId;
152 + }
153 +
154 + public void setAfiliateId(String afiliateId) {
155 + this.afiliateId = afiliateId;
156 + }
157 +
158 + public String getUrl() {
159 + return url;
160 + }
161 +
162 + public void setUrl(String url) {
163 + this.url = url;
164 + }
165 +
166 + public String getLogoImage() {
167 + return logoImage;
168 + }
169 +
170 + public void setLogoImage(String logoImage) {
171 + this.logoImage = logoImage;
172 + }
173 +
174 + public String getPinLogoImage() {
175 + return pinLogoImage;
176 + }
177 +
178 + public void setPinLogoImage(String pinLogoImage) {
179 + this.pinLogoImage = pinLogoImage;
180 + }
181 +
182 + public int getRoadNumber() {
183 + return roadNumber;
184 + }
185 +
186 + public void setRoadNumber(int roadNumber) {
187 + this.roadNumber = roadNumber;
188 + }
189 +
190 + public double getLatitude() {
191 + return latitude;
192 + }
193 +
194 + public void setLatitude(double latitude) {
195 + this.latitude = latitude;
196 + }
197 +
198 + public double getLongitude() {
199 + return longitude;
200 + }
201 +
202 + public void setLongitude(double longitude) {
203 + this.longitude = longitude;
204 + }
205 + }
206 +
207 + public String getId() {
208 + return id;
209 + }
210 +
211 + public void setId(String id) {
212 + this.id = id;
213 + }
214 +
215 + public String getTitle() {
216 + return title;
217 + }
218 +
219 + public void setTitle(String title) {
220 + this.title = title;
221 + }
222 +
223 + public String getAffiliatedId() {
224 + return affiliatedId;
225 + }
226 +
227 + public void setAffiliatedId(String affiliatedId) {
228 + this.affiliatedId = affiliatedId;
229 + }
230 +
231 + public String getShortDescription() {
232 + return shortDescription;
233 + }
234 +
235 + public void setShortDescription(String shortDescription) {
236 + this.shortDescription = shortDescription;
237 + }
238 +
239 + public String getLongDescription() {
240 + return longDescription;
241 + }
242 +
243 + public void setLongDescription(String longDescription) {
244 + this.longDescription = longDescription;
245 + }
246 +
247 + public String getLogoImagePath() {
248 + return logoImagePath;
249 + }
250 +
251 + public void setLogoImagePath(String logoImagePath) {
252 + this.logoImagePath = logoImagePath;
253 + }
254 +
255 + public String getBigLogoImagePath() {
256 + return bigLogoImagePath;
257 + }
258 +
259 + public void setBigLogoImagePath(String bigLogoImagePath) {
260 + this.bigLogoImagePath = bigLogoImagePath;
261 + }
262 +
263 + public String getDayText() {
264 + return dayText;
265 + }
266 +
267 + public void setDayText(String dayText) {
268 + this.dayText = dayText;
269 + }
270 +
271 + public String getImagePath() {
272 + return imagePath;
273 + }
274 +
275 + public void setImagePath(String imagePath) {
276 + this.imagePath = imagePath;
277 + }
278 +
279 + public String getBigImagePath() {
280 + return bigImagePath;
281 + }
282 +
283 + public void setBigImagePath(String bigImagePath) {
284 + this.bigImagePath = bigImagePath;
285 + }
286 +
287 + public String getMarkerImagePath() {
288 + return markerImagePath;
289 + }
290 +
291 + public void setMarkerImagePath(String markerImagePath) {
292 + this.markerImagePath = markerImagePath;
293 + }
294 +
295 + public String getDetails() {
296 + return details;
297 + }
298 +
299 + public void setDetails(String details) {
300 + this.details = details;
301 + }
302 +
303 + public int getPosition() {
304 + return position;
305 + }
306 +
307 + public void setPosition(int position) {
308 + this.position = position;
309 + }
310 +
311 + public int getDays() {
312 + return days;
313 + }
314 +
315 + public void setDays(int days) {
316 + this.days = days;
317 + }
318 +
319 + public boolean isHot() {
320 + return isHot;
321 + }
322 +
323 + public void setHot(boolean hot) {
324 + isHot = hot;
325 + }
326 +
327 + public ArrayList<UnifiedCampaignLocation> getLocations() {
328 + return locations;
329 + }
330 +
331 + public void setLocations(ArrayList<UnifiedCampaignLocation> locations) {
332 + this.locations = locations;
333 + }
334 +}