Panagiotis Triantafyllou

multiple click fix

...@@ -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.6rc66' 5 + PUBLISH_VERSION = '4.5.4.6rc67'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -61,7 +61,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -61,7 +61,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
61 private LinearLayout mLlRedeem, mLlTerms; 61 private LinearLayout mLlRedeem, mLlTerms;
62 private ProgressBar mPbLoading; 62 private ProgressBar mPbLoading;
63 private Coupon mCoupon; 63 private Coupon mCoupon;
64 - private boolean mIsTermsPressed = false; 64 + private boolean mIsTermsPressed = false, mIsGiftPressed = false;
65 private AlertDialog mAlertDialogCouponset; 65 private AlertDialog mAlertDialogCouponset;
66 private Campaign mLoyalty; 66 private Campaign mLoyalty;
67 private LoyaltyContextualOfferModel mCcms = null; 67 private LoyaltyContextualOfferModel mCcms = null;
...@@ -98,6 +98,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -98,6 +98,7 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
98 public void onResume() { 98 public void onResume() {
99 super.onResume(); 99 super.onResume();
100 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "CouponsetScreen"); 100 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "CouponsetScreen");
101 + mIsGiftPressed = false;
101 } 102 }
102 103
103 @Override 104 @Override
...@@ -107,44 +108,47 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe ...@@ -107,44 +108,47 @@ public class CouponsetInfoActivity extends Activity implements View.OnClickListe
107 return; 108 return;
108 } 109 }
109 if (view.getId() == R.id.ll_get_gift) { 110 if (view.getId() == R.id.ll_get_gift) {
110 - mLlRedeem.setEnabled(false); 111 + if (!mIsGiftPressed) {
111 - mPbLoading.setVisibility(View.VISIBLE); 112 + mIsGiftPressed = true;
112 - WarplyAnalyticsManager.logTrackersEvent(this, "click", ("RetrieveCoupon") 113 + mLlRedeem.setEnabled(false);
113 - .concat(":") 114 + mPbLoading.setVisibility(View.VISIBLE);
114 - .concat(mCouponset.getUuid())); 115 + WarplyAnalyticsManager.logTrackersEvent(this, "click", ("RetrieveCoupon")
115 - if (mCcms == null) { 116 + .concat(":")
116 - WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest() 117 + .concat(mCouponset.getUuid()));
117 - .setCouponsetUuid(mCouponset.getUuid()) 118 + if (mCcms == null) {
118 - .setCommunicationUuid(mLoyalty.getSessionUUID()), mRedeemCouponCallback); 119 + WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest()
119 - } else { 120 + .setCouponsetUuid(mCouponset.getUuid())
120 - WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest() 121 + .setCommunicationUuid(mLoyalty.getSessionUUID()), mRedeemCouponCallback);
121 - .setCouponsetUuid(mCouponset.getUuid()) 122 + } else {
122 - .setCommunicationUuid(mLoyalty.getSessionUUID()) 123 + WarplyManager.redeemCoupon(new WarplyRedeemCouponRequest()
123 - .setHasContextualOffer(true) 124 + .setCouponsetUuid(mCouponset.getUuid())
124 - .setSessionId(mCcms.getSessionId()) 125 + .setCommunicationUuid(mLoyalty.getSessionUUID())
125 - .setUserMsisdn(WarplyManagerHelper.getConsumer().getMsisdn()) //TODO: where to find the msisdn?? 126 + .setHasContextualOffer(true)
126 - .setBusinessService(mCcms.getBusinessService()) 127 + .setSessionId(mCcms.getSessionId())
127 - .setOfferName(mCcms.getOfferName()) 128 + .setUserMsisdn(WarplyManagerHelper.getConsumer().getMsisdn()) //TODO: where to find the msisdn??
128 - .setProductType(mCcms.getProductType()) 129 + .setBusinessService(mCcms.getBusinessService())
129 - .setProvDuration(mCcms.getProvDuration()) 130 + .setOfferName(mCcms.getOfferName())
130 - .setNoOfRecurrance(mCcms.getNoOfRecurrance()) 131 + .setProductType(mCcms.getProductType())
131 - .setPrice(mCcms.getPrice()) 132 + .setProvDuration(mCcms.getProvDuration())
132 - .setDiscount(mCcms.getDiscount()) 133 + .setNoOfRecurrance(mCcms.getNoOfRecurrance())
133 - .setVoiceCategory(mCcms.getVoiceCategory()) 134 + .setPrice(mCcms.getPrice())
134 - .setDataCategory(mCcms.getDataCategory()) 135 + .setDiscount(mCcms.getDiscount())
135 - .setMinsValue(mCcms.getMinsValue()) 136 + .setVoiceCategory(mCcms.getVoiceCategory())
136 - .setDataValue(mCcms.getDataValue()) 137 + .setDataCategory(mCcms.getDataCategory())
137 - .setProvStepValueMins(mCcms.getProvStepValueMins()) 138 + .setMinsValue(mCcms.getMinsValue())
138 - .setOfferAudienceLevel(mCcms.getOfferAudienceLevel()) 139 + .setDataValue(mCcms.getDataValue())
139 - .setUACIOfferTrackingCode(mCcms.getUACIOfferTrackingCode()) 140 + .setProvStepValueMins(mCcms.getProvStepValueMins())
140 - .setOfferCode1(mCcms.getOfferCode1()) 141 + .setOfferAudienceLevel(mCcms.getOfferAudienceLevel())
141 - .setScore(mCcms.getScore()) 142 + .setUACIOfferTrackingCode(mCcms.getUACIOfferTrackingCode())
142 - .setZone(mCcms.getZone()) 143 + .setOfferCode1(mCcms.getOfferCode1())
143 - .setWave(mCcms.getWave()) 144 + .setScore(mCcms.getScore())
144 - .setValidity(mCcms.getValidity()) 145 + .setZone(mCcms.getZone())
145 - .setTreatmentCode(mCcms.getTreatmentCode()), mRedeemCouponCallback); 146 + .setWave(mCcms.getWave())
147 + .setValidity(mCcms.getValidity())
148 + .setTreatmentCode(mCcms.getTreatmentCode()), mRedeemCouponCallback);
149 + }
150 + return;
146 } 151 }
147 - return;
148 } 152 }
149 if (view.getId() == R.id.ll_terms_inner) { 153 if (view.getId() == R.id.ll_terms_inner) {
150 if (mIsTermsPressed) { 154 if (mIsTermsPressed) {
......