Panagiotis Triantafyllou

feedback additions and changes

...@@ -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.4r15' 5 + PUBLISH_VERSION = '4.5.5.4r16'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -109,6 +109,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -109,6 +109,7 @@ public class Campaign implements Parcelable, Serializable {
109 private Integer couponAvailability; 109 private Integer couponAvailability;
110 private String endDate, startDate; 110 private String endDate, startDate;
111 private boolean showExpiration; 111 private boolean showExpiration;
112 + private String couponImg;
112 113
113 /** 114 /**
114 * Basic constructor used to create an object from a String, representing a 115 * Basic constructor used to create an object from a String, representing a
...@@ -153,6 +154,7 @@ public class Campaign implements Parcelable, Serializable { ...@@ -153,6 +154,7 @@ public class Campaign implements Parcelable, Serializable {
153 this.endDate = ""; 154 this.endDate = "";
154 this.startDate = ""; 155 this.startDate = "";
155 this.showExpiration = false; 156 this.showExpiration = false;
157 + this.couponImg = "";
156 } 158 }
157 159
158 /** 160 /**
...@@ -688,6 +690,14 @@ public class Campaign implements Parcelable, Serializable { ...@@ -688,6 +690,14 @@ public class Campaign implements Parcelable, Serializable {
688 this.showExpiration = showExpiration; 690 this.showExpiration = showExpiration;
689 } 691 }
690 692
693 + public String getCouponImg() {
694 + return couponImg;
695 + }
696 +
697 + public void setCouponImg(String couponImg) {
698 + this.couponImg = couponImg;
699 + }
700 +
691 @Override 701 @Override
692 public int describeContents() { 702 public int describeContents() {
693 return 0; 703 return 0;
......
...@@ -94,6 +94,7 @@ public class NewCampaign implements Parcelable, Serializable { ...@@ -94,6 +94,7 @@ public class NewCampaign implements Parcelable, Serializable {
94 private String bannerImage = ""; 94 private String bannerImage = "";
95 private String bannerTitle = ""; 95 private String bannerTitle = "";
96 private boolean showExpiration = false; 96 private boolean showExpiration = false;
97 + private String couponImg = "";
97 98
98 /** 99 /**
99 * Basic constructor used to create an object from a String, representing a 100 * Basic constructor used to create an object from a String, representing a
...@@ -146,6 +147,7 @@ public class NewCampaign implements Parcelable, Serializable { ...@@ -146,6 +147,7 @@ public class NewCampaign implements Parcelable, Serializable {
146 this.showExpiration = false; 147 this.showExpiration = false;
147 } 148 }
148 } 149 }
150 + this.couponImg = json.optString("coupon_img");
149 } 151 }
150 152
151 public NewCampaign(Parcel source) { 153 public NewCampaign(Parcel source) {
...@@ -392,6 +394,14 @@ public class NewCampaign implements Parcelable, Serializable { ...@@ -392,6 +394,14 @@ public class NewCampaign implements Parcelable, Serializable {
392 this.showExpiration = showExpiration; 394 this.showExpiration = showExpiration;
393 } 395 }
394 396
397 + public String getCouponImg() {
398 + return couponImg;
399 + }
400 +
401 + public void setCouponImg(String couponImg) {
402 + this.couponImg = couponImg;
403 + }
404 +
395 @Override 405 @Override
396 public int describeContents() { 406 public int describeContents() {
397 return 0; 407 return 0;
......
...@@ -1769,6 +1769,7 @@ public class WarplyManager { ...@@ -1769,6 +1769,7 @@ public class WarplyManager {
1769 camp.setEndDate(newCamp.getEndDate()); 1769 camp.setEndDate(newCamp.getEndDate());
1770 camp.setStartDate(newCamp.getStartDate()); 1770 camp.setStartDate(newCamp.getStartDate());
1771 camp.setShowExpiration(newCamp.isShowExpiration()); 1771 camp.setShowExpiration(newCamp.isShowExpiration());
1772 + camp.setCouponImg(newCamp.getCouponImg());
1772 try { 1773 try {
1773 camp.setExtraFields(newCamp.getExtraFields().toString()); 1774 camp.setExtraFields(newCamp.getExtraFields().toString());
1774 if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) { 1775 if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) {
...@@ -1916,6 +1917,7 @@ public class WarplyManager { ...@@ -1916,6 +1917,7 @@ public class WarplyManager {
1916 camp.setEndDate(newCamp.getEndDate()); 1917 camp.setEndDate(newCamp.getEndDate());
1917 camp.setStartDate(newCamp.getStartDate()); 1918 camp.setStartDate(newCamp.getStartDate());
1918 camp.setShowExpiration(newCamp.isShowExpiration()); 1919 camp.setShowExpiration(newCamp.isShowExpiration());
1920 + camp.setCouponImg(newCamp.getCouponImg());
1919 try { 1921 try {
1920 camp.setExtraFields(newCamp.getExtraFields().toString()); 1922 camp.setExtraFields(newCamp.getExtraFields().toString());
1921 if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) { 1923 if (!TextUtils.isEmpty(newCamp.getExtraFields().toString())) {
......
...@@ -88,6 +88,8 @@ import java.util.Map; ...@@ -88,6 +88,8 @@ import java.util.Map;
88 import ly.warp.sdk.R; 88 import ly.warp.sdk.R;
89 import ly.warp.sdk.Warply; 89 import ly.warp.sdk.Warply;
90 import ly.warp.sdk.activities.ActiveCouponsActivity; 90 import ly.warp.sdk.activities.ActiveCouponsActivity;
91 +import ly.warp.sdk.activities.ActiveUnifiedCouponsActivity;
92 +import ly.warp.sdk.activities.BaseFragmentActivity;
91 import ly.warp.sdk.activities.CouponsetInfoActivity; 93 import ly.warp.sdk.activities.CouponsetInfoActivity;
92 import ly.warp.sdk.activities.WarpViewActivity; 94 import ly.warp.sdk.activities.WarpViewActivity;
93 import ly.warp.sdk.db.WarplyDBHelper; 95 import ly.warp.sdk.db.WarplyDBHelper;
...@@ -101,6 +103,7 @@ import ly.warp.sdk.io.models.OpenMyRewardsEventModel; ...@@ -101,6 +103,7 @@ import ly.warp.sdk.io.models.OpenMyRewardsEventModel;
101 import ly.warp.sdk.io.models.QuestionnaireEventModel; 103 import ly.warp.sdk.io.models.QuestionnaireEventModel;
102 import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel; 104 import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel;
103 import ly.warp.sdk.io.models.RefreshVouchersEventModel; 105 import ly.warp.sdk.io.models.RefreshVouchersEventModel;
106 +import ly.warp.sdk.io.models.UnifiedCoupon;
104 import ly.warp.sdk.io.models.WarplyCCMSEnabledModel; 107 import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
105 import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; 108 import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
106 import ly.warp.sdk.io.models.WarplyPacingCardEventModel; 109 import ly.warp.sdk.io.models.WarplyPacingCardEventModel;
...@@ -516,22 +519,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { ...@@ -516,22 +519,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
516 vouchersRefreshed.setRefreshed(true); 519 vouchersRefreshed.setRefreshed(true);
517 EventBus.getDefault().post(new WarplyEventBusManager(vouchersRefreshed)); 520 EventBus.getDefault().post(new WarplyEventBusManager(vouchersRefreshed));
518 } else if (parts[1].equals("activeCoupons")) { 521 } else if (parts[1].equals("activeCoupons")) {
519 - new Thread(() -> { 522 + WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback);
520 - if (!Thread.currentThread().isInterrupted()) {
521 - WarplyManager.getUserCouponsWithCouponsets(mUserCouponsReceiver);
522 - WarplyManager.getCampaigns(mCampaignsCallback);
523 - }
524 - }).start();
525 -
526 - Handler handlerIntent = new Handler();
527 - Runnable runnableIntent = new Runnable() {
528 - @Override
529 - public void run() {
530 - Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), ActiveCouponsActivity.class);
531 - getContext().startActivity(intent);
532 - }
533 - };
534 - handlerIntent.postDelayed(runnableIntent, 1500);
535 } else if (parts[1].equals("ccmsRetrieved")) { 523 } else if (parts[1].equals("ccmsRetrieved")) {
536 WarplyCCMSEnabledModel ccmsEnabled = new WarplyCCMSEnabledModel(); 524 WarplyCCMSEnabledModel ccmsEnabled = new WarplyCCMSEnabledModel();
537 ccmsEnabled.setActivated(true); 525 ccmsEnabled.setActivated(true);
...@@ -899,32 +887,17 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { ...@@ -899,32 +887,17 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
899 } 887 }
900 } 888 }
901 889
902 - private final CallbackReceiver<CouponList> mUserCouponsReceiver = new CallbackReceiver<CouponList>() { 890 + private final CallbackReceiver<ArrayList<UnifiedCoupon>> mUnifiedCallback = new CallbackReceiver<ArrayList<UnifiedCoupon>>() {
903 @Override 891 @Override
904 - public void onSuccess(CouponList result) { 892 + public void onSuccess(ArrayList<UnifiedCoupon> result) {
905 -// Thread.currentThread().interrupt(); 893 + Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), ActiveUnifiedCouponsActivity.class);
906 - WarplyCouponsChangedEventModel couponsChanged = new WarplyCouponsChangedEventModel(); 894 + getContext().startActivity(intent);
907 - couponsChanged.setChanged(true);
908 - EventBus.getDefault().post(new WarplyEventBusManager(couponsChanged));
909 - }
910 -
911 - @Override
912 - public void onFailure(int errorCode) {
913 - Thread.currentThread().interrupt();
914 - }
915 - };
916 -
917 - private CallbackReceiver<ArrayList<Campaign>> mCampaignsCallback = new CallbackReceiver<ArrayList<Campaign>>() {
918 - @Override
919 - public void onSuccess(ArrayList<Campaign> result) {
920 - OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
921 - WorkManager.getInstance((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext()).enqueue(mywork);
922 -// Thread.currentThread().interrupt();
923 } 895 }
924 896
925 @Override 897 @Override
926 public void onFailure(int errorCode) { 898 public void onFailure(int errorCode) {
927 - Thread.currentThread().interrupt(); 899 + Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), ActiveUnifiedCouponsActivity.class);
900 + getContext().startActivity(intent);
928 } 901 }
929 }; 902 };
930 } 903 }
...\ No newline at end of file ...\ No newline at end of file
......