Showing
6 changed files
with
28 additions
and
15 deletions
| ... | @@ -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-cosbeta77' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta78' | 
| 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 
| 7 | } | 7 | } | 
| 8 | 8 | ... | ... | 
This diff is collapsed. Click to expand it.
| ... | @@ -317,7 +317,7 @@ public class WarpViewActivity extends WarpBaseActivity { | ... | @@ -317,7 +317,7 @@ public class WarpViewActivity extends WarpBaseActivity { | 
| 317 | 317 | ||
| 318 | private void sendSteps() { | 318 | private void sendSteps() { | 
| 319 | String date = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault()).format(new Date()); | 319 | String date = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault()).format(new Date()); | 
| 320 | - | 320 | + WarpUtils.log("SEND_STEPS: " + String.valueOf(WarpUtils.getStepsCounter(this))); | 
| 321 | if (WarpUtils.getStepsCounter(this) > 0) { | 321 | if (WarpUtils.getStepsCounter(this) > 0) { | 
| 322 | WarplyManager.setPacingDetails(new PacingCalculateRequest() | 322 | WarplyManager.setPacingDetails(new PacingCalculateRequest() | 
| 323 | .setCounter(WarpUtils.getStepsCounter(this)) | 323 | .setCounter(WarpUtils.getStepsCounter(this)) | ... | ... | 
| ... | @@ -213,13 +213,16 @@ public class WarplyHealthService extends Service implements SensorEventListener | ... | @@ -213,13 +213,16 @@ public class WarplyHealthService extends Service implements SensorEventListener | 
| 213 | && (timeNs - lastStepTimeNs > STEP_DELAY_NS)) { | 213 | && (timeNs - lastStepTimeNs > STEP_DELAY_NS)) { | 
| 214 | WarplyManagerHelper.mStepsWebview++; | 214 | WarplyManagerHelper.mStepsWebview++; | 
| 215 | sumSteps++; | 215 | sumSteps++; | 
| 216 | - WarplyManagerHelper.mSteps += WarplyManagerHelper.mStepsWebview; | 216 | + WarplyManagerHelper.mSteps++; | 
| 217 | + WarpUtils.log("COUNT_STEPS: " + String.valueOf(WarplyManagerHelper.mSteps)); | ||
| 217 | WarpUtils.setStepsCounter(this, WarplyManagerHelper.mSteps); | 218 | WarpUtils.setStepsCounter(this, WarplyManagerHelper.mSteps); | 
| 218 | WarplyManagerHelper.mMetersWebview = (WarplyManagerHelper.mStepsWebview * 0.762); | 219 | WarplyManagerHelper.mMetersWebview = (WarplyManagerHelper.mStepsWebview * 0.762); | 
| 220 | + WarpUtils.log("WEBVIEW_METERS: " + String.valueOf(WarplyManagerHelper.mMetersWebview)); | ||
| 219 | HealthEventModel healthSteps = new HealthEventModel(); | 221 | HealthEventModel healthSteps = new HealthEventModel(); | 
| 220 | // healthSteps.setMeters((mStepsAll * 0.762)); // 16/09/2022 | 222 | // healthSteps.setMeters((mStepsAll * 0.762)); // 16/09/2022 | 
| 221 | // healthSteps.setMeters(WarplyManagerHelper.mMetersWebview); // 20/09/2022 | 223 | // healthSteps.setMeters(WarplyManagerHelper.mMetersWebview); // 20/09/2022 | 
| 222 | eventMeters = (sumSteps * 0.762); | 224 | eventMeters = (sumSteps * 0.762); | 
| 225 | + WarpUtils.log("WIDGET_METERS: " + String.valueOf(eventMeters)); | ||
| 223 | healthSteps.setMeters(eventMeters); | 226 | healthSteps.setMeters(eventMeters); | 
| 224 | EventBus.getDefault().post(new WarplyEventBusManager(healthSteps)); | 227 | EventBus.getDefault().post(new WarplyEventBusManager(healthSteps)); | 
| 225 | 228 | ... | ... | 
| ... | @@ -46,7 +46,9 @@ import java.io.Serializable; | ... | @@ -46,7 +46,9 @@ import java.io.Serializable; | 
| 46 | import java.util.ArrayList; | 46 | import java.util.ArrayList; | 
| 47 | import java.util.HashMap; | 47 | import java.util.HashMap; | 
| 48 | import java.util.HashSet; | 48 | import java.util.HashSet; | 
| 49 | +import java.util.LinkedHashSet; | ||
| 49 | import java.util.Map; | 50 | import java.util.Map; | 
| 51 | +import java.util.Set; | ||
| 50 | 52 | ||
| 51 | import ly.warp.sdk.R; | 53 | import ly.warp.sdk.R; | 
| 52 | import ly.warp.sdk.Warply; | 54 | import ly.warp.sdk.Warply; | 
| ... | @@ -105,8 +107,8 @@ public class WarplyManagerHelper { | ... | @@ -105,8 +107,8 @@ public class WarplyManagerHelper { | 
| 105 | private static CouponList mCouponListExpired = new CouponList(); | 107 | private static CouponList mCouponListExpired = new CouponList(); | 
| 106 | private static CouponsetsList mCouponsetsList = new CouponsetsList(); | 108 | private static CouponsetsList mCouponsetsList = new CouponsetsList(); | 
| 107 | private static CustomerStateModel mCustomerStateModel = new CustomerStateModel(); | 109 | private static CustomerStateModel mCustomerStateModel = new CustomerStateModel(); | 
| 108 | - private static CampaignList mCampaignList = new CampaignList(); | 110 | + private static ArrayList<Campaign> mCampaignList = new ArrayList<Campaign>(); | 
| 109 | - private static CampaignList mCampaignListAll = new CampaignList(); | 111 | + private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>(); | 
| 110 | private static ArrayList<Campaign> mCarouselList = new ArrayList<Campaign>(); | 112 | private static ArrayList<Campaign> mCarouselList = new ArrayList<Campaign>(); | 
| 111 | private static ArrayList<ActiveDFYCouponModel> mDfyCoupons = new ArrayList(); | 113 | private static ArrayList<ActiveDFYCouponModel> mDfyCoupons = new ArrayList(); | 
| 112 | private static ArrayList<LoyaltyGiftsForYouPackage> mSeasonalList = new ArrayList<>(); | 114 | private static ArrayList<LoyaltyGiftsForYouPackage> mSeasonalList = new ArrayList<>(); | 
| ... | @@ -1077,7 +1079,7 @@ public class WarplyManagerHelper { | ... | @@ -1077,7 +1079,7 @@ public class WarplyManagerHelper { | 
| 1077 | return mCouponListExpired; | 1079 | return mCouponListExpired; | 
| 1078 | } | 1080 | } | 
| 1079 | 1081 | ||
| 1080 | - public static void setUniqueCampaignList(CampaignList campaignList) { | 1082 | + public static void setUniqueCampaignList(ArrayList<Campaign> campaignList) { | 
| 1081 | mCampaignList.clear(); | 1083 | mCampaignList.clear(); | 
| 1082 | mCampaignList.addAll(campaignList); | 1084 | mCampaignList.addAll(campaignList); | 
| 1083 | 1085 | ||
| ... | @@ -1097,12 +1099,12 @@ public class WarplyManagerHelper { | ... | @@ -1097,12 +1099,12 @@ public class WarplyManagerHelper { | 
| 1097 | // } | 1099 | // } | 
| 1098 | } | 1100 | } | 
| 1099 | 1101 | ||
| 1100 | - public static void setCampaignList(CampaignList campaignList) { | 1102 | + public static void setCampaignList(ArrayList<Campaign> campaignList) { | 
| 1101 | // mCampaignList.clear(); | 1103 | // mCampaignList.clear(); | 
| 1102 | // mCampaignList.addAll(campaignList); | 1104 | // mCampaignList.addAll(campaignList); | 
| 1103 | - | 1105 | + Set<Campaign> set = new LinkedHashSet<>(campaignList); | 
| 1104 | mCampaignListAll.clear(); | 1106 | mCampaignListAll.clear(); | 
| 1105 | - mCampaignListAll.addAll(campaignList); | 1107 | + mCampaignListAll.addAll(set); | 
| 1106 | 1108 | ||
| 1107 | mCampaignList.clear(); | 1109 | mCampaignList.clear(); | 
| 1108 | for (Campaign camp : campaignList) { | 1110 | for (Campaign camp : campaignList) { | 
| ... | @@ -1132,11 +1134,11 @@ public class WarplyManagerHelper { | ... | @@ -1132,11 +1134,11 @@ public class WarplyManagerHelper { | 
| 1132 | return mCarouselList; | 1134 | return mCarouselList; | 
| 1133 | } | 1135 | } | 
| 1134 | 1136 | ||
| 1135 | - public static CampaignList getCampaignList() { | 1137 | + public static ArrayList<Campaign> getCampaignList() { | 
| 1136 | return mCampaignList; | 1138 | return mCampaignList; | 
| 1137 | } | 1139 | } | 
| 1138 | 1140 | ||
| 1139 | - public static CampaignList getCampaignListAll() { | 1141 | + public static ArrayList<Campaign> getCampaignListAll() { | 
| 1140 | return mCampaignListAll; | 1142 | return mCampaignListAll; | 
| 1141 | } | 1143 | } | 
| 1142 | 1144 | ... | ... | 
| ... | @@ -45,6 +45,8 @@ import java.util.ArrayList; | ... | @@ -45,6 +45,8 @@ import java.util.ArrayList; | 
| 45 | import java.util.Collections; | 45 | import java.util.Collections; | 
| 46 | import java.util.Comparator; | 46 | import java.util.Comparator; | 
| 47 | import java.util.Date; | 47 | import java.util.Date; | 
| 48 | +import java.util.LinkedHashSet; | ||
| 49 | +import java.util.Set; | ||
| 48 | 50 | ||
| 49 | import ly.warp.sdk.R; | 51 | import ly.warp.sdk.R; | 
| 50 | import ly.warp.sdk.Warply; | 52 | import ly.warp.sdk.Warply; | 
| ... | @@ -147,7 +149,7 @@ import ly.warp.sdk.utils.constants.WarpConstants; | ... | @@ -147,7 +149,7 @@ import ly.warp.sdk.utils.constants.WarpConstants; | 
| 147 | */ | 149 | */ | 
| 148 | 150 | ||
| 149 | public class WarplyManager { | 151 | public class WarplyManager { | 
| 150 | - private static CampaignList mNewCampaignList = new CampaignList(); | 152 | + private static ArrayList<Campaign> mNewCampaignList = new ArrayList<Campaign>(); | 
| 151 | 153 | ||
| 152 | public static void getProducts(WarplyProductsRequest request, final CallbackReceiver<ProductList> receiver) { | 154 | public static void getProducts(WarplyProductsRequest request, final CallbackReceiver<ProductList> receiver) { | 
| 153 | // String productCategory = ""; | 155 | // String productCategory = ""; | 
| ... | @@ -1372,7 +1374,8 @@ public class WarplyManager { | ... | @@ -1372,7 +1374,8 @@ public class WarplyManager { | 
| 1372 | public void onSuccess(CampaignList result) { | 1374 | public void onSuccess(CampaignList result) { | 
| 1373 | // receiver.onSuccess(result); | 1375 | // receiver.onSuccess(result); | 
| 1374 | mNewCampaignList.clear(); | 1376 | mNewCampaignList.clear(); | 
| 1375 | - mNewCampaignList.addAll(result); | 1377 | + ArrayList<Campaign> tempCamps = new ArrayList<Campaign>(result); | 
| 1378 | + mNewCampaignList.addAll(tempCamps); | ||
| 1376 | getCampaignsPersonalized(request, new CallbackReceiver<CampaignList>() { | 1379 | getCampaignsPersonalized(request, new CallbackReceiver<CampaignList>() { | 
| 1377 | @Override | 1380 | @Override | 
| 1378 | public void onSuccess(CampaignList resultPersonalized) { | 1381 | public void onSuccess(CampaignList resultPersonalized) { | 
| ... | @@ -1402,7 +1405,8 @@ public class WarplyManager { | ... | @@ -1402,7 +1405,8 @@ public class WarplyManager { | 
| 1402 | Warply.postReceiveMicroappData(WarpConstants.MICROAPP_NEW_CAMPAIGNS, true, "campaignsPersonalized", request.toJson(), new NewCampaignsHook(new CallbackReceiver<CampaignList>() { | 1405 | Warply.postReceiveMicroappData(WarpConstants.MICROAPP_NEW_CAMPAIGNS, true, "campaignsPersonalized", request.toJson(), new NewCampaignsHook(new CallbackReceiver<CampaignList>() { | 
| 1403 | @Override | 1406 | @Override | 
| 1404 | public void onSuccess(CampaignList result) { | 1407 | public void onSuccess(CampaignList result) { | 
| 1405 | - mNewCampaignList.addAll(result); | 1408 | + ArrayList<Campaign> tempCamps = new ArrayList<Campaign>(result); | 
| 1409 | + mNewCampaignList.addAll(tempCamps); | ||
| 1406 | Collections.sort(mNewCampaignList, (obj1, obj2) -> Integer.compare(obj1.getSorting(), obj2.getSorting())); | 1410 | Collections.sort(mNewCampaignList, (obj1, obj2) -> Integer.compare(obj1.getSorting(), obj2.getSorting())); | 
| 1407 | CampaignList campaignLoyaltyList = new CampaignList(); | 1411 | CampaignList campaignLoyaltyList = new CampaignList(); | 
| 1408 | campaignLoyaltyList.clear(); | 1412 | campaignLoyaltyList.clear(); | 
| ... | @@ -2023,7 +2027,11 @@ public class WarplyManager { | ... | @@ -2023,7 +2027,11 @@ public class WarplyManager { | 
| 2023 | // } | 2027 | // } | 
| 2024 | // WarplyManagerHelper.setCCMSLoyaltyCampaigns(list); | 2028 | // WarplyManagerHelper.setCCMSLoyaltyCampaigns(list); | 
| 2025 | 2029 | ||
| 2026 | - receiver.onSuccess(campaignLoyaltyList); //result | 2030 | + CampaignList tempAllCamps = new CampaignList(); | 
| 2031 | + Set<Campaign> set = new LinkedHashSet<>(campaignLoyaltyList); | ||
| 2032 | + tempAllCamps.clear(); | ||
| 2033 | + tempAllCamps.addAll(set); | ||
| 2034 | + receiver.onSuccess(tempAllCamps); //result, //campaignLoyaltyList | ||
| 2027 | } | 2035 | } | 
| 2028 | 2036 | ||
| 2029 | @Override | 2037 | @Override | ... | ... | 
- 
Please register or login to post a comment