Panagiotis Triantafyllou

feedback additions and changes

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r15'
PUBLISH_VERSION = '4.5.5.4r16'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -109,6 +109,7 @@ public class Campaign implements Parcelable, Serializable {
private Integer couponAvailability;
private String endDate, startDate;
private boolean showExpiration;
private String couponImg;
/**
* Basic constructor used to create an object from a String, representing a
......@@ -153,6 +154,7 @@ public class Campaign implements Parcelable, Serializable {
this.endDate = "";
this.startDate = "";
this.showExpiration = false;
this.couponImg = "";
}
/**
......@@ -688,6 +690,14 @@ public class Campaign implements Parcelable, Serializable {
this.showExpiration = showExpiration;
}
public String getCouponImg() {
return couponImg;
}
public void setCouponImg(String couponImg) {
this.couponImg = couponImg;
}
@Override
public int describeContents() {
return 0;
......
......@@ -94,6 +94,7 @@ public class NewCampaign implements Parcelable, Serializable {
private String bannerImage = "";
private String bannerTitle = "";
private boolean showExpiration = false;
private String couponImg = "";
/**
* Basic constructor used to create an object from a String, representing a
......@@ -146,6 +147,7 @@ public class NewCampaign implements Parcelable, Serializable {
this.showExpiration = false;
}
}
this.couponImg = json.optString("coupon_img");
}
public NewCampaign(Parcel source) {
......@@ -392,6 +394,14 @@ public class NewCampaign implements Parcelable, Serializable {
this.showExpiration = showExpiration;
}
public String getCouponImg() {
return couponImg;
}
public void setCouponImg(String couponImg) {
this.couponImg = couponImg;
}
@Override
public int describeContents() {
return 0;
......
......@@ -1769,6 +1769,7 @@ public class WarplyManager {
camp.setEndDate(newCamp.getEndDate());
camp.setStartDate(newCamp.getStartDate());
camp.setShowExpiration(newCamp.isShowExpiration());
camp.setCouponImg(newCamp.getCouponImg());
try {
camp.setExtraFields(newCamp.getExtraFields().toString());
if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) {
......@@ -1916,6 +1917,7 @@ public class WarplyManager {
camp.setEndDate(newCamp.getEndDate());
camp.setStartDate(newCamp.getStartDate());
camp.setShowExpiration(newCamp.isShowExpiration());
camp.setCouponImg(newCamp.getCouponImg());
try {
camp.setExtraFields(newCamp.getExtraFields().toString());
if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) {
......
......@@ -88,6 +88,8 @@ import java.util.Map;
import ly.warp.sdk.R;
import ly.warp.sdk.Warply;
import ly.warp.sdk.activities.ActiveCouponsActivity;
import ly.warp.sdk.activities.ActiveUnifiedCouponsActivity;
import ly.warp.sdk.activities.BaseFragmentActivity;
import ly.warp.sdk.activities.CouponsetInfoActivity;
import ly.warp.sdk.activities.WarpViewActivity;
import ly.warp.sdk.db.WarplyDBHelper;
......@@ -101,6 +103,7 @@ import ly.warp.sdk.io.models.OpenMyRewardsEventModel;
import ly.warp.sdk.io.models.QuestionnaireEventModel;
import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel;
import ly.warp.sdk.io.models.RefreshVouchersEventModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
import ly.warp.sdk.io.models.WarplyPacingCardEventModel;
......@@ -516,22 +519,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
vouchersRefreshed.setRefreshed(true);
EventBus.getDefault().post(new WarplyEventBusManager(vouchersRefreshed));
} else if (parts[1].equals("activeCoupons")) {
new Thread(() -> {
if (!Thread.currentThread().isInterrupted()) {
WarplyManager.getUserCouponsWithCouponsets(mUserCouponsReceiver);
WarplyManager.getCampaigns(mCampaignsCallback);
}
}).start();
Handler handlerIntent = new Handler();
Runnable runnableIntent = new Runnable() {
@Override
public void run() {
Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), ActiveCouponsActivity.class);
getContext().startActivity(intent);
}
};
handlerIntent.postDelayed(runnableIntent, 1500);
WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback);
} else if (parts[1].equals("ccmsRetrieved")) {
WarplyCCMSEnabledModel ccmsEnabled = new WarplyCCMSEnabledModel();
ccmsEnabled.setActivated(true);
......@@ -899,32 +887,17 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
}
}
private final CallbackReceiver<CouponList> mUserCouponsReceiver = new CallbackReceiver<CouponList>() {
private final CallbackReceiver<ArrayList<UnifiedCoupon>> mUnifiedCallback = new CallbackReceiver<ArrayList<UnifiedCoupon>>() {
@Override
public void onSuccess(CouponList result) {
// Thread.currentThread().interrupt();
WarplyCouponsChangedEventModel couponsChanged = new WarplyCouponsChangedEventModel();
couponsChanged.setChanged(true);
EventBus.getDefault().post(new WarplyEventBusManager(couponsChanged));
}
@Override
public void onFailure(int errorCode) {
Thread.currentThread().interrupt();
}
};
private CallbackReceiver<ArrayList<Campaign>> mCampaignsCallback = new CallbackReceiver<ArrayList<Campaign>>() {
@Override
public void onSuccess(ArrayList<Campaign> result) {
OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
WorkManager.getInstance((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext()).enqueue(mywork);
// Thread.currentThread().interrupt();
public void onSuccess(ArrayList<UnifiedCoupon> result) {
Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), ActiveUnifiedCouponsActivity.class);
getContext().startActivity(intent);
}
@Override
public void onFailure(int errorCode) {
Thread.currentThread().interrupt();
Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), ActiveUnifiedCouponsActivity.class);
getContext().startActivity(intent);
}
};
}
\ No newline at end of file
......