Panagiotis Triantafyllou

carousel list

......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("6012049139"), //6012049321, 6012049322, 6012049323
.setGuid("7000001025"), //6012049321, 6012049322, 6012049323
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta57'
PUBLISH_VERSION = '4.5.4-cosbeta58'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -94,6 +94,7 @@ public class WarplyManagerHelper {
private static CustomerStateModel mCustomerStateModel = new CustomerStateModel();
private static CampaignList mCampaignList = new CampaignList();
private static CampaignList mCampaignListAll = new CampaignList();
private static CampaignList mCarouselList = new CampaignList();
private static ArrayList<ActiveDFYCouponModel> mDfyCoupons = new ArrayList();
private static ArrayList<LoyaltyGiftsForYouPackage> mSeasonalList = new ArrayList<>();
private static ArrayList<LoyaltyContextualOfferModel> mCCMSList = new ArrayList<>();
......@@ -957,6 +958,15 @@ public class WarplyManagerHelper {
}
}
public static void setCarouselList(CampaignList carouselList) {
mCarouselList.clear();
mCarouselList.addAll(carouselList);
}
public static CampaignList getCarouselList() {
return mCarouselList;
}
public static CampaignList getCampaignList() {
return mCampaignList;
}
......
......@@ -1399,7 +1399,16 @@ public class WarplyManager {
Collections.sort(mNewCampaignList, (obj1, obj2) -> Integer.compare(obj1.getSorting(), obj2.getSorting()));
CampaignList campaignLoyaltyList = new CampaignList();
campaignLoyaltyList.clear();
CampaignList campaignCarouselList = new CampaignList();
campaignCarouselList.clear();
for (Campaign camp : mNewCampaignList) {
JSONObject campMetadata = WarpJSONParser.getJSONFromString(camp.getExtraFields());
if (campMetadata != null) {
if (campMetadata.has("carousel")) {
campaignCarouselList.add(camp);
}
}
if (camp.getOfferCategory().equals("questionnaire")) {
if (WarplyManagerHelper.getConsumerInternal() != null) {
JSONObject profMetadata = WarpJSONParser.getJSONFromString(WarplyManagerHelper.getConsumerInternal().getProfileMetadata());
......@@ -1454,6 +1463,7 @@ public class WarplyManager {
}
}
WarplyManagerHelper.setCampaignList(mNewCampaignList);
WarplyManagerHelper.setCarouselList(campaignCarouselList);
// ArrayList<LoyaltyContextualOfferModel> list = new ArrayList<>();
// JSONArray jArray = null;
......