Panagiotis Triantafyllou

multiple click fixes

......@@ -58,7 +58,8 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
private LinearLayout mLlGiftIt, mLlShops, mLlBarcodeShown, mLlBarcodeContainer, mLlTerms, mLlWebsite;
private Coupon mCoupon;
private Couponset mCouponset;
private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false;
private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false,
mShopsPressed = false, mGiftPressed = false, mEshopPressed = false;
private Merchant mMerchant;
// ===========================================================
......@@ -99,6 +100,9 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent(this, "screen", "CouponScreen");
mShopsPressed = false;
mGiftPressed = false;
mEshopPressed = false;
}
@Override
......@@ -119,41 +123,50 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener
return;
}
if (view.getId() == R.id.ll_gift_it) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon")
.concat(":")
.concat(mCoupon.getName()));
Intent intent = new Intent(CouponInfoActivity.this, CouponShareActivity.class);
intent.putExtra("coupon", (Serializable) mCoupon);
intent.putExtra("isFromWallet", mIsFromWallet);
if (!mIsFromWallet)
startActivity(intent);
else
startActivityForResult(intent, 1001);
if (!mGiftPressed) {
mGiftPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("ShareCoupon")
.concat(":")
.concat(mCoupon.getName()));
Intent intent = new Intent(CouponInfoActivity.this, CouponShareActivity.class);
intent.putExtra("coupon", (Serializable) mCoupon);
intent.putExtra("isFromWallet", mIsFromWallet);
if (!mIsFromWallet)
startActivity(intent);
else
startActivityForResult(intent, 1001);
}
return;
}
if (view.getId() == R.id.ll_shops) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops");
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(CouponInfoActivity.this) == ConnectionResult.SUCCESS) {
Intent intent = new Intent(CouponInfoActivity.this, ShopsActivity.class);
intent.putExtra("couponset", (Serializable) mCouponset);
startActivity(intent);
return;
} else {
Intent intent = new Intent(CouponInfoActivity.this, ShopsHuaweiActivity.class);
intent.putExtra("couponset", (Serializable) mCouponset);
startActivity(intent);
return;
if (!mShopsPressed) {
mShopsPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops");
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(CouponInfoActivity.this) == ConnectionResult.SUCCESS) {
Intent intent = new Intent(CouponInfoActivity.this, ShopsActivity.class);
intent.putExtra("couponset", (Serializable) mCouponset);
startActivity(intent);
return;
} else {
Intent intent = new Intent(CouponInfoActivity.this, ShopsHuaweiActivity.class);
intent.putExtra("couponset", (Serializable) mCouponset);
startActivity(intent);
return;
}
}
}
if (view.getId() == R.id.ll_website) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite");
if (!TextUtils.isEmpty(mMerchant.getWebsite())) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(mMerchant.getWebsite()));
startActivity(intent);
if (!mEshopPressed) {
mEshopPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShopWebsite");
if (!TextUtils.isEmpty(mMerchant.getWebsite())) {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(mMerchant.getWebsite()));
startActivity(intent);
}
}
return;
}
......
......@@ -100,7 +100,9 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
private ExpandableLayout mElGifts;
private boolean mIsStayCollapsed = true;
private CardView mClExp;
private boolean mDfyPressed = false, mDealsBannerPressed = false;
private boolean mDfyPressed = false, mDealsBannerPressed = false, mQuestionnairePressed = false,
mHistoryPressed = false, mHistoryMarketPressed = false, mUnifiedPressed = false,
mCouponPressed = false;
// ===========================================================
// Methods for/from SuperClass/Interfaces
......@@ -206,6 +208,11 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
});
mDfyPressed = false;
mDealsBannerPressed = false;
mQuestionnairePressed = false;
mHistoryPressed = false;
mHistoryMarketPressed = false;
mUnifiedPressed = false;
mCouponPressed = false;
}
@Override
......@@ -229,15 +236,18 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
return;
}
if (view.getId() == R.id.ll_user_questionnaire || view.getId() == R.id.ll_user_badge) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("Questionnaire"));
if (!mQuestionnairePressed) {
mQuestionnairePressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("Questionnaire"));
startActivityForResult(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire()), 1000);
startActivityForResult(WarpViewActivity.createIntentFromURL(LoyaltyWallet.this, WarplyManagerHelper.openQuestionnaire()), 1000);
}
return;
}
if (view.getId() == R.id.cl_deals_win_inner_cos) {
if(!mDealsBannerPressed) {
if (!mDealsBannerPressed) {
mDealsBannerPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
......@@ -256,17 +266,20 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
return;
}
if (view.getId() == R.id.cl_deals_win_inner) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("LoyaltyBanner"));
if (!mHistoryPressed) {
mHistoryPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("LoyaltyBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_gifts_for_you_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_gifts_for_you_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(LoyaltyWallet.this, LoyaltyAnalysisActivity.class);
startActivity(intent);
Intent intent = new Intent(LoyaltyWallet.this, LoyaltyAnalysisActivity.class);
startActivity(intent);
}
return;
}
if (view.getId() == R.id.cl_exp) {
......@@ -282,15 +295,18 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
}
if (view.getId() == R.id.cl_market_inner) {
// if (countValue > 0) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("MarketBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_market_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class);
startActivity(intent);
if (!mHistoryMarketPressed) {
mHistoryMarketPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("LoyaltyWalletScreen")
.concat(":")
.concat("MarketBanner"));
LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
analyticsEvent.setEventName("did_tap_market_badge");
analyticsEvent.setParameter("screen", "Loyalty Wallet");
EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
Intent intent = new Intent(LoyaltyWallet.this, LoyaltyMarketAnalysisActivity.class);
startActivity(intent);
}
// }
return;
}
......@@ -340,6 +356,7 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
@Subscribe()
public void onMessageEvent(WarplyEventBusManager event) {
if (event.getCouponsAdded() != null) {
mCouponPressed = false;
CouponList tempCouponList = new CouponList();
CouponList cpnlist = new CouponList();
tempCouponList.clear();
......@@ -367,11 +384,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivityForResult(intent, 1002);
if (!mCouponPressed) {
mCouponPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivityForResult(intent, 1002);
}
})
.doOnError(error -> {
})
......@@ -418,11 +438,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRvMarketCoupons.setAdapter(mAdapterMarketCoupons);
mAdapterMarketCoupons.getPositionClicks()
.doOnNext(coupon -> {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivity(intent);
if (!mUnifiedPressed) {
mUnifiedPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("UnifiedCoupon").concat(":").concat(coupon.getBarcode()));
Intent intent = new Intent(LoyaltyWallet.this, UnifiedCouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivity(intent);
}
// startActivityForResult(intent, 1002);
})
.doOnError(error -> {
......@@ -455,11 +478,14 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivityForResult(intent, 1002);
if (!mCouponPressed) {
mCouponPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("Coupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(LoyaltyWallet.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivityForResult(intent, 1002);
}
})
.doOnError(error -> {
})
......
......@@ -53,7 +53,7 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
private LinearLayout mLlShops, mLlBarcodeContainer, mLlTerms, mLlMarketCoupons, mLlMarketExpand;
private UnifiedCoupon mCoupon;
private boolean mIsBarcodeShown = false, mIsTermsShown = false, mIsFromWallet = false,
mIsMarketExpand = true;
mIsMarketExpand = true, mShopsPressed = false, mCouponPressed = false;
private RecyclerView mRecyclerCoupons;
private ActiveCouponAdapter mAdapterCoupons;
......@@ -102,6 +102,8 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
public void onResume() {
super.onResume();
WarplyAnalyticsManager.logTrackersEvent(this, "screen", "UnifiedCouponScreen");
mShopsPressed = false;
mCouponPressed = false;
}
@Override
......@@ -111,16 +113,18 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
return;
}
if (view.getId() == R.id.ll_shops) {
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops");
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(UnifiedCouponInfoActivity.this) == ConnectionResult.SUCCESS) {
Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsActivity.class);
startActivity(intent);
return;
} else {
Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsHuaweiActivity.class);
startActivity(intent);
return;
if (!mShopsPressed) {
mShopsPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops");
if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(UnifiedCouponInfoActivity.this) == ConnectionResult.SUCCESS) {
Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsActivity.class);
startActivity(intent);
return;
} else {
Intent intent = new Intent(UnifiedCouponInfoActivity.this, ShopsHuaweiActivity.class);
startActivity(intent);
return;
}
}
}
if (view.getId() == R.id.ll_terms_inner) {
......@@ -203,11 +207,14 @@ public class UnifiedCouponInfoActivity extends Activity implements View.OnClickL
mRecyclerCoupons.setAdapter(mAdapterCoupons);
mAdapterCoupons.getPositionClicks()
.doOnNext(coupon -> {
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("MarketCoupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(UnifiedCouponInfoActivity.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivity(intent);
if (!mCouponPressed) {
mCouponPressed = true;
WarplyAnalyticsManager.logTrackersEvent(this, "click", ("MarketCoupon").concat(":").concat(coupon.getName()));
Intent intent = new Intent(UnifiedCouponInfoActivity.this, CouponInfoActivity.class);
intent.putExtra("coupon", (Serializable) coupon);
intent.putExtra("isFromWallet", true);
startActivity(intent);
}
})
.doOnError(error -> {
})
......