Panagiotis Triantafyllou

new keys

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta77'
PUBLISH_VERSION = '4.5.4-cosbeta78'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -317,7 +317,7 @@ public class WarpViewActivity extends WarpBaseActivity {
private void sendSteps() {
String date = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss", Locale.getDefault()).format(new Date());
WarpUtils.log("SEND_STEPS: " + String.valueOf(WarpUtils.getStepsCounter(this)));
if (WarpUtils.getStepsCounter(this) > 0) {
WarplyManager.setPacingDetails(new PacingCalculateRequest()
.setCounter(WarpUtils.getStepsCounter(this))
......
......@@ -213,13 +213,16 @@ public class WarplyHealthService extends Service implements SensorEventListener
&& (timeNs - lastStepTimeNs > STEP_DELAY_NS)) {
WarplyManagerHelper.mStepsWebview++;
sumSteps++;
WarplyManagerHelper.mSteps += WarplyManagerHelper.mStepsWebview;
WarplyManagerHelper.mSteps++;
WarpUtils.log("COUNT_STEPS: " + String.valueOf(WarplyManagerHelper.mSteps));
WarpUtils.setStepsCounter(this, WarplyManagerHelper.mSteps);
WarplyManagerHelper.mMetersWebview = (WarplyManagerHelper.mStepsWebview * 0.762);
WarpUtils.log("WEBVIEW_METERS: " + String.valueOf(WarplyManagerHelper.mMetersWebview));
HealthEventModel healthSteps = new HealthEventModel();
// healthSteps.setMeters((mStepsAll * 0.762)); // 16/09/2022
// healthSteps.setMeters(WarplyManagerHelper.mMetersWebview); // 20/09/2022
eventMeters = (sumSteps * 0.762);
WarpUtils.log("WIDGET_METERS: " + String.valueOf(eventMeters));
healthSteps.setMeters(eventMeters);
EventBus.getDefault().post(new WarplyEventBusManager(healthSteps));
......
......@@ -46,7 +46,9 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import ly.warp.sdk.R;
import ly.warp.sdk.Warply;
......@@ -105,8 +107,8 @@ public class WarplyManagerHelper {
private static CouponList mCouponListExpired = new CouponList();
private static CouponsetsList mCouponsetsList = new CouponsetsList();
private static CustomerStateModel mCustomerStateModel = new CustomerStateModel();
private static CampaignList mCampaignList = new CampaignList();
private static CampaignList mCampaignListAll = new CampaignList();
private static ArrayList<Campaign> mCampaignList = new ArrayList<Campaign>();
private static ArrayList<Campaign> mCampaignListAll = new ArrayList<Campaign>();
private static ArrayList<Campaign> mCarouselList = new ArrayList<Campaign>();
private static ArrayList<ActiveDFYCouponModel> mDfyCoupons = new ArrayList();
private static ArrayList<LoyaltyGiftsForYouPackage> mSeasonalList = new ArrayList<>();
......@@ -1077,7 +1079,7 @@ public class WarplyManagerHelper {
return mCouponListExpired;
}
public static void setUniqueCampaignList(CampaignList campaignList) {
public static void setUniqueCampaignList(ArrayList<Campaign> campaignList) {
mCampaignList.clear();
mCampaignList.addAll(campaignList);
......@@ -1097,12 +1099,12 @@ public class WarplyManagerHelper {
// }
}
public static void setCampaignList(CampaignList campaignList) {
public static void setCampaignList(ArrayList<Campaign> campaignList) {
// mCampaignList.clear();
// mCampaignList.addAll(campaignList);
Set<Campaign> set = new LinkedHashSet<>(campaignList);
mCampaignListAll.clear();
mCampaignListAll.addAll(campaignList);
mCampaignListAll.addAll(set);
mCampaignList.clear();
for (Campaign camp : campaignList) {
......@@ -1132,11 +1134,11 @@ public class WarplyManagerHelper {
return mCarouselList;
}
public static CampaignList getCampaignList() {
public static ArrayList<Campaign> getCampaignList() {
return mCampaignList;
}
public static CampaignList getCampaignListAll() {
public static ArrayList<Campaign> getCampaignListAll() {
return mCampaignListAll;
}
......
......@@ -45,6 +45,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;
import ly.warp.sdk.R;
import ly.warp.sdk.Warply;
......@@ -147,7 +149,7 @@ import ly.warp.sdk.utils.constants.WarpConstants;
*/
public class WarplyManager {
private static CampaignList mNewCampaignList = new CampaignList();
private static ArrayList<Campaign> mNewCampaignList = new ArrayList<Campaign>();
public static void getProducts(WarplyProductsRequest request, final CallbackReceiver<ProductList> receiver) {
// String productCategory = "";
......@@ -1372,7 +1374,8 @@ public class WarplyManager {
public void onSuccess(CampaignList result) {
// receiver.onSuccess(result);
mNewCampaignList.clear();
mNewCampaignList.addAll(result);
ArrayList<Campaign> tempCamps = new ArrayList<Campaign>(result);
mNewCampaignList.addAll(tempCamps);
getCampaignsPersonalized(request, new CallbackReceiver<CampaignList>() {
@Override
public void onSuccess(CampaignList resultPersonalized) {
......@@ -1402,7 +1405,8 @@ public class WarplyManager {
Warply.postReceiveMicroappData(WarpConstants.MICROAPP_NEW_CAMPAIGNS, true, "campaignsPersonalized", request.toJson(), new NewCampaignsHook(new CallbackReceiver<CampaignList>() {
@Override
public void onSuccess(CampaignList result) {
mNewCampaignList.addAll(result);
ArrayList<Campaign> tempCamps = new ArrayList<Campaign>(result);
mNewCampaignList.addAll(tempCamps);
Collections.sort(mNewCampaignList, (obj1, obj2) -> Integer.compare(obj1.getSorting(), obj2.getSorting()));
CampaignList campaignLoyaltyList = new CampaignList();
campaignLoyaltyList.clear();
......@@ -2023,7 +2027,11 @@ public class WarplyManager {
// }
// WarplyManagerHelper.setCCMSLoyaltyCampaigns(list);
receiver.onSuccess(campaignLoyaltyList); //result
CampaignList tempAllCamps = new CampaignList();
Set<Campaign> set = new LinkedHashSet<>(campaignLoyaltyList);
tempAllCamps.clear();
tempAllCamps.addAll(set);
receiver.onSuccess(tempAllCamps); //result, //campaignLoyaltyList
}
@Override
......