Panagiotis Triantafyllou

new model part1

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r9'
PUBLISH_VERSION = '4.5.5.4r10'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -103,6 +103,7 @@ public class Campaign implements Parcelable, Serializable {
private String campaignTypeSettings;
private String bannerImage;
private String bannerTitle;
private UnifiedCampaignModel unifiedCampaign;
/**
* Basic constructor used to create an object from a String, representing a
......@@ -142,6 +143,7 @@ public class Campaign implements Parcelable, Serializable {
this.campaignTypeSettings = "";
this.bannerImage = "";
this.bannerTitle = "";
this.unifiedCampaign = new UnifiedCampaignModel();
}
/**
......@@ -628,6 +630,14 @@ public class Campaign implements Parcelable, Serializable {
this.bannerTitle = bannerTitle;
}
public UnifiedCampaignModel getUnifiedCampaign() {
return unifiedCampaign;
}
public void setUnifiedCampaign(UnifiedCampaignModel unifiedCampaign) {
this.unifiedCampaign = unifiedCampaign;
}
@Override
public int describeContents() {
return 0;
......
package ly.warp.sdk.io.models;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.Serializable;
import java.util.ArrayList;
/**
* Created by Panagiotis Triantafyllou on 23/Feb/2024.
*/
public class UnifiedCampaignModel implements Serializable {
private String id, title, affiliatedId, shortDescription, longDescription,
logoImagePath, bigLogoImagePath, dayText, imagePath, bigImagePath,
markerImagePath, details;
private int position, days;
private boolean isHot;
private ArrayList<UnifiedCampaignLocation> locations;
public UnifiedCampaignModel() {
this.id = "";
this.title = "";
this.affiliatedId = "";
this.shortDescription = "";
this.longDescription = "";
this.logoImagePath = "";
this.bigLogoImagePath = "";
this.dayText = "";
this.imagePath = "";
this.bigImagePath = "";
this.markerImagePath = "";
this.details = "";
this.position = 0;
this.days = 0;
this.isHot = false;
this.locations = new ArrayList<UnifiedCampaignLocation>();
}
public UnifiedCampaignModel(JSONObject jobj) {
if (jobj != null) {
this.id = jobj.optString("id", "");
this.title = jobj.optString("title", "");
this.affiliatedId = jobj.optString("affiliatedId", "");
this.shortDescription = jobj.optString("shortDescription", "");
this.longDescription = jobj.optString("longDescription", "");
this.logoImagePath = jobj.optString("logoImagePath", "");
this.bigLogoImagePath = jobj.optString("bigLogoImagePath", "");
this.dayText = jobj.optString("dayText", "");
this.imagePath = jobj.optString("imagePath", "");
this.bigImagePath = jobj.optString("bigImagePath", "");
this.markerImagePath = jobj.optString("markerImagePath", "");
this.details = jobj.optString("details", "");
this.position = jobj.optInt("position", 0);
this.days = jobj.optInt("days", 0);
this.isHot = jobj.optBoolean("isHot", false);
this.locations = new ArrayList<>();
JSONArray tempLocations = new JSONArray();
tempLocations = jobj.optJSONArray("locations");
if (tempLocations != null && tempLocations.length() > 0) {
ArrayList<UnifiedCampaignLocation> locationsList = new ArrayList<>();
for (int i = 0; i < tempLocations.length(); i++) {
locationsList.add(new UnifiedCampaignLocation(tempLocations.optJSONObject(i)));
}
this.locations.addAll(locationsList);
}
}
}
public class UnifiedCampaignLocation {
private String id, title, address, municipality, telephone,
afiliateId, url, logoImage, pinLogoImage;
private int roadNumber;
private double latitude = 0.0;
private double longitude = 0.0;
public UnifiedCampaignLocation() {
this.id = "";
this.title = "";
this.address = "";
this.municipality = "";
this.telephone = "";
this.afiliateId = "";
this.url = "";
this.logoImage = "";
this.pinLogoImage = "";
this.roadNumber = 0;
this.latitude = 0.0;
this.longitude = 0.0;
}
public UnifiedCampaignLocation(JSONObject jobj) {
if (jobj != null) {
this.id = jobj.optString("id", "");
this.title = jobj.optString("title", "");
this.address = jobj.optString("address", "");
this.municipality = jobj.optString("municipality", "");
this.telephone = jobj.optString("telephone", "");
this.afiliateId = jobj.optString("afiliateId", "");
this.url = jobj.optString("url", "");
this.logoImage = jobj.optString("logoImage", "");
this.pinLogoImage = jobj.optString("pinLogoImage", "");
this.roadNumber = jobj.optInt("roadNumber", 0);
this.latitude = jobj.optDouble("latitude", 0.0);
this.longitude = jobj.optDouble("longitude", 0.0);
}
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getMunicipality() {
return municipality;
}
public void setMunicipality(String municipality) {
this.municipality = municipality;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getAfiliateId() {
return afiliateId;
}
public void setAfiliateId(String afiliateId) {
this.afiliateId = afiliateId;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLogoImage() {
return logoImage;
}
public void setLogoImage(String logoImage) {
this.logoImage = logoImage;
}
public String getPinLogoImage() {
return pinLogoImage;
}
public void setPinLogoImage(String pinLogoImage) {
this.pinLogoImage = pinLogoImage;
}
public int getRoadNumber() {
return roadNumber;
}
public void setRoadNumber(int roadNumber) {
this.roadNumber = roadNumber;
}
public double getLatitude() {
return latitude;
}
public void setLatitude(double latitude) {
this.latitude = latitude;
}
public double getLongitude() {
return longitude;
}
public void setLongitude(double longitude) {
this.longitude = longitude;
}
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAffiliatedId() {
return affiliatedId;
}
public void setAffiliatedId(String affiliatedId) {
this.affiliatedId = affiliatedId;
}
public String getShortDescription() {
return shortDescription;
}
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
public String getLongDescription() {
return longDescription;
}
public void setLongDescription(String longDescription) {
this.longDescription = longDescription;
}
public String getLogoImagePath() {
return logoImagePath;
}
public void setLogoImagePath(String logoImagePath) {
this.logoImagePath = logoImagePath;
}
public String getBigLogoImagePath() {
return bigLogoImagePath;
}
public void setBigLogoImagePath(String bigLogoImagePath) {
this.bigLogoImagePath = bigLogoImagePath;
}
public String getDayText() {
return dayText;
}
public void setDayText(String dayText) {
this.dayText = dayText;
}
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public String getBigImagePath() {
return bigImagePath;
}
public void setBigImagePath(String bigImagePath) {
this.bigImagePath = bigImagePath;
}
public String getMarkerImagePath() {
return markerImagePath;
}
public void setMarkerImagePath(String markerImagePath) {
this.markerImagePath = markerImagePath;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
this.details = details;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
public int getDays() {
return days;
}
public void setDays(int days) {
this.days = days;
}
public boolean isHot() {
return isHot;
}
public void setHot(boolean hot) {
isHot = hot;
}
public ArrayList<UnifiedCampaignLocation> getLocations() {
return locations;
}
public void setLocations(ArrayList<UnifiedCampaignLocation> locations) {
this.locations = locations;
}
}