Panagiotis Triantafyllou

multiple click fixes

...@@ -58,7 +58,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -58,7 +58,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
58 private LinearLayout mLlGiftIt, mLlShops, mLlBarcodeShown, mLlBarcodeContainer, mLlTerms, mLlWebsite; 58 private LinearLayout mLlGiftIt, mLlShops, mLlBarcodeShown, mLlBarcodeContainer, mLlTerms, mLlWebsite;
59 private Coupon mCoupon; 59 private Coupon mCoupon;
60 private Couponset mCouponset; 60 private Couponset mCouponset;
61 - private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false; 61 + private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false,
62 + mShopsPressed = false, mGiftPressed = false, mEshopPressed = false;
62 private Merchant mMerchant; 63 private Merchant mMerchant;
63 64
64 // =========================================================== 65 // ===========================================================
...@@ -99,6 +100,9 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -99,6 +100,9 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
99 public void onResume() { 100 public void onResume() {
100 super.onResume(); 101 super.onResume();
101 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "CouponScreen"); 102 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "CouponScreen");
103 + mShopsPressed = false;
104 + mGiftPressed = false;
105 + mEshopPressed = false;
102 } 106 }
103 107
104 @Override 108 @Override
...@@ -119,6 +123,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -119,6 +123,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
119 return; 123 return;
120 } 124 }
121 if (view.getId() == R.id.ll_gift_it) { 125 if (view.getId() == R.id.ll_gift_it) {
126 + if (!mGiftPressed) {
127 + mGiftPressed = true;
122 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon") 128 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon")
123 .concat(":") 129 .concat(":")
124 .concat(mCoupon.getName())); 130 .concat(mCoupon.getName()));
...@@ -130,9 +136,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -130,9 +136,12 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
130 startActivity(intent); 136 startActivity(intent);
131 else 137 else
132 startActivityForResult(intent, 1001); 138 startActivityForResult(intent, 1001);
139 + }
133 return; 140 return;
134 } 141 }
135 if (view.getId() == R.id.ll_shops) { 142 if (view.getId() == R.id.ll_shops) {
143 + if (!mShopsPressed) {
144 + mShopsPressed = true;
136 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops"); 145 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops");
137 146
138 if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(CouponInfoActivity.this) == ConnectionResult.SUCCESS) { 147 if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(CouponInfoActivity.this) == ConnectionResult.SUCCESS) {
...@@ -147,7 +156,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -147,7 +156,10 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
147 return; 156 return;
148 } 157 }
149 } 158 }
159 + }
150 if (view.getId() == R.id.ll_website) { 160 if (view.getId() == R.id.ll_website) {
161 + if (!mEshopPressed) {
162 + mEshopPressed = true;
151 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite"); 163 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite");
152 164
153 if (!TextUtils.isEmpty(mMerchant.getWebsite())) { 165 if (!TextUtils.isEmpty(mMerchant.getWebsite())) {
...@@ -155,6 +167,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener ...@@ -155,6 +167,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
155 intent.setData(Uri.parse(mMerchant.getWebsite())); 167 intent.setData(Uri.parse(mMerchant.getWebsite()));
156 startActivity(intent); 168 startActivity(intent);
157 } 169 }
170 + }
158 return; 171 return;
159 } 172 }
160 if (view.getId() == R.id.ll_show_barcode) { 173 if (view.getId() == R.id.ll_show_barcode) {
......
...@@ -100,7 +100,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -100,7 +100,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
100 private ExpandableLayout mElGifts; 100 private ExpandableLayout mElGifts;
101 private boolean mIsStayCollapsed = true; 101 private boolean mIsStayCollapsed = true;
102 private CardView mClExp; 102 private CardView mClExp;
103 - private boolean mDfyPressed = false, mDealsBannerPressed = false; 103 + private boolean mDfyPressed = false, mDealsBannerPressed = false, mQuestionnairePressed = false,
104 + mHistoryPressed = false, mHistoryMarketPressed = false, mUnifiedPressed = false,
105 + mCouponPressed = false;
104 106
105 // =========================================================== 107 // ===========================================================
106 // Methods for/from SuperClass/Interfaces 108 // Methods for/from SuperClass/Interfaces
...@@ -206,6 +208,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -206,6 +208,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
206 }); 208 });
207 mDfyPressed = false; 209 mDfyPressed = false;
208 mDealsBannerPressed = false; 210 mDealsBannerPressed = false;
211 + mQuestionnairePressed = false;
212 + mHistoryPressed = false;
213 + mHistoryMarketPressed = false;
214 + mUnifiedPressed = false;
215 + mCouponPressed = false;
209 } 216 }
210 217
211 @Override 218 @Override
...@@ -229,15 +236,18 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -229,15 +236,18 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
229 return; 236 return;
230 } 237 }
231 if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) { 238 if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) {
239 + if (!mQuestionnairePressed) {
240 + mQuestionnairePressed = true;
232 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen") 241 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
233 .concat(":") 242 .concat(":")
234 .concat("Questionnaire")); 243 .concat("Questionnaire"));
235 244
236 startActivityForResult(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire()), 1000); 245 startActivityForResult(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire()), 1000);
246 + }
237 return; 247 return;
238 } 248 }
239 if (view.getId() == R.id.cl_deals_win_inner_cos) { 249 if (view.getId() == R.id.cl_deals_win_inner_cos) {
240 - if(!mDealsBannerPressed) { 250 + if (!mDealsBannerPressed) {
241 mDealsBannerPressed = true; 251 mDealsBannerPressed = true;
242 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen") 252 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
243 .concat(":") 253 .concat(":")
...@@ -256,6 +266,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -256,6 +266,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
256 return; 266 return;
257 } 267 }
258 if (view.getId() == R.id.cl_deals_win_inner) { 268 if (view.getId() == R.id.cl_deals_win_inner) {
269 + if (!mHistoryPressed) {
270 + mHistoryPressed = true;
259 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen") 271 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
260 .concat(":") 272 .concat(":")
261 .concat("LoyaltyBanner")); 273 .concat("LoyaltyBanner"));
...@@ -267,6 +279,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -267,6 +279,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
267 279
268 Intent intent = new Intent(LoyaltyWallet.this, LoyaltyAnalysisActivity.class); 280 Intent intent = new Intent(LoyaltyWallet.this, LoyaltyAnalysisActivity.class);
269 startActivity(intent); 281 startActivity(intent);
282 + }
270 return; 283 return;
271 } 284 }
272 if (view.getId() == R.id.cl_exp) { 285 if (view.getId() == R.id.cl_exp) {
...@@ -282,6 +295,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -282,6 +295,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
282 } 295 }
283 if (view.getId() == R.id.cl_market_inner) { 296 if (view.getId() == R.id.cl_market_inner) {
284 // if (countValue > 0) { 297 // if (countValue > 0) {
298 + if (!mHistoryMarketPressed) {
299 + mHistoryMarketPressed = true;
285 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen") 300 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
286 .concat(":") 301 .concat(":")
287 .concat("MarketBanner")); 302 .concat("MarketBanner"));
...@@ -291,6 +306,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -291,6 +306,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
291 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 306 EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
292 Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class); 307 Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class);
293 startActivity(intent); 308 startActivity(intent);
309 + }
294 // } 310 // }
295 return; 311 return;
296 } 312 }
...@@ -340,6 +356,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -340,6 +356,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
340 @Subscribe() 356 @Subscribe()
341 public void onMessageEvent(WarplyEventBusManager event) { 357 public void onMessageEvent(WarplyEventBusManager event) {
342 if (event.getCouponsAdded() != null) { 358 if (event.getCouponsAdded() != null) {
359 + mCouponPressed = false;
343 CouponList tempCouponList = new CouponList(); 360 CouponList tempCouponList = new CouponList();
344 CouponList cpnlist = new CouponList(); 361 CouponList cpnlist = new CouponList();
345 tempCouponList.clear(); 362 tempCouponList.clear();
...@@ -367,11 +384,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -367,11 +384,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
367 mRecyclerCoupons.setAdapter(mAdapterCoupons); 384 mRecyclerCoupons.setAdapter(mAdapterCoupons);
368 mAdapterCoupons.getPositionClicks() 385 mAdapterCoupons.getPositionClicks()
369 .doOnNext(coupon -> { 386 .doOnNext(coupon -> {
387 + if (!mCouponPressed) {
388 + mCouponPressed = true;
370 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName())); 389 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
371 Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class); 390 Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
372 intent.putExtra("coupon", (Serializable) coupon); 391 intent.putExtra("coupon", (Serializable) coupon);
373 intent.putExtra("isFromWallet", true); 392 intent.putExtra("isFromWallet", true);
374 startActivityForResult(intent, 1002); 393 startActivityForResult(intent, 1002);
394 + }
375 }) 395 })
376 .doOnError(error -> { 396 .doOnError(error -> {
377 }) 397 })
...@@ -418,11 +438,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -418,11 +438,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
418 mRvMarketCoupons.setAdapter(mAdapterMarketCoupons); 438 mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
419 mAdapterMarketCoupons.getPositionClicks() 439 mAdapterMarketCoupons.getPositionClicks()
420 .doOnNext(coupon -> { 440 .doOnNext(coupon -> {
441 + if (!mUnifiedPressed) {
442 + mUnifiedPressed = true;
421 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode())); 443 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
422 Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class); 444 Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
423 intent.putExtra("coupon", (Serializable) coupon); 445 intent.putExtra("coupon", (Serializable) coupon);
424 intent.putExtra("isFromWallet", true); 446 intent.putExtra("isFromWallet", true);
425 startActivity(intent); 447 startActivity(intent);
448 + }
426 // startActivityForResult(intent, 1002); 449 // startActivityForResult(intent, 1002);
427 }) 450 })
428 .doOnError(error -> { 451 .doOnError(error -> {
...@@ -455,11 +478,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -455,11 +478,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
455 mRecyclerCoupons.setAdapter(mAdapterCoupons); 478 mRecyclerCoupons.setAdapter(mAdapterCoupons);
456 mAdapterCoupons.getPositionClicks() 479 mAdapterCoupons.getPositionClicks()
457 .doOnNext(coupon -> { 480 .doOnNext(coupon -> {
481 + if (!mCouponPressed) {
482 + mCouponPressed = true;
458 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName())); 483 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
459 Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class); 484 Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
460 intent.putExtra("coupon", (Serializable) coupon); 485 intent.putExtra("coupon", (Serializable) coupon);
461 intent.putExtra("isFromWallet", true); 486 intent.putExtra("isFromWallet", true);
462 startActivityForResult(intent, 1002); 487 startActivityForResult(intent, 1002);
488 + }
463 }) 489 })
464 .doOnError(error -> { 490 .doOnError(error -> {
465 }) 491 })
......
...@@ -53,7 +53,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL ...@@ -53,7 +53,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
53 private LinearLayout mLlShops, mLlBarcodeContainer, mLlTerms, mLlMarketCoupons, mLlMarketExpand; 53 private LinearLayout mLlShops, mLlBarcodeContainer, mLlTerms, mLlMarketCoupons, mLlMarketExpand;
54 private UnifiedCoupon mCoupon; 54 private UnifiedCoupon mCoupon;
55 private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false, 55 private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false,
56 - mIsMarketExpand = true; 56 + mIsMarketExpand = true, mShopsPressed = false, mCouponPressed = false;
57 private RecyclerView mRecyclerCoupons; 57 private RecyclerView mRecyclerCoupons;
58 private ActiveCouponAdapter mAdapterCoupons; 58 private ActiveCouponAdapter mAdapterCoupons;
59 59
...@@ -102,6 +102,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL ...@@ -102,6 +102,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
102 public void onResume() { 102 public void onResume() {
103 super.onResume(); 103 super.onResume();
104 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "UnifiedCouponScreen"); 104 WarplyAnalyticsManager.logTrackersEvent(this, "screen", "UnifiedCouponScreen");
105 + mShopsPressed = false;
106 + mCouponPressed = false;
105 } 107 }
106 108
107 @Override 109 @Override
...@@ -111,8 +113,9 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL ...@@ -111,8 +113,9 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
111 return; 113 return;
112 } 114 }
113 if (view.getId() == R.id.ll_shops) { 115 if (view.getId() == R.id.ll_shops) {
116 + if (!mShopsPressed) {
117 + mShopsPressed = true;
114 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops"); 118 WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops");
115 -
116 if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(UnifiedCouponInfoActivity.this) == ConnectionResult.SUCCESS) { 119 if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(UnifiedCouponInfoActivity.this) == ConnectionResult.SUCCESS) {
117 Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsActivity.class); 120 Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsActivity.class);
118 startActivity(intent); 121 startActivity(intent);
...@@ -123,6 +126,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL ...@@ -123,6 +126,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
123 return; 126 return;
124 } 127 }
125 } 128 }
129 + }
126 if (view.getId() == R.id.ll_terms_inner) { 130 if (view.getId() == R.id.ll_terms_inner) {
127 if (mIsTermsShown) { 131 if (mIsTermsShown) {
128 mTvTermsValue.setVisibility(View.GONE); 132 mTvTermsValue.setVisibility(View.GONE);
...@@ -203,11 +207,14 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL ...@@ -203,11 +207,14 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
203 mRecyclerCoupons.setAdapter(mAdapterCoupons); 207 mRecyclerCoupons.setAdapter(mAdapterCoupons);
204 mAdapterCoupons.getPositionClicks() 208 mAdapterCoupons.getPositionClicks()
205 .doOnNext(coupon -> { 209 .doOnNext(coupon -> {
210 + if (!mCouponPressed) {
211 + mCouponPressed = true;
206 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("MarketCoupon").concat(":").concat(coupon.getName())); 212 WarplyAnalyticsManager.logTrackersEvent(this, "click", ("MarketCoupon").concat(":").concat(coupon.getName()));
207 Intent intent = new Intent(UnifiedCouponInfoActivity.this, CouponInfoActivity.class); 213 Intent intent = new Intent(UnifiedCouponInfoActivity.this, CouponInfoActivity.class);
208 intent.putExtra("coupon", (Serializable) coupon); 214 intent.putExtra("coupon", (Serializable) coupon);
209 intent.putExtra("isFromWallet", true); 215 intent.putExtra("isFromWallet", true);
210 startActivity(intent); 216 startActivity(intent);
217 + }
211 }) 218 })
212 .doOnError(error -> { 219 .doOnError(error -> {
213 }) 220 })
......