Panagiotis Triantafyllou

feedback fixes

...@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { ...@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
36 public void onWarplyReady() { 36 public void onWarplyReady() {
37 if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { 37 if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
38 WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() 38 WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
39 - .setGuid("6005892749"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910 39 + .setGuid("7000070282"), //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910
40 mLoginReceiver); 40 mLoginReceiver);
41 } else { 41 } else {
42 startNextActivity(); 42 startNextActivity();
......
...@@ -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.4.6rc70' 5 + PUBLISH_VERSION = '4.5.4.6rc71'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -280,9 +280,9 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl ...@@ -280,9 +280,9 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl
280 @Override 280 @Override
281 public void onSuccess(SharingList result) { 281 public void onSuccess(SharingList result) {
282 if (result != null && result.size() > 0) { 282 if (result != null && result.size() > 0) {
283 - if (WarplyManagerHelper.getCouponsets() != null && WarplyManagerHelper.getCouponsets().size() > 0) { 283 + if (WarplyManagerHelper.getCouponsetsDeals() != null && WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
284 for (SharingCoupon shCoupon : result) { 284 for (SharingCoupon shCoupon : result) {
285 - for (Couponset cpnset : WarplyManagerHelper.getCouponsets()) { 285 + for (Couponset cpnset : WarplyManagerHelper.getCouponsetsDeals()) {
286 if (shCoupon.getCouponsetUuid().equals(cpnset.getUuid())) { 286 if (shCoupon.getCouponsetUuid().equals(cpnset.getUuid())) {
287 SharingCoupon newShCoupon = new SharingCoupon(); 287 SharingCoupon newShCoupon = new SharingCoupon();
288 newShCoupon = shCoupon; 288 newShCoupon = shCoupon;
......
...@@ -55,6 +55,7 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel; ...@@ -55,6 +55,7 @@ import ly.warp.sdk.io.models.ActiveDFYCouponEventModel;
55 import ly.warp.sdk.io.models.ActiveDFYCouponModel; 55 import ly.warp.sdk.io.models.ActiveDFYCouponModel;
56 import ly.warp.sdk.io.models.Coupon; 56 import ly.warp.sdk.io.models.Coupon;
57 import ly.warp.sdk.io.models.CouponList; 57 import ly.warp.sdk.io.models.CouponList;
58 +import ly.warp.sdk.io.models.Couponset;
58 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; 59 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
59 import ly.warp.sdk.io.models.UnifiedCoupon; 60 import ly.warp.sdk.io.models.UnifiedCoupon;
60 import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel; 61 import ly.warp.sdk.io.models.WarplyDealsAnalysisEventModel;
...@@ -530,15 +531,29 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -530,15 +531,29 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
530 // Third Expandable Banner 531 // Third Expandable Banner
531 if (WarplyManagerHelper.getMarketCoupons().size() > 0) { 532 if (WarplyManagerHelper.getMarketCoupons().size() > 0) {
532 countValue = 0.0f; 533 countValue = 0.0f;
533 - for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) { 534 +// for (UnifiedCoupon unicou : WarplyManagerHelper.getMarketCoupons()) {
534 - if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) { 535 +// if (unicou.getCoupons() != null && unicou.getCoupons().size() > 0) {
535 - for (Coupon inncou : unicou.getCoupons()) { 536 +// for (Coupon inncou : unicou.getCoupons()) {
536 - if (inncou.getStatus() == 0) { 537 +// if (inncou.getStatus() == 0) {
537 - countValue += Float.valueOf(inncou.getDiscount()); 538 +// countValue += Float.valueOf(inncou.getDiscount());
539 +// }
540 +// }
541 +// }
542 +// }
543 +
544 + if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
545 + if (WarplyManagerHelper.getCouponsetsDeals().size() > 0) {
546 + for (Couponset couset : WarplyManagerHelper.getCouponsetsDeals()) {
547 + for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
548 + if (cou.getCouponsetUuid().equals(couset.getUuid())) {
549 + countValue += Float.valueOf(cou.getDiscount());
550 + break;
551 + }
538 } 552 }
539 } 553 }
540 } 554 }
541 } 555 }
556 +
542 mFavValue += countValue; 557 mFavValue += countValue;
543 String badgeValue = String.format("%.02f", countValue); 558 String badgeValue = String.format("%.02f", countValue);
544 mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue)); 559 mTvMarketValue.setText(String.format(getString(R.string.cos_value), badgeValue));
......
...@@ -43,6 +43,18 @@ public interface ApiService { ...@@ -43,6 +43,18 @@ public interface ApiService {
43 43
44 @Headers("Content-Type: application/json") 44 @Headers("Content-Type: application/json")
45 @POST("/oauth/{appUuid}/context") 45 @POST("/oauth/{appUuid}/context")
46 + Call<ResponseBody> getCouponsets(@Path("appUuid") String appUuid,
47 + @Body RequestBody request,
48 + @Header(WarpConstants.HEADER_DATE) String timeStamp,
49 + @Header(WarpConstants.HEADER_LOYALTY_BUNDLE_ID) String bundleId,
50 + @Header(WarpConstants.HEADER_UNIQUE_DEVICE_ID) String deviceId,
51 + @Header(WarpConstants.HEADER_CHANNEL) String channel,
52 + @Header(WarpConstants.HEADER_WEB_ID) String webId,
53 + @Header(WarpConstants.HEADER_SIGNATURE) String signature,
54 + @Header(WarpConstants.HEADER_AUTHORIZATION) String bearer);
55 +
56 + @Headers("Content-Type: application/json")
57 + @POST("/oauth/{appUuid}/context")
46 Call<ResponseBody> getUserCoupons(@Path("appUuid") String appUuid, 58 Call<ResponseBody> getUserCoupons(@Path("appUuid") String appUuid,
47 @Body RequestBody request, 59 @Body RequestBody request,
48 @Header(WarpConstants.HEADER_DATE) String timeStamp, 60 @Header(WarpConstants.HEADER_DATE) String timeStamp,
......
...@@ -111,8 +111,10 @@ public class WarplyManagerHelper { ...@@ -111,8 +111,10 @@ public class WarplyManagerHelper {
111 private static Consumer mConsumerInternal = new Consumer(); 111 private static Consumer mConsumerInternal = new Consumer();
112 private static HashMap<String, CampaignList> mUniqueCampaignList = new HashMap<String, CampaignList>(); 112 private static HashMap<String, CampaignList> mUniqueCampaignList = new HashMap<String, CampaignList>();
113 private static CouponList mCouponList = new CouponList(); 113 private static CouponList mCouponList = new CouponList();
114 + private static CouponList mCouponRedeemedList = new CouponList();
114 private static CouponList mCouponListExpired = new CouponList(); 115 private static CouponList mCouponListExpired = new CouponList();
115 private static CouponsetsList mCouponsetsList = new CouponsetsList(); 116 private static CouponsetsList mCouponsetsList = new CouponsetsList();
117 + private static CouponsetsList mCouponsetsDealsList = new CouponsetsList();
116 private static CustomerStateModel mCustomerStateModel = new CustomerStateModel(); 118 private static CustomerStateModel mCustomerStateModel = new CustomerStateModel();
117 private static ArrayList<Campaign> mCampaignList = new ArrayList<Campaign>(); 119 private static ArrayList<Campaign> mCampaignList = new ArrayList<Campaign>();
118 private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>(); 120 private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>();
...@@ -1231,6 +1233,15 @@ public class WarplyManagerHelper { ...@@ -1231,6 +1233,15 @@ public class WarplyManagerHelper {
1231 }); 1233 });
1232 } 1234 }
1233 1235
1236 + public static void setCouponRedeemedList(CouponList couponRedeemedList) {
1237 + mCouponRedeemedList.clear();
1238 + mCouponRedeemedList.addAll(couponRedeemedList);
1239 + }
1240 +
1241 + public static CouponList getCouponRedeemedList() {
1242 + return mCouponRedeemedList;
1243 + }
1244 +
1234 public static LoyaltyBadgeModel getLoyaltyBadge() { 1245 public static LoyaltyBadgeModel getLoyaltyBadge() {
1235 return mLoyaltyBadge; 1246 return mLoyaltyBadge;
1236 } 1247 }
...@@ -1243,6 +1254,14 @@ public class WarplyManagerHelper { ...@@ -1243,6 +1254,14 @@ public class WarplyManagerHelper {
1243 mCouponsetsList = couponsets; 1254 mCouponsetsList = couponsets;
1244 } 1255 }
1245 1256
1257 + public static void setCouponsetsDeals(CouponsetsList couponsetsDeals) {
1258 + mCouponsetsDealsList = couponsetsDeals;
1259 + }
1260 +
1261 + public static CouponsetsList getCouponsetsDeals() {
1262 + return mCouponsetsDealsList;
1263 + }
1264 +
1246 public static void setMerchantList(MerchantList merchantList) { 1265 public static void setMerchantList(MerchantList merchantList) {
1247 mMerchantList.clear(); 1266 mMerchantList.clear();
1248 mMerchantList = merchantList; 1267 mMerchantList = merchantList;
......