Showing
5 changed files
with
114 additions
and
4 deletions
... | @@ -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-cosbeta8' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta9' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ... | ... |
... | @@ -8,10 +8,10 @@ import android.widget.ImageView; | ... | @@ -8,10 +8,10 @@ import android.widget.ImageView; |
8 | import android.widget.LinearLayout; | 8 | import android.widget.LinearLayout; |
9 | import android.widget.TextView; | 9 | import android.widget.TextView; |
10 | 10 | ||
11 | -import androidx.constraintlayout.widget.ConstraintLayout; | ||
12 | import androidx.recyclerview.widget.LinearLayoutManager; | 11 | import androidx.recyclerview.widget.LinearLayoutManager; |
13 | import androidx.recyclerview.widget.RecyclerView; | 12 | import androidx.recyclerview.widget.RecyclerView; |
14 | 13 | ||
14 | +import org.greenrobot.eventbus.EventBus; | ||
15 | import org.json.JSONException; | 15 | import org.json.JSONException; |
16 | import org.json.JSONObject; | 16 | import org.json.JSONObject; |
17 | 17 | ||
... | @@ -24,12 +24,14 @@ import ly.warp.sdk.io.models.Campaign; | ... | @@ -24,12 +24,14 @@ import ly.warp.sdk.io.models.Campaign; |
24 | import ly.warp.sdk.io.models.CampaignList; | 24 | import ly.warp.sdk.io.models.CampaignList; |
25 | import ly.warp.sdk.io.models.Couponset; | 25 | import ly.warp.sdk.io.models.Couponset; |
26 | import ly.warp.sdk.io.models.CouponsetsList; | 26 | import ly.warp.sdk.io.models.CouponsetsList; |
27 | +import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; | ||
28 | +import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; | ||
29 | +import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | ||
27 | import ly.warp.sdk.io.models.MergedGifts; | 30 | import ly.warp.sdk.io.models.MergedGifts; |
28 | import ly.warp.sdk.utils.WarpUtils; | 31 | import ly.warp.sdk.utils.WarpUtils; |
29 | import ly.warp.sdk.utils.WarplyManagerHelper; | 32 | import ly.warp.sdk.utils.WarplyManagerHelper; |
30 | -import ly.warp.sdk.views.adapters.CouponsetsAdapter; | 33 | +import ly.warp.sdk.utils.managers.WarplyEventBusManager; |
31 | import ly.warp.sdk.views.adapters.MergedGiftsAdapter; | 34 | import ly.warp.sdk.views.adapters.MergedGiftsAdapter; |
32 | -import ly.warp.sdk.views.adapters.ProfileCampaignAdapter; | ||
33 | 35 | ||
34 | 36 | ||
35 | public class GiftsForYouActivity extends Activity implements View.OnClickListener { | 37 | public class GiftsForYouActivity extends Activity implements View.OnClickListener { |
... | @@ -178,8 +180,12 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene | ... | @@ -178,8 +180,12 @@ public class GiftsForYouActivity extends Activity implements View.OnClickListene |
178 | mAdapterMergedGifts.getPositionClicks() | 180 | mAdapterMergedGifts.getPositionClicks() |
179 | .doOnNext(dataItem -> { | 181 | .doOnNext(dataItem -> { |
180 | if (dataItem.getDataType() == 1) { | 182 | if (dataItem.getDataType() == 1) { |
183 | + EventBus.getDefault().post(new WarplyEventBusManager().postWarplyEventBus("gifts", new LoyaltyGiftsForYouOfferClickEvent())); | ||
184 | + | ||
181 | startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(dataItem.getCampaign()))); | 185 | startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(dataItem.getCampaign()))); |
182 | } else if (dataItem.getDataType() == 2) { | 186 | } else if (dataItem.getDataType() == 2) { |
187 | + EventBus.getDefault().post(new WarplyEventBusManager().postWarplyEventBus("ccms", new LoyaltyContextualOfferModel())); | ||
188 | + | ||
183 | Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class); | 189 | Intent intent = new Intent(GiftsForYouActivity.this, CouponsetInfoActivity.class); |
184 | intent.putExtra("couponset", (Serializable) dataItem.getCouponset()); | 190 | intent.putExtra("couponset", (Serializable) dataItem.getCouponset()); |
185 | startActivity(intent); | 191 | startActivity(intent); | ... | ... |
... | @@ -10,9 +10,13 @@ import android.widget.TextView; | ... | @@ -10,9 +10,13 @@ import android.widget.TextView; |
10 | import androidx.recyclerview.widget.LinearLayoutManager; | 10 | import androidx.recyclerview.widget.LinearLayoutManager; |
11 | import androidx.recyclerview.widget.RecyclerView; | 11 | import androidx.recyclerview.widget.RecyclerView; |
12 | 12 | ||
13 | +import org.greenrobot.eventbus.EventBus; | ||
14 | + | ||
13 | import ly.warp.sdk.R; | 15 | import ly.warp.sdk.R; |
16 | +import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | ||
14 | import ly.warp.sdk.utils.WarpUtils; | 17 | import ly.warp.sdk.utils.WarpUtils; |
15 | import ly.warp.sdk.utils.WarplyManagerHelper; | 18 | import ly.warp.sdk.utils.WarplyManagerHelper; |
19 | +import ly.warp.sdk.utils.managers.WarplyEventBusManager; | ||
16 | import ly.warp.sdk.views.adapters.ProfileCampaignAdapter; | 20 | import ly.warp.sdk.views.adapters.ProfileCampaignAdapter; |
17 | 21 | ||
18 | 22 | ||
... | @@ -86,6 +90,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener | ... | @@ -86,6 +90,7 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener |
86 | mRecyclerMore.setAdapter(mAdapterMore); | 90 | mRecyclerMore.setAdapter(mAdapterMore); |
87 | mAdapterMore.getPositionClicks() | 91 | mAdapterMore.getPositionClicks() |
88 | .doOnNext(gift -> { | 92 | .doOnNext(gift -> { |
93 | + EventBus.getDefault().post(new WarplyEventBusManager().postWarplyEventBus("firebase", new LoyaltySDKFirebaseEventModel())); | ||
89 | startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(gift))); | 94 | startActivity(WarpViewActivity.createIntentFromURL(this, WarplyManagerHelper.constructCampaignUrl(gift))); |
90 | }) | 95 | }) |
91 | .doOnError(error -> { | 96 | .doOnError(error -> { | ... | ... |
warply_android_sdk/src/main/java/ly/warp/sdk/io/models/LoyaltyGiftsForYouOfferClickEvent.java
0 → 100644
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 | +import java.util.HashMap; | ||
29 | + | ||
30 | +/** | ||
31 | + * Created by Panagiotis Triantafyllou on 27-May-22. | ||
32 | + */ | ||
33 | + | ||
34 | +public class LoyaltyGiftsForYouOfferClickEvent { | ||
35 | + private String title; | ||
36 | + private String imageUrl; | ||
37 | + private String loyaltyPackageId; | ||
38 | + | ||
39 | + public LoyaltyGiftsForYouOfferClickEvent() { | ||
40 | + this.title = ""; | ||
41 | + this.imageUrl = ""; | ||
42 | + this.loyaltyPackageId = ""; | ||
43 | + } | ||
44 | + | ||
45 | + public String getTitle() { | ||
46 | + return title; | ||
47 | + } | ||
48 | + | ||
49 | + public void setTitle(String title) { | ||
50 | + this.title = title; | ||
51 | + } | ||
52 | + | ||
53 | + public String getImageUrl() { | ||
54 | + return imageUrl; | ||
55 | + } | ||
56 | + | ||
57 | + public void setImageUrl(String imageUrl) { | ||
58 | + this.imageUrl = imageUrl; | ||
59 | + } | ||
60 | + | ||
61 | + public String getLoyaltyPackageId() { | ||
62 | + return loyaltyPackageId; | ||
63 | + } | ||
64 | + | ||
65 | + public void setLoyaltyPackageId(String loyaltyPackageId) { | ||
66 | + this.loyaltyPackageId = loyaltyPackageId; | ||
67 | + } | ||
68 | +} |
1 | package ly.warp.sdk.utils.managers; | 1 | package ly.warp.sdk.utils.managers; |
2 | 2 | ||
3 | +import java.util.HashMap; | ||
4 | + | ||
3 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; | 5 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; |
6 | +import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; | ||
4 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | 7 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; |
8 | +import ly.warp.sdk.io.request.WarplyEditAddressRequest; | ||
5 | 9 | ||
6 | /** | 10 | /** |
7 | * Created by Panagiotis Triantafyllou on 26/Απρ/2022. | 11 | * Created by Panagiotis Triantafyllou on 26/Απρ/2022. |
... | @@ -10,6 +14,11 @@ public class WarplyEventBusManager { | ... | @@ -10,6 +14,11 @@ public class WarplyEventBusManager { |
10 | private String eventName; | 14 | private String eventName; |
11 | private LoyaltySDKFirebaseEventModel fireEvent; | 15 | private LoyaltySDKFirebaseEventModel fireEvent; |
12 | private LoyaltyContextualOfferModel ccms; | 16 | private LoyaltyContextualOfferModel ccms; |
17 | + protected HashMap<String, Object> mWarplyEventBusManager = new HashMap(); | ||
18 | + | ||
19 | + public WarplyEventBusManager() { | ||
20 | + | ||
21 | + } | ||
13 | 22 | ||
14 | public WarplyEventBusManager(String eventName) { | 23 | public WarplyEventBusManager(String eventName) { |
15 | this.eventName = eventName; | 24 | this.eventName = eventName; |
... | @@ -22,4 +31,26 @@ public class WarplyEventBusManager { | ... | @@ -22,4 +31,26 @@ public class WarplyEventBusManager { |
22 | public WarplyEventBusManager(LoyaltyContextualOfferModel ccms) { | 31 | public WarplyEventBusManager(LoyaltyContextualOfferModel ccms) { |
23 | this.ccms = ccms; | 32 | this.ccms = ccms; |
24 | } | 33 | } |
34 | + | ||
35 | + public WarplyEventBusManager postWarplyEventBus(String eventName, LoyaltySDKFirebaseEventModel fireEvent) { | ||
36 | + mWarplyEventBusManager.clear(); | ||
37 | + mWarplyEventBusManager.put(eventName, fireEvent); | ||
38 | + return this; | ||
39 | + } | ||
40 | + | ||
41 | + public WarplyEventBusManager postWarplyEventBus(String eventName, LoyaltyContextualOfferModel ccms) { | ||
42 | + mWarplyEventBusManager.clear(); | ||
43 | + mWarplyEventBusManager.put(eventName, ccms); | ||
44 | + return this; | ||
45 | + } | ||
46 | + | ||
47 | + public WarplyEventBusManager postWarplyEventBus(String eventName, LoyaltyGiftsForYouOfferClickEvent gifts) { | ||
48 | + mWarplyEventBusManager.clear(); | ||
49 | + mWarplyEventBusManager.put(eventName, gifts); | ||
50 | + return this; | ||
51 | + } | ||
52 | + | ||
53 | + public HashMap<String, Object> subscribeWarplyEventBus() { | ||
54 | + return mWarplyEventBusManager; | ||
55 | + } | ||
25 | } | 56 | } | ... | ... |
-
Please register or login to post a comment