Panagiotis Triantafyllou

added event for the client to open the myrewards fragment from supermarket deals campaign

1 +/*
2 + * Copyright 2010-2013 Warply Ltd. All rights reserved.
3 + *
4 + * Redistribution and use in source and binary forms, without modification, are
5 + * permitted provided that the following conditions are met:
6 + *
7 + * 1. Redistributions of source code must retain the above copyright notice,
8 + * this list of conditions and the following disclaimer.
9 + *
10 + * 2. Redistributions in binary form must reproduce the above copyright notice,
11 + * this list of conditions and the following disclaimer in the documentation
12 + * and/or other materials provided with the distribution.
13 + *
14 + * THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + * EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20 + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +package ly.warp.sdk.io.models;
27 +
28 +
29 +/**
30 + * Created by Panagiotis Triantafyllou on 27-Feb-24.
31 + */
32 +
33 +public class OpenMyRewardsEventModel {
34 + private boolean open;
35 +
36 + public OpenMyRewardsEventModel() {
37 + this.open = true;
38 + }
39 +
40 + public boolean isOpen() {
41 + return open;
42 + }
43 +
44 + public void setOpen(boolean open) {
45 + this.open = open;
46 + }
47 +}
...@@ -13,6 +13,7 @@ import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; ...@@ -13,6 +13,7 @@ import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent;
13 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; 13 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
14 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; 14 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
15 import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel; 15 import ly.warp.sdk.io.models.LoyaltySDKSessionExpiredEventModel;
16 +import ly.warp.sdk.io.models.OpenMyRewardsEventModel;
16 import ly.warp.sdk.io.models.QuestionnaireEventModel; 17 import ly.warp.sdk.io.models.QuestionnaireEventModel;
17 import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel; 18 import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel;
18 import ly.warp.sdk.io.models.RefreshVouchersEventModel; 19 import ly.warp.sdk.io.models.RefreshVouchersEventModel;
...@@ -45,6 +46,7 @@ public class WarplyEventBusManager { ...@@ -45,6 +46,7 @@ public class WarplyEventBusManager {
45 private WarplyCCMSEnabledModel ccmsActivated; 46 private WarplyCCMSEnabledModel ccmsActivated;
46 private LoyaltyGiftsForYouOfferClickEvent giftsYou; 47 private LoyaltyGiftsForYouOfferClickEvent giftsYou;
47 private QuestionnaireEventModel questionnaire; 48 private QuestionnaireEventModel questionnaire;
49 + private OpenMyRewardsEventModel openRewards;
48 private VouchersActivityEventModel vouchersActivity; 50 private VouchersActivityEventModel vouchersActivity;
49 private VouchersFetchedEventModel vouchersFetched; 51 private VouchersFetchedEventModel vouchersFetched;
50 private CouponEventModel coupon; 52 private CouponEventModel coupon;
...@@ -81,6 +83,10 @@ public class WarplyEventBusManager { ...@@ -81,6 +83,10 @@ public class WarplyEventBusManager {
81 this.questionnaire = questionnaire; 83 this.questionnaire = questionnaire;
82 } 84 }
83 85
86 + public WarplyEventBusManager(OpenMyRewardsEventModel openRewards) {
87 + this.openRewards = openRewards;
88 + }
89 +
84 public WarplyEventBusManager(RefreshVouchersEventModel vouchersRefreshed) { 90 public WarplyEventBusManager(RefreshVouchersEventModel vouchersRefreshed) {
85 this.vouchersRefreshed = vouchersRefreshed; 91 this.vouchersRefreshed = vouchersRefreshed;
86 } 92 }
...@@ -318,4 +324,8 @@ public class WarplyEventBusManager { ...@@ -318,4 +324,8 @@ public class WarplyEventBusManager {
318 public RefreshVouchersEventModel getRefreshVouchersEventModel() { 324 public RefreshVouchersEventModel getRefreshVouchersEventModel() {
319 return vouchersRefreshed; 325 return vouchersRefreshed;
320 } 326 }
327 +
328 + public OpenMyRewardsEventModel getOpenMyRewardsEventModel() {
329 + return openRewards;
330 + }
321 } 331 }
......
...@@ -88,6 +88,7 @@ import ly.warp.sdk.db.WarplyDBHelper; ...@@ -88,6 +88,7 @@ import ly.warp.sdk.db.WarplyDBHelper;
88 import ly.warp.sdk.io.models.CouponEventModel; 88 import ly.warp.sdk.io.models.CouponEventModel;
89 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; 89 import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel;
90 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; 90 import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel;
91 +import ly.warp.sdk.io.models.OpenMyRewardsEventModel;
91 import ly.warp.sdk.io.models.QuestionnaireEventModel; 92 import ly.warp.sdk.io.models.QuestionnaireEventModel;
92 import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel; 93 import ly.warp.sdk.io.models.RefreshUnifiedCouponsEventModel;
93 import ly.warp.sdk.io.models.RefreshVouchersEventModel; 94 import ly.warp.sdk.io.models.RefreshVouchersEventModel;
...@@ -495,6 +496,10 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { ...@@ -495,6 +496,10 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
495 // Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), LoyaltyWallet.class); 496 // Intent intent = new Intent((WarpActivity != null && !WarpActivity.isFinishing()) ? WarpActivity : getContext(), LoyaltyWallet.class);
496 // getContext().startActivity(intent); 497 // getContext().startActivity(intent);
497 498
499 + OpenMyRewardsEventModel openMyRewards = new OpenMyRewardsEventModel();
500 + openMyRewards.setOpen(true);
501 + EventBus.getDefault().post(new WarplyEventBusManager(openMyRewards));
502 +
498 RefreshVouchersEventModel vouchersRefreshed = new RefreshVouchersEventModel(); 503 RefreshVouchersEventModel vouchersRefreshed = new RefreshVouchersEventModel();
499 vouchersRefreshed.setRefreshed(true); 504 vouchersRefreshed.setRefreshed(true);
500 EventBus.getDefault().post(new WarplyEventBusManager(vouchersRefreshed)); 505 EventBus.getDefault().post(new WarplyEventBusManager(vouchersRefreshed));
......