Panagiotis Triantafyllou

sm pass fixes

......@@ -4,6 +4,7 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$PROJECT_DIR$/../../../../../../gradle-6.6.1" />
<option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
......@@ -5,7 +5,7 @@ android.buildFeatures.buildConfig = true
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.5.4r46'
PUBLISH_VERSION = '4.5.5.4r47'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -27,7 +27,6 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.MarketPassDetailsModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.utils.managers.WarplyManager;
public class BaseFragmentActivity extends FragmentActivity implements NavigationBarView.OnItemSelectedListener {
......@@ -58,7 +57,6 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
if (WarplyDBHelper.getInstance(this).isTableNotEmpty("auth")) {
WarplyManager.getUserCouponsWithCouponsets(mUserCouponsReceiver);
WarplyManager.getCampaigns(mCampaignsCallback);
WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback);
WarplyManager.getMarketPassDetails(mMarketPassDetailsCallback);
}
......@@ -182,18 +180,6 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
}
};
private final CallbackReceiver<ArrayList<UnifiedCoupon>> mUnifiedCallback = new CallbackReceiver<ArrayList<UnifiedCoupon>>() {
@Override
public void onSuccess(ArrayList<UnifiedCoupon> result) {
Toast.makeText(BaseFragmentActivity.this, "Unified Coupons Success " + String.valueOf(result.size()), Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int errorCode) {
Toast.makeText(BaseFragmentActivity.this, "Unified Coupons Error", Toast.LENGTH_SHORT).show();
}
};
private final CallbackReceiver<MarketPassDetailsModel> mMarketPassDetailsCallback = new CallbackReceiver<MarketPassDetailsModel>() {
@Override
public void onSuccess(MarketPassDetailsModel result) {
......
......@@ -253,21 +253,19 @@ public class LoyaltyHistoryActivity extends Activity implements View.OnClickList
/** First Banner */
/** Second Expandable Banner */
if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
if (WarplyManagerHelper.getCouponRedeemedList() != null && !WarplyManagerHelper.getCouponRedeemedList().isEmpty()) {
countValue = 0.0f;
if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetDetails().getCouponsetType().equals("supermarket")) {
countValue += Float.parseFloat(cou.getDiscount());
cou.setDescription(cou.getCouponsetDetails().getShortDescription());
cou.setImage(cou.getCouponsetDetails().getImgPreview());
cou.setName(cou.getCouponsetDetails().getName());
cou.setMerchantUuid(cou.getCouponsetDetails().getMerchantUuid());
cou.setInnerText(cou.getCouponsetDetails().getInnerText());
cou.setDiscount_type(cou.getCouponsetDetails().getDiscount_type());
cou.setFinal_price(cou.getCouponsetDetails().getFinal_price());
}
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetDetails().getCouponsetType().equals("supermarket")) {
countValue += Float.parseFloat(cou.getDiscount());
cou.setDescription(cou.getCouponsetDetails().getShortDescription());
cou.setImage(cou.getCouponsetDetails().getImgPreview());
cou.setName(cou.getCouponsetDetails().getName());
cou.setMerchantUuid(cou.getCouponsetDetails().getMerchantUuid());
cou.setInnerText(cou.getCouponsetDetails().getInnerText());
cou.setDiscount_type(cou.getCouponsetDetails().getDiscount_type());
cou.setFinal_price(cou.getCouponsetDetails().getFinal_price());
}
}
......
......@@ -34,12 +34,10 @@ import ly.warp.sdk.io.models.CustomTypefaceSpan;
import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
import ly.warp.sdk.io.models.SharingCoupon;
import ly.warp.sdk.io.models.SharingList;
import ly.warp.sdk.io.request.WarplySharingHistoryRequest;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
import ly.warp.sdk.utils.managers.WarplyEventBusManager;
import ly.warp.sdk.utils.managers.WarplyManager;
import ly.warp.sdk.views.adapters.ExpiredCouponAdapter;
import ly.warp.sdk.views.adapters.SharedCouponAdapter;
......@@ -99,28 +97,16 @@ public class LoyaltyMarketAnalysisActivity extends Activity implements View.OnCl
mFontSharedMore);
if (WarplyManagerHelper.getMarketCoupons() != null && WarplyManagerHelper.getMarketCoupons().size() > 0) {
if (WarplyManagerHelper.getCouponRedeemedList() != null && !WarplyManagerHelper.getCouponRedeemedList().isEmpty()) {
final ExecutorService executor = Executors.newFixedThreadPool(1);
executor.submit(() -> {
// for (UnifiedCoupon unicoupon : WarplyManagerHelper.getMarketCoupons()) {
// if (unicoupon.getCoupons() != null && unicoupon.getCoupons().size() > 0) {
// for (Coupon inncoupon : unicoupon.getCoupons()) {
// if (inncoupon.getStatus() == 0) {
// countValue += Float.valueOf(inncoupon.getDiscount());
// mExpiredMarketCoupons.add(inncoupon);
// }
// }
// }
// }
if (WarplyManagerHelper.getCouponRedeemedList().size() > 0) {
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetDetails().getCouponsetType().equals("supermarket")) {
countValue += Float.valueOf(cou.getDiscount());
mExpiredMarketCoupons.add(cou);
}
for (Coupon cou : WarplyManagerHelper.getCouponRedeemedList()) {
if (cou.getCouponsetDetails().getCouponsetType().equals("supermarket")) {
countValue += Float.valueOf(cou.getDiscount());
mExpiredMarketCoupons.add(cou);
}
}
Collections.sort(mExpiredMarketCoupons, (coupon1, coupon2) -> coupon2.getChangesDates().optString("redeemed").compareTo(coupon1.getChangesDates().optString("redeemed")));
new Handler(Looper.getMainLooper()).post(this::initViews);
executor.shutdownNow();
......
......@@ -28,7 +28,6 @@ import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.MarketPassDetailsModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.utils.WarpJSONParser;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.managers.WarplyManager;
......@@ -128,7 +127,6 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
if (WarplyDBHelper.getInstance(getActivity()).isTableNotEmpty("auth")) {
WarplyManager.getUserCouponsWithCouponsets(mUserCouponsReceiver);
WarplyManager.getCampaigns(mCampaignsCallback);
WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback);
WarplyManager.getMarketPassDetails(mMarketPassDetailsCallback);
mSwipeRefresh.setRefreshing(false);
} else {
......@@ -191,18 +189,6 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
}
};
private final CallbackReceiver<ArrayList<UnifiedCoupon>> mUnifiedCallback = new CallbackReceiver<ArrayList<UnifiedCoupon>>() {
@Override
public void onSuccess(ArrayList<UnifiedCoupon> result) {
Toast.makeText(getActivity(), "Unified Coupons Success " + String.valueOf(result.size()), Toast.LENGTH_SHORT).show();
}
@Override
public void onFailure(int errorCode) {
Toast.makeText(getActivity(), "Unified Coupons Error", Toast.LENGTH_SHORT).show();
}
};
private final CallbackReceiver<JSONObject> mLogoutReceiver = new CallbackReceiver<JSONObject>() {
@Override
public void onSuccess(JSONObject result) {
......@@ -240,7 +226,6 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
WarplyManager.getUserCouponsWithCouponsets(mUserCouponsReceiver);
WarplyManager.getCampaigns(mCampaignsCallback);
WarplyManager.getUnifiedCouponsDeals(mUnifiedCallback);
WarplyManager.getMarketPassDetails(mMarketPassDetailsCallback);
}
......
......@@ -191,7 +191,7 @@
<string name="cos_market_ab_subtitle">1. Eνεργοποίησε τον κωδικό στην κάρτα ΑΒ PLUS στο kiosk του καταστήματος ή μέσω eshop / app στην ενοτητα στην ενότητα Συνεργασίες – SUPERMARKET DEALS.\n\n2. Κάνε τις αγορές σου και κέρδισε απευθείας έκπτωση με χρήση της AB PLUS από τα διαθέσιμα κουπόνια.</string>
<string name="cos_market_pass_title">SUPERMARKET DEALS CARD</string>
<string name="cos_market_pass_subtitle">Χρησιμοποίησε τον κωδικό σου και κέρδισε έκπτωση στις αγορές σου!</string>
<string name="cos_market_pass_return">Επιστροφή στο Supermarket Deals</string>
<string name="cos_market_pass_return">Επιστροφή</string>
<string name="cos_market_pass_coupons_title">Έχεις κουπόνια συνολικής αξίας %1$s€</string>
<string name="cos_market_subtitle">Δημιούργησε το δικό σου ενιαίο κουπόνι προσφορών, και εξαργύρωσέ το στα supermarket της επιλογής σου γρήγορα και εύκολα με ένα μόνο κωδικό κουπονιού!</string>
<string name="cos_market_close">Τέλος</string>
......