Panagiotis Triantafyllou

multiple click fix

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc66'
PUBLISH_VERSION = '4.5.4.6rc67'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -61,7 +61,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
private LinearLayout mLlRedeem, mLlTerms;
private ProgressBar mPbLoading;
private Coupon mCoupon;
private boolean mIsTermsPressed = false;
private boolean mIsTermsPressed = false, mIsGiftPressed = false;
private AlertDialog mAlertDialogCouponset;
private Campaign mLoyalty;
private LoyaltyContextualOfferModel mCcms = null;
......@@ -98,6 +98,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent(this, "screen", "CouponsetScreen");
mIsGiftPressed = false;
}
@Override
......@@ -107,44 +108,47 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
return;
}
if (view.getId() == R.id.ll_get_gift) {
mLlRedeem.setEnabled(false);
mPbLoading.setVisibility(View.VISIBLE);
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("RetrieveCoupon")
.concat(":")
.concat(mCouponset.getUuid()));
if (mCcms == null) {
WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest()
.setCouponsetUuid(mCouponset.getUuid())
.setCommunicationUuid(mLoyalty.getSessionUUID()), mRedeemCouponCallback);
} else {
WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest()
.setCouponsetUuid(mCouponset.getUuid())
.setCommunicationUuid(mLoyalty.getSessionUUID())
.setHasContextualOffer(true)
.setSessionId(mCcms.getSessionId())
.setUserMsisdn(WarplyManagerHelper.getConsumer().getMsisdn()) //TODO: where to find the msisdn??
.setBusinessService(mCcms.getBusinessService())
.setOfferName(mCcms.getOfferName())
.setProductType(mCcms.getProductType())
.setProvDuration(mCcms.getProvDuration())
.setNoOfRecurrance(mCcms.getNoOfRecurrance())
.setPrice(mCcms.getPrice())
.setDiscount(mCcms.getDiscount())
.setVoiceCategory(mCcms.getVoiceCategory())
.setDataCategory(mCcms.getDataCategory())
.setMinsValue(mCcms.getMinsValue())
.setDataValue(mCcms.getDataValue())
.setProvStepValueMins(mCcms.getProvStepValueMins())
.setOfferAudienceLevel(mCcms.getOfferAudienceLevel())
.setUACIOfferTrackingCode(mCcms.getUACIOfferTrackingCode())
.setOfferCode1(mCcms.getOfferCode1())
.setScore(mCcms.getScore())
.setZone(mCcms.getZone())
.setWave(mCcms.getWave())
.setValidity(mCcms.getValidity())
.setTreatmentCode(mCcms.getTreatmentCode()), mRedeemCouponCallback);
if (!mIsGiftPressed) {
mIsGiftPressed = true;
mLlRedeem.setEnabled(false);
mPbLoading.setVisibility(View.VISIBLE);
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("RetrieveCoupon")
.concat(":")
.concat(mCouponset.getUuid()));
if (mCcms == null) {
WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest()
.setCouponsetUuid(mCouponset.getUuid())
.setCommunicationUuid(mLoyalty.getSessionUUID()), mRedeemCouponCallback);
} else {
WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest()
.setCouponsetUuid(mCouponset.getUuid())
.setCommunicationUuid(mLoyalty.getSessionUUID())
.setHasContextualOffer(true)
.setSessionId(mCcms.getSessionId())
.setUserMsisdn(WarplyManagerHelper.getConsumer().getMsisdn()) //TODO: where to find the msisdn??
.setBusinessService(mCcms.getBusinessService())
.setOfferName(mCcms.getOfferName())
.setProductType(mCcms.getProductType())
.setProvDuration(mCcms.getProvDuration())
.setNoOfRecurrance(mCcms.getNoOfRecurrance())
.setPrice(mCcms.getPrice())
.setDiscount(mCcms.getDiscount())
.setVoiceCategory(mCcms.getVoiceCategory())
.setDataCategory(mCcms.getDataCategory())
.setMinsValue(mCcms.getMinsValue())
.setDataValue(mCcms.getDataValue())
.setProvStepValueMins(mCcms.getProvStepValueMins())
.setOfferAudienceLevel(mCcms.getOfferAudienceLevel())
.setUACIOfferTrackingCode(mCcms.getUACIOfferTrackingCode())
.setOfferCode1(mCcms.getOfferCode1())
.setScore(mCcms.getScore())
.setZone(mCcms.getZone())
.setWave(mCcms.getWave())
.setValidity(mCcms.getValidity())
.setTreatmentCode(mCcms.getTreatmentCode()), mRedeemCouponCallback);
}
return;
}
return;
}
if (view.getId() == R.id.ll_terms_inner) {
if (mIsTermsPressed) {
......